# cameraNode understanding

I read many posts and tutorials about cameraNode but i'm yet unsure on how to (and if) i have to use it.

The problem is this. When i define a CameraNode the direction,up,left vectors of camera will be overwritten by these vectors :

up(0,1,0)  :ok

left(1,0,0) :?

dir(0,0,1) : ?

I don't understand why this should be the system used by cameraNode. This means that when i have to translate the camera

i always must remember that this is a diferent coordinate System. What is the meaning of putting these odd vectors ?

In the flag rush tutorial these vectors are more friendly setted : dir is (0,0,-1) and left is (-1,0,0).

Also i have to remember something to make the translations and rotations appear to the display ?

I used scene.updateWorldData(interpolation)  at the end of update() method. Is it right ?

This is due to the fact that

1 0 0

0 1 0

0 0 1

is the identity matrix for a nodes orientation (rotation). And the columns of a rotation matrix correspond to left, up, dir respectively.

If you want your node to have the same initial orientation that you are used to simply set the CameraNodes local rotation to:

-1 0 0

0 1 0

0 0 -1

Use updateGeometricState to insure your camera's properties are updated.

In facts i use this code :

``` camNode=new CamNode("camNode",cam); cam.setDirection(new Vector3f(0,0,-1)); cam.setLeft(new Vector3f(-1,0,0)); cam.update(); ```

I read from the tutorial that cam.update() is the comand to update the vectors dir,up,left and location. In facts i have to call it every time in the update method of BaseGame, or instead call scene.updateWorldData().

Maybe what you mean is writing this ?

``` camNode=... cam.setDirection(...) cam.setLeft(...) cam.updateGeometricState(...) ```

No, what I mean is you don't want to set anything in the camera, as the CameraNode does that for you. What you want to do is adjust the local rotation of the camera node itself.