Forum Discussion
AndyTheBald
11 years agoHonored Guest
The eye pose, and left-handed game engines
Hi there I'm struggling at the moment combining the pose's orientation with our view matrix, in our left-handed game engine. If I convert the quat as-is to a matrix, and then multiply it by our ...
jherico
11 years agoAdventurer
"AndyTheBald" wrote:
If I invert the quat, then for simple movements from the reference pose, then everything moves in the correct direction. However if I pitch the hmd 90deg down, and then roll the hmd 90deg left, it produced the wrong transform. It's as if it has rolled, and then pitched.
First off, quaternions don't have handedness. You do need to ensure that you have the correct X/Y/Z mappings when using a quaternion, but handedness is something that's accounted for at the time of conversion from a quaternion into another type that does include handedness (like Euler angles or a matrix).
The reason you have to invert the quaternion when applying it to the modelview matrix is that the head pose is in user/camera space, while the modelview matrix is in view space, which is the inverse of user space.
Depending what math library you're using you can take a variety of approaches. The OVR C++ math library Quat type includes a GetEulerAngles(T *a, T *b, T *c) method that allows you to specify the handedness and direction of spin for each axis. If you copy the head pose ovrQuat into that type you should be able to get the Euler angles you need for your handedness and construct you matrix from that.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 months ago
- 1 year ago
- 2 years ago
- 9 months ago