AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Change view?

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java
View previous topic :: View next topic  
Author Message
mkv83
Guest





PostPosted: Fri Mar 24, 2006 3:12 pm    Post subject: Change view? Reply with quote



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





PostPosted: Mon Mar 27, 2006 8:12 am    Post subject: Re: Change view? Reply with quote



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





PostPosted: Mon Mar 27, 2006 9:12 pm    Post subject: Re: Change view? Reply with quote



Thank you so much!! You have saved my sanity!!
Back to top
Ced
Guest





PostPosted: Tue Mar 28, 2006 10:12 am    Post subject: Re: Change view? Reply with quote

:)

I'm happy to help Smile
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> 3D Graphics API's for Java All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.