The rotX,Y,Z functions don't multiply the current transform by that value. They set
the
rotational component to that value. You need to create a second transform with the
rotational
component you desire and then multiply this with the current transform.
Jeffrey A. Kardatzke
[EMAIL PROTECTED]
-----Original Message-----
From: Michael Lee [SMTP:[EMAIL PROTECTED]]
Sent: Wednesday, December 16, 1998 8:45 AM
To: Java3D Group
Subject: [java3d] Moving the view
I want to move the view. I get the transform group from the simple universe...
But when i translate or scale it, it does it in world coordinates. I only want to do
it relatively from the camera or view.
If i rotate on the y axis, i want it on the y axis relative to the view, not the
world. The code below is what I have but it translates/rotates on the world
coordinates.
TransformGroup t = u.getViewingPlatform().getViewPlatformTransform()
Transform3D trans = new Transform3d();
t.getTransform(trans);
Vector3f viewDir = new Vector3f(0f, 0f, 0f);
Vector3f translation = new Vector3f();
trans.get(translation);
trans.transform(viewDir);
if (event.getKeyCode() == KeyEvent.VK_I) {
viewDir.y += 1;
}
etc....
else if (event.getKeyCode() == KeyEvent.VK_D) {
rotation += -.1;
trans.rotZ(rotation);
}
etc....
translation.x += viewDir.x;
translation.y += viewDir.y;
translation.z += viewDir.z;
trans.setTranslation(translation);
t.setTransform(trans);
thanks,
mike
<< File: ATT00006.htm >>
�����������������������
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/