javascript - Rotation does not change after setting transformation matrix for camera -


any idea how apply transformation matrix perspectivecamera? have transformation matrix , setting perspective camera using

camera.applymatrix(transformationmatrix); 

it correctly sets camera.position camera.quaternion remains unchanged. rotation works when set camera.matrixautoupdate = false breaks trackballcontrols. have tried adding camera.updatematrix trackballcontrols again, resets rotation. have tried setting position, quaternion , scale of camera manually as:

camera.matrixautoupdate = false; camera.usequaternion = true;  var position = new three.vector3(); var quaternion = new three.quaternion(); var scale = new three.vector3(1, 1, 1); transformationmatrix.decompose(position, quaternion, scale);  camera.position.copy(position); camera.quaternion.coy(quaternion); camera.scale.copy(scale);  camera.updatematrix(); 

it yields same result, set correctly trackballcontrols not work.

edit: want set matrix once, not @ every frame.

inside animate loop try call camera.matrix.identity() before camera.applymatrix(transformationmatrix) , call controls.update() after camera.applymatrix(transformationmatrix):

http://jsfiddle.net/95u904m7/1/


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -