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?

Dear Java 3D Experts:

My 3d object is in point (0,  0, 0), it seems viewer only look at direction from +z to -z direction, such as (0, 0, 9). Can I look at opposite direction from -z to +z, such as (-9, 0, 0)? If I change viewer to (-9, 0, 0), I cannot see anything. I will appreciate it very much if you tell me how to do it.

Thanks.

Zhangshi Yin

Reply via email to