Sorry I don't have a lot of time, but it looks like you are actually
transforming your world, not your view platform.  By inserting the cameraTG
where you are, it looks like it is on the wrong side of the scene graph.  If
this isn't enough hints let me know and I will try to find a code snippet
somewhere.

Dave Yazel

-----Original Message-----
From: Thomas Gilbert Giusepe [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 10:58 AM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Problems with lookAt


Hi there,
I am trying to setup my lookAt as follow:

--
VirtualUniverse universeVU = new VirtualUniverse();
//etc etc
Transform3D T3D = new Transform3D();
translate.set( 0.0f, 0.0f, 0.0f);
T3D.setTranslation(translate);
//#1
cameraTG.setTransform(T3D);

T3D.lookAt(new Point3d(0.0,0.0,-3.0),
new Point3d(73.0,409.0,0.0 ),
new Vector3d(0.0,1.0,0.0 ));
T3D.invert();

//#2
cameraTG.setTransform(T3D);

KeyNavigatorBehavior keyNavBeh=new KeyNavigatorBehavior(cameraTG);
vpTrans.addChild(keyNavBeh);

cameraTG.addChild(viewPlatform);
// attach a BG with a 3D shape that follows my view
cameraTG.addChild(attachAvatar());

vpTrans.addChild(cameraTG);
vpRoot.addChild(vpTrans);
BranchGroup sceneRoot = createSceneGraph(mainCanvas);
--
If I use only the #1 without the #2, my lookAt doesn't take any effect but
my view is right above the ground in the expected position. If I use the #1
and #2, the lookAt takes effect but my camera looks as I have done a double
rotation on it: first 90'degrees in the Z followed by a 180'degrees in Y.
Some hints !? I don't know if it is something related with the identity
matrix, e.g. in Opengl there is a glLoadIdentity method, that you need to
call before to use the lookAt method, but in Java3D I haven't saw any
related method.

Thnx in advance....�:0). Thomas


_________________________________________________________________
Downloaden Sie MSN Explorer kostenlos unter http://explorer.msn.de/intl.asp

===========================================================================
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".

Reply via email to