Closed fareed945 closed 1 year ago
The pitch and yaw are Euler angles, with a YXZ
order. Pitch is X
, yaw is Y
, and roll is Z
. You might need to add in a minus sign or two or add or subtract pi to get things to match up with three.js.
Thanks, i'll try this out and confirm
hey @mpetroff i'm struggling to get them in-line, few clarifications
1) The order of rotation is YXZ where-in y is yaw
, x is pitch
and Z is roll
. Correct ?
2) Should roll be set to Zero?
In case it's helpful, here's a snippet showing how to go the opposite direction, to synchronize Pannellum to a three.js camera:
var quat = new THREE.Quaternion();
var euler = new THREE.Euler(0, 0, 0, 'YXZ');
camera.getWorldQuaternion(quat); // THREE.PerspectiveCamera
euler.setFromQuaternion(quat, 'YXZ');
var pitch = -euler.x;
var yaw = Math.PI + euler.y;
var roll = euler.z - Math.PI;
Hey, thanks a ton for this amazing light weight library !! I'm kind of confused as to how to convert these pitch, yaw to the three.js camera target vectors . Anyone can help on this ? Basically, i'm synchronizing pannellum with another third party 3d rendering library, that uses three.js