> MIME-Version: 1.0
> Date: Wed, 3 Nov 1999 05:16:09 -0800
> From: Dong-Woo Lee <[EMAIL PROTECTED]>
> Subject: Re: [JAVA3D] How can I rotate with the axis of Z?
> To: [EMAIL PROTECTED]
>
> What I want to do is using RotationInterpolator!!
>
> RotationInterpolator(Alpha alpha, TransformGroup
> target, Transform3D axisOfRotation, float
> minimumAngle, float maximumAngle)
>
> This is creator of the Rot Interpolator.
>
> axisOfRotation is the axis of rotation.
>
> How can I change this axisOfRotation for rotation with
> axis Z?
>
>
The RotationInterpolator rotates about the Y-axis of its local coordinate
system. To change this you must supply an axisOfRotation that transforms
the Y-axis. If your case, you want a rotation about the Z-axis. To do
this you need to rotate the local axis PI / 2 radians (90 degrees) about
the X-axis:
// Create an AxisAngle along the X-axis with a quarter rotation
// (90 degrees)
AxisAngle4f axisAngle = new AxisAngle4f(1.0f, 0.0f, 0.0f,
-(float)Math.PI / 2.0f);
Transform3D zAxis = new Transform3D();
// Apply the axisAngle to the Transform3D
zAxis.setRotation(axisAngle);
RotationInterpolator rotator =
new RotationInterpolator(rotationAlpha, objTrans, zAxis,
0.0f, (float) Math.PI*2.0f);
Dan Petersen
Java 3D Team
Sun Microsystems
** Look for the new newsgroup: comp.lang.java.3d **
===========================================================================
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".