Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Java 3D / March 2006

Tip: Looking for answers? Try searching our database.

Change view?

Thread view: 
mkv83 - 24 Mar 2006 15:43 GMT
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?
Ced - 27 Mar 2006 08:30 GMT
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
:)

I'm happy to help :)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.