Transform3D rotation question..(plus new question)

How do I set the Rotation of a Transform3D Obj back to the default rotation (I think they call it the identity matrix?)

For example,

If I have a program which allows me to rotate a cube primitive by mul Transform3D to the Transform3D Obj of the cube, then is there a method I can call to make the Transform3D Obj of the cube return to the Default rotation (of ‘no’ rotation)…?

Well if you really want identity, it’s just setIdentity(), see the JavaDocs.

But if it is some “default” location (identity would be the origin, with world aligned rotation (i.e. no rotation) and unit scale ) that would be the original transform matrix. You would need to store that at load or creation time and make your own method to restore those values (i.e. set()).

I suggest the JavaDocs and the Java3D tutorial for more info.

Is the identity the default transform to the parent node?

Because if so then that should be ok for me…?

Also I have some more questions on a related topic…

I want to rotate a 3D object by a certain degree (lets say 30 degrees about Y)…

I figured I could use the setEuler() method and specify the Y rotation to the specific value but I’m not sure how I would assign the value exactly…

Does the method deal with rotations in radians or in degrees and if I wanted to specify the rotation as float’s rather than double’s then is that also possible?

Also is there a Java3D method to convert degrees to radians?

Hope someone can help…

I believe that is in radians, but the JavaDocs for Java3D should say…
http://javadesktop.org/java3d/javadoc/1.3.2/index.html

The degree-to-radians and back are in java.lang.Math, again see the JavaDocs
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Math.html
and
http://java.sun.com/j2se/1.5.0/docs/api/

http://java.sun.com/products/java-media/3D/collateral/

Both which is useless…

Then I suggest a Linear Algebra class.

Really, the concept of an identity matrix is basic math. If you are having trouble with the docs I’d guess ist because you dont have the background to follow them.