If you want to rotate about an arbitrary axis then you can do it by
accessing the geometry of the shape and using a standard arbitrary rotation
transformation on the individual vertices of the shape. Then set the
coordinates back into the shapes geometry.
Im not sure if J3D actually supplies a standard method for rotation about an
arbitrary axis....so thats what i would do.
Code fragments to achive this would be
PickIntersection pi = pickResult[0].getClosestIntersection();
GeometryArray array = pi.getGeometry();
then to access points use --
array.getCoordinate(index,Point3f - or another suitable data structrure);
point 3f will then contain the vertice at the specified index.
You can get these vertices one by one and perform a transformation for the
arbitrary axis (any good computer graphics book will contain this
transform).
Then set the vertice back into the geometry. i.e.
array.setCoordinate(index,Point3f);
You'll have to make sure that the proper capability bits are set on the
shapes geometry.
Darren Cosker
>From: Sungye Kim <[EMAIL PROTECTED]>
>Reply-To: Discussion list for Java 3D API <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: [JAVA3D] Local Coordinates of Geometry or Rotation with arbitrary
> axis
>Date: Fri, 2 Feb 2001 15:44:45 +0900
>
>I have a question.
>I want to rotate a geometry. (for example, Box)
>I used VRML97 to load the geometry.
>Translation component of TransformGroup of Box is (3, 0, 0).
>I want to rotate Box with not X axis (or Y axis or Z axis) but arbitrary
>axis.
>
>(1 0 0 0), (0 1 0 3.14), (1 0 0 3.14)
>With above three vectors, I created qurternion for rotation.
>However,this make a rotation of Box with Y and X axis.
>I want to rotate just with Y and X axis of Box its local coordinate.
>The origin of this local coordinate is equal to (3,0,0) of global
>coordinate.
>What I have to do ?
>
>Thank you in advance.
>Sungye Kim.
>
>
>==============================================
>161 Gajeong-dong, Yuseong-gu, Daejeon 305-350, Korea
>
>Electronics and Telecommunications Research Insititute
>Computer Software Technology Laboratory
>Virtual Reality Research Center
>Image-based Rendering Team
>
>Sungye Kim
>
>tel : 042-860-5828
>fax : 042-860-1051
>pcs : 016-343-2375
>homepage : http://129.254.76.244
>http://insideblue.hihome.com
>e-mail : [EMAIL PROTECTED]
>==============================================
>
>
>
>
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
===========================================================================
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".