saurabh,
In Java 3D, the screw or orbit transform has to be constructed
from the axial rotation, sandwiched between translations to and
from the axis. Try this rotation by 30 degrees about an axis in
the z direction through (0.0, 1.0, 0.0):
import javax.media.j3d.*;
import javax.vecmath.*;
public class ConsoleApp
{ public static void main(String args[])
{
Transform3D orbit = new Transform3D();
Transform3D translate_to_axis = new Transform3D();
translate_to_axis.set(new Vector3d(0.0, 1.0, 0.0));
Transform3D rotate_about_axis = new Transform3D();
rotate_about_axis.rotZ(30*Math.PI/180.0);
orbit.mul(translate_to_axis, rotate_about_axis);
orbit.mulInverse(translate_to_axis);
System.out.println("translate_to_axis =
\n"+translate_to_axis);
System.out.println("rotate_about_axis =
\n"+rotate_about_axis);
System.out.println("orbit = \n"+orbit);
}
/*
translate_to_axis =
1.0, 0.0, 0.0, 0.0
0.0, 1.0, 0.0, 1.0
0.0, 0.0, 1.0, 0.0
0.0, 0.0, 0.0, 1.0
rotate_about_axis =
0.8660254037844387, -0.49999999999999994, 0.0, 0.0
0.49999999999999994, 0.8660254037844387, 0.0, 0.0
0.0, 0.0, 1.0, 0.0
0.0, 0.0, 0.0, 1.0
orbit =
0.8660254037844387, -0.49999999999999994, 0.0,
0.49999999999999994
0.49999999999999994, 0.8660254037844387, 0.0,
0.1339745962155613
0.0, 0.0, 1.0, 0.0
0.0, 0.0, 0.0, 1.0
*/
}
In my packages, I do the translation along a line normal to the
axis. I forget whether this was a hard geometric requirement or
if it just fixed a problem du jour.
HTH,
Fred Klingener
Brock Engineering
----- Original Message -----
From: "Saurabh Akhauri" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 29, 2002 3:38 AM
Subject: [JAVA3D] rotation about axis
> I want to have customised rotation behaviour
> that rotates the view platform around a specified
> axis.
> I have been trying things with orbit behaviour
> but not much succesful yet
> all i have been able to achieve till now is the
> rotation about the center point of specified axis
> by changing the rotation center of orbitbehavior class
>
> can some one provide me with some details
> on how view platform can be rotated about any specified axis
>
> regards
> saurabh
>
>
================================================================
===========
> 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".
>
>
===========================================================================
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".