Changing the view is done like that :
ViewingPlatform platform = universe.getViewingPlatform();
TransformGroup platformTransformGroup =
platform.getViewPlatformTransform();
Transform3D camera = new Transform3D();
platformTransformGroup.getTransform(camera);
Point3d cameraPosition = new Point3d(-0.2, 1.5, 2.5);
camera.lookAt(cameraPosition, new Point3d(1, 0, 0), new Vector3d(0, 5,
0));
camera.invert();
platformTransformGroup.setTransform(camera);
JAVADOC FOR LOOKAT :
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lookAt
public void lookAt(Point3d eye,
Point3d center,
Vector3d up)
Helping function that specifies the position and orientation of a
view matrix. The inverse of this transform can be used to control the
ViewPlatform object within the scene graph.
Parameters:
eye - the location of the eye
center - a point in the virtual world where the eye is looking
up - an up vector specifying the frustum's up direction
mkv83 - 27 Mar 2006 22:10 GMT
Thank you so much!! You have saved my sanity!!
Ced - 28 Mar 2006 11:08 GMT