Have attached modified code...
(look for // MOD GF for changes.)
Main change, your angle calc was the difference between the two point vectors.
This needed to change to be the angle between the cylinder axis and the new
axis, (see the second attachment) and subsequently the orthagonalAxis changed
also.
The second change was in the translation:
originVec.sub(diffVec);
changed to:
originVec.add(diffVec);
The third change was to put the rotation transform after the translation
transform.
Hope this helps,
G.
-----Original Message-----
From: John Nelson [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 4 October 2001 07:31 a.m.
Subject: Re: This doesn't work quite right...
Man... I can't believe I wrote that slop.
If you run the test program I just posted, you will see a cylinder
object rooted at the origin of the scene and a sphere. All well and
good, but the cylinder ends out in free space someplace. It should
connect to the blue sphere, but its pointing off in the wrong direction.
Since my last posting I cleaned up the translation from the cylinder
origin and put it after the rotation, but it still doesn't work. Really
strange....
-- John
Test.java
calc angles.bmp