0
votes

I found this on stackoverflow.

"You will probably need to use quaternions for composing rotations, if you are not doing so already. This avoids the problem of gimbal lock which you can get when orienting a camera by rotation around the 3 axes."

But how do I use the quaternion from the motionmanager in opengl. the code was first based on pitch and yaw only. Now I want to use the roll also, so you can use the gyroscope to look around. Could anybody help me this one?

Thank you.

1

1 Answers

0
votes

My advice, don't use Eulers. Just track orientation with vectors(Forward, up, and right) for the object or camera.

To rotate, just do relative rotations of the current forward, up and right. Like rotate right 5 degress.

Quanternions have excessvie operations and physics don't work via yaw, pitch and roll, they are merely measurements to capture orientation, not how things get orientated.