camera rotation on own X axis

Started by FredAxis, November 13, 2013, 03:42:34 PM

Previous topic - Next topic

FredAxis

I have a skybox and I want to rotate the camera when my tablet is tilted on the X axis. It works but when I rotate the Y axis the X axis gets rotated too and so the camera does not tilt but it is rotating (like on its Z axis).

My code ..
[code]
cam.rotateCameraX((tilt+90)*rad2bogFac);
cam.rotateCameraY(yaw*rad2bogFac);
[/code]      

How would I tilt the camera the right way?

FredAxis

Simple but effective. I changed the order of rotations and it did the trick.  ;D

EgonOlsen

You might run into similar issues if rotations become for complex. In that case, take a look at the rotateAxis()-method.