Skip to main content

Flying camera implementation

2 replies [Last post]
Joined: 2010-08-10

Some sample code I downloaded has methods to translate and move around my virtual terrain but the behavior is not quite what I want. I tried tweaking it but I'm new to j3d (and 3d programming altogether) I was wondering if anyone had a sample implementation of a "flying camera". Where the mouse controls the direction and forward and back will move along an imaginary axis that the mouse is pointing while the left-right keys will strafe the view. Thanks!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-11-16

Check for Java3D tutorials and samples - there is something like that if I remember correctly.
Look for MoverBehavior

Also, maybe this is what you want? :

Joined: 2010-08-02

I don't know if this fits your bill, but if you look here:
(hope that doesn't get broken)

and follow the "viewR" TransformGroup, I hope you can see what I'm doing.

I split translation and 'scale' away from rotation so that they dont impact each other as much.

I Rotate the 'scene' rather than the camera. You can see the finished program at:

Let me know if you have questions.