This is actually very simple. Suppose you already know the TransformGroup for an object you want to rotate to a specific angle around the X axis. Lets call this Object TransformGroup JohnTG.
Transform3D tempT3D = new Transform3D(); (JohnTG).getTransform(tempT3D); Matrix3d someRotationMatrix = new Matrix3d(); someRotationMatrix .setIdentity(); someRotationMatrix .rotX(Math.PI/2.0); // This angle is whatever you want to make it. tempT3D.setRotation(someRotationMatrix ); (JohnTG).setTransform(tempT3D); If you want to rotate around more than just the X axis, then do your rotY and rotZ in the XYZ order and do it immediately after the rotX method and before the setRotation method. At 01:35 PM 09/30/2001 -0400, you wrote: >All, > >I've run into a problem that neither the Java3d examples or the Sun API >reference seem to be able to explain to me.... and that is how to perform >rotation traansforms. All the examples I've seen either use a mouse event >or an Alpha/Interpolator.... but all I want to do is just create a >cylinder and rotate it to a specific orientation in three-space. > >Sounds pretty simple but I haven't been able to figure it out from the >tools available. > >Now, I will tell you that I have tried creating a Maatrix3d, normalizing >it and then doing rotX, rotY and rotZ and then pumping that into a >Transform3d. But this doesn't actually seem to do anything. > >Can anyone post some example code or point me to the right place? > >-- John > >-- >_____________________________________________________ > >John T. Nelson >President | Computation.com Inc >mail: | [EMAIL PROTECTED] >company: | http://www.computation.com/ >journal of computation: | http://www.computation.org/ >_____________________________________________________ >"Providing quality IT consulting services since 1992" > >=========================================================================== >To unsubscribe, send email to [EMAIL PROTECTED] and include in the body >of the message "signoff JAVA3D-INTEREST". For general help, send email to >[EMAIL PROTECTED] and include in the body of the message "help". *********************************************************************** Eric N. Reiss MEMS Manager Swanson Center for Product Innovation Department of Mechanical Engineering School of Engineering - University of Pittsburgh 3700 O'Hara Street 647 Benedum Hall Pittsburgh, Pennsylvania 15261 Phone: 412-624-9696 FAX: 412-624-7701 Email: [EMAIL PROTECTED] http://www.sigda.org/Eric/ *********************************************************************** =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
