0
votes

I have a Three.js perspective camera and it orients differently in different browsers. I'm trying to normalize the behavior by rotating the camera in Firefox to match Chrome. However, rotating the camera 90 degrees in the render loop causes the x-axis rotation to be off.

camera.rotation.y = camera.rotation.y - (90 * Math.PI / 180);

It looks like the camera is rotating around the y-axis without updating so that the x-axis is in the right place, so what would normally control pitch in my environment (x), is controlling roll (which should be z). Do I have to update the euler order? That seems like a less than ideal solution.

1
'It orients differently in different browsers' do you have an example ?Mouloud88

1 Answers

0
votes

When you use an euler you can inverse the vector order :

var a = new THREE.Euler( 0, 1, 1.57, 'XYZ' );

If the vector order doesn't corresponds your expectation you can use the reorder function.

a.reorder('ZYX');

As far as I'm concerned, that's the best you can do to solve your problem.