Mark,
I think I see what you are saying. Don't use the lookAt on the
geometries, instead use it on the camera. I've included a snippet of some
of my code to let you see. My code places the camera a position in the world
and has it look at a point. I then uses the KeyboardNavigator to allow the
camera to move freely in the world. To move to each axis you could use the
setTranslation or some kind of interpolater to get the camera to move to the
desired location. Here's the code:
public SampleTerrain() {
vrmlLoader = new VrmlLoader();
flt = new FltLoader();
setLayout(new BorderLayout());
Canvas3D canvas = new Canvas3D(null);
add("Center", canvas);
SimpleUniverse simpleU = new SimpleUniverse(canvas);
BranchGroup myscene = createSceneGraph(simpleU);
simpleU.addBranchGraph(myscene);
}
/**** Set up the clipping planes, etc ****/
View virtualCamera = su.getViewer().getView();
virtualCamera.setFrontClipDistance(0.5f);
virtualCamera.setBackClipDistance(10000.0);
/**** Set up a viewing platform out in the z direction ****/
ViewingPlatform vp = su.getViewingPlatform();
vpTrans = vp.getViewPlatformTransform();
Transform3D transform = new Transform3D();
Transform3D transform2= new Transform3D();
Vector3d translate = new Vector3d(4000.0, 1000.0, 0.0); // was (0, 0, 30)
transform.setTranslation(translate);
/*** set camera in the world to look at location on terrain ***/
transform.lookAt(new Point3d(-4000.0, -2.0, -10.0),
new Point3d(-4000.0, 0.0, -6000.0),
new Vector3d(0.0, 1.0, 1.0));
vpTrans.setTransform(transform);
/*** This allows the user to move the camera with the keyboard ***/
KeyNavigatorBehavior keyNavBeh = new KeyNavigatorBehavior(vpTrans);
keyNavBeh.setSchedulingBounds(new BoundingSphere());
group.addChild(keyNavBeh);
Notice the camera is in the createSceneGraph() method, also make sure you
set your capability bits. If anymore questions let me know, I'm happy to
help out.
Shaun Sheperd
----- Original Message -----
From: "Mark Beckman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 08, 2000 11:36 AM
Subject: Re: [JAVA3D] Views
> Shaun,
> thanks for the response....
> My idea here is to let the geometry sit still while I
> move my view point (all ways looking at 0,0,0) around
> the object. I want to start by moving my 'point of
> view' to each of the axis.
> Given your advice, which Transform3D object would I
> use to call the method (lookAt) from??? I have a
> Transform3D object for each piece of geometry, but
> none (that I am aware of) for the view... Maybe I am
> missing something here...
>
> sorry for novice nature...
>
> -Mark
> --- Shaun Shepherd <[EMAIL PROTECTED]> wrote:
> > Mark,
> > I've been working with the same kind of
> > scenario over the past few
> > days. To look in different directions use the
> > lookAt method that is part of
> > the Transform3D class. It allows you look at a
> > point from a certain
> > location and specify the up vector. Controlling
> > this from a GUI should be
> > possible, I haven't tried it but I think there is a
> > way... If that's not
> > clear enough respond and maybe I can help you more.
> >
> >
> >
> > Shaun Shepherd
> >
> > Applied Research Associates
> >
> >
> > ----- Original Message -----
> > From: "Mark Beckman" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, September 08, 2000 10:53 AM
> > Subject: [JAVA3D] Views
> >
> >
> > > Hi folks...
> > >
> > > I have a simple issue (I think it's simple) that I
> > > just can't figure out.
> > >
> > > I currently have some geometry sitting at (0,0,0).
> > I
> > > am using the SimpleUniverse (with
> > > NominalViewingTransform set) to create my View
> > branch.
> > > From what I can gather, the default view has the
> > > viewer's head positioned somewhere in positive z
> > > looking in the direction of negative z. (with pos
> > y up
> > > and pos x to the right)
> > >
> > > Questions:
> > > (1) How would I move that "viewer's head" to lets
> > say
> > > somewhere in positive x (y=0,z=0) looking in the
> > > negative x direction? or vice versa, neg x looking
> > in
> > > pos x...
> > >
> > > (2) What class (group of classes) controls
> > this...???
> > >
> > > (3) At first this can be static (hard coded).
> > But
> > > eventually I will want to control this from the
> > GUI.
> > > Is this that possible???
> > >
> > >
> > > I will continue to dig...
> > > Thanks for your help.
> > >
> > > -Mark
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Mail - Free email you can access from
> > anywhere!
> > > http://mail.yahoo.com/
> > >
> > >
> >
>
===========================================================================
> > > To unsubscribe, send email to
> > [EMAIL PROTECTED] and include in the
> > body
> > > of the message "signoff JAVA3D-INTEREST". For
> > general help, send email to
> > > [EMAIL PROTECTED] and include in the body of
> > the message "help".
> > >
> >
> >
>
===========================================================================
> > To unsubscribe, send email to [EMAIL PROTECTED]
> > and include in the body
> > of the message "signoff JAVA3D-INTEREST". For
> > general help, send email to
> > [EMAIL PROTECTED] and include in the body of the
> > message "help".
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Mail - Free email you can access from anywhere!
> http://mail.yahoo.com/
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff JAVA3D-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".