mrdoob/three.js — Issue #890: camera rotation always (0,0,0)
Author: towerrounder
Created: 2011-12-11 21:45:45+00:00
State: open

Hi all

Ive got a perspective camera set up like so:

camera = new THREE.PerspectiveCamera( 65, window.innerWidth / window.innerHeight, 1, 5120 );
camera.position.x = 512;
camera.position.y = 256; //Height
camera.position.z = 512;

and i use fly controls like so:

controls = new THREE.FlyControls( camera );
controls.movementSpeed = 600;
controls.domElement = container;
controls.rollSpeed = 0.5;
controls.autoForward = false;
controls.dragToLook = true;

to move around my world. It all works great but now I need to get the rotation of the camera, however its is always set to x:0 y:0 z:0

I haven't added it to my scene as I assume I'm not meant to. I have tried it but makes no difference.

Please can someone tell me how to get the camera rotation.

Thank you