 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
mkv83 Guest
|
Posted: Fri Mar 24, 2006 3:12 pm Post subject: Change view? |
|
|
if it possible to click a button and be able to view a specific object
in your scene? i have the buttons set up and they are opening new
windows to just show just screen shots of the object, is there a way to
change the view so that it is at the object? |
|
| Back to top |
|
 |
Ced Guest
|
Posted: Mon Mar 27, 2006 8:12 am Post subject: Re: Change view? |
|
|
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 |
|
| Back to top |
|
 |
mkv83 Guest
|
Posted: Mon Mar 27, 2006 9:12 pm Post subject: Re: Change view? |
|
|
Thank you so much!! You have saved my sanity!! |
|
| Back to top |
|
 |
Ced Guest
|
Posted: Tue Mar 28, 2006 10:12 am Post subject: Re: Change view? |
|
|
:)
I'm happy to help  |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|