The amazing Rotation Matrix: a question (Xith/J3d)

On http://www.makegames.com/3drotation/ there’s an interesting article about the rotation matrix, by Diana Gruber. [quote]Properties of the Rotation Matrix
(…) The columns of R represent the coordinates in the rotated space of unit vectors along the axes of the original space.
(…)
Rotation Matrix Conventions
(…) we have names for the 3 rows of the rotation matrix. Row 1 is called Right, row 2 is called Up and row 3 is called Out, Forward, or View. I will call it “Out” because it represents the view looking outward from your eyes. It is, in fact, the unit vector describing the direction in which you are facing.
[/quote]
Well, for us J3d/Xith users most of the explained math is being done by javax.vecmath and the J3d/Xith Transform3d().
However there looks to be a difference between the rotation matrix described in the article and our Java one. I suspect the different orientation of the Z-axis makes some/the difference. Who knows the exact ones?
Also, do we get the vectors which represent the (rotated) local coordinates from the matrix’ rows or the columns?

Say there’s some 3d model being displayed in Xith/J3d and we can use its TransformGroup’s Transform3D object to read and write its rotation matrix, and so to read and write the 3 mentioned vectors which build the model’s local coordinate system.[quote]
javax.vecmath.Matrix3f named matrix3

transformgroup.getTransform().getRotatation(matrix3);

transformgroup.getTransform().setRotation(matrix3);

matrix3.getColumn(0, rightvector);
matrix3.getColumn(1, upvector);
matrix3.getColumn(2, outvector);
outvector.negate();
[/quote]
To make it work with my models on screen, I’ve to read/write the columns of the matrix. Furthermore I’ve to negate the outvector, otherwise the model will head into the wrong direction…
Why is this so? What am I missing? Thanks. :slight_smile:

I wish contemplative Easter to everybody.

Thanks for pointing the article out. Really interesting stuff.Still digesting the material though…

Should we put an Easter Egg in Xith? :stuck_out_tongue_winking_eye: