There
are two parts to locating the viewer Zhangshi, the position and the
orientation. With no rotation you are simply looking along -z, so at
(0,0,-9) you would have the object behind you.
The
following puts the viewer at position (0,0,6) then rotates about the Y
axis. The result is that you finish looking along -x with an effective
position of (6,0,0):
Transform3D t = new
Transform3D();
t.set(new Vector3d(0, 0, 6)); Transform3D t2 = new Transform3D(); t2.rotY(Math.PI/2); t2.mul(t); viewTransform.setTransform(t2); // viewTransform is the view platform TransformGroup Another way is to rotate, then set the translation, so
to be at (0,0,-9) looking along +z, you could do something
like:
Transform3D t = new
Transform3D();
t.rotZ(Math.PI); // Look along
+z
t.setTranslation( new Vector3d(0,0,9)
); // Position on rotated axes
viewPlatform.setTransform(t);
Tony
-----Original Message----- From: Zhangshi Yin [mailto:[EMAIL PROTECTED]] Sent: 14 November 2001 01:34 To: [EMAIL PROTECTED] Subject: [JAVA3D] How to view an object from opposite direction?
|
- [JAVA3D] How to view an object from opposite direction? Zhangshi Yin
- Re: [JAVA3D] How to view an object from opposite dire... Xiaowen Wang
- Re: [JAVA3D] How to view an object from opposite dire... Burrows Anthony
- Re: [JAVA3D] How to view an object from opposite dire... Zhangshi Yin