Camera pitch and bank

Hi Xith3D folks,

I just started with Xith3D and it’s really cool :slight_smile:

However, I need to implement a vehicle based camera and I am stuck at the part where the camera needs to be moved relative to the vehicles pitch and bank values. The only way I can think of is by setting the up-vector in the view.getTransform().lookAt function. Yet I failed to understand the function of the up-vector apart from some values (0,1,0) providing pitch=0 and bank=0.

Any ideas ?

Transforms were too driving me crazy this morning, and I’m having some though times with simple trignometry :-[

But I realised it was easier to have a Camera object with two TransformGroups: one for handling rotation and for translation. I use the .lookAt method on my rotation transform, multiply with the translation transform then to set as the view’s transform. Not sure if this approach could be help you too.

Regarding moving the view relative to another coordinate system, I think you can achieve that by rotation the View’s transform by the same of your vehicle, then apply a translation, then undo the first rotation.

I’m not an expert, but just an idea :wink:

If I remember correctly, up vector is only to tell where’s the “sky” for the camera.