To move my viewport (as when moving around in my game), I do:
1 2 3 4 5 6 7 8 9
| Vector3f translate = new Vector3f(); Transform3D trans3D = new Transform3D(); translate.set ((float) posX + eyeOffX, (float) posY + eyeOffY, (float) posZ + eyeOffZ); trans3D.rotY (lookHeading); trans3D.setTranslation (translate); setSchedulingBounds (new BoundingSphere (new Point3d (translate), 10f)); viewTrans.setTransform (trans3D); |
...which works fine
BUT, if I comment-in the two commented-out lines, things go "all kablooey." I've tried rotating the XYZ in various orders (ZXY, ZYX, XZY, etc), but can't seem to get it to do what I want.
What I want is to set lookPitch to a few degrees this way or that and have my camera look down or up a little.
Hints?
Thanks!