Christian,

I have just tried:
x = 80, y = 60, z = 220

The rotation matrix generated was:
-0.38302222155948923, -0.5417163025642604, -0.7482228446978484
-0.3213938048432698, -0.6812355465900677, 0.657741706348699
-0.8660254037844387, 0.4924038765061043, 0.08682408883346511

and the results from the routine I supplied come back as:
x = 80, y = 60, z = 219

I've tried a variety of other combinations and all are working ok for me.
The algorithm is essentially the reverse of the optimized algorithm for
generating a rotation matrix from the 3 matrices for X, Y and Z rotation
(according to the FAQ). The optimized algorithm is 1,000% faster than a
naive X*Y*Z to generate the composite rotation matrix.

Scepticism is good!

Daniel Selman
Tornado Labs Ltd.

Email:   [EMAIL PROTECTED]
Web:     http://www.tornadolabs.com
Phone:   +44 (0131) 343 2513
Fax:     +44 07070 800 483




-----Original Message-----
From: Christian Petermann [mailto:[EMAIL PROTECTED]]On Behalf Of
Christian Petermann
Sent: 04 May 1999 11:28
To: Daniel Selman
Cc: Guillaume Bedard; [EMAIL PROTECTED]
Subject: RE: [java3d] getRotation() from a Transform3D


For example, if you want a rotation along the X-axis and a rotation along
the Y-axis.
You multiply them together to get a rotation matrix on X and Y axis.
In the resulting matrix at the position (2,0) you will have a cos @ * sin
@1
(where @ is the angle on the X-axis and @1 the angle on the Y-axis)
In your code you assume there is only a -sine. In that specific case, the
sine is at (0,2).
However if the multiplcation is done in a different order, ie YX then
your code looks Ok. :)
Another case where it looks ok is when you have a ZY matrix. For all the
other cases,
I can't see how it can work...

Did you try it when you have cases like (YZ, XZ, XYZ,...)?

Chris.


=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to