Forum Discussion
Matlock
12 years agoHonored Guest
GetPredictedOrientation() causes shear on roll
Quatf hmdOrient = poculussensor->GetPredictedOrientation(); Matrix4f View = Matrix4f(hmdOrient); If you use this matrix to render, yaw, and pitch work as intended, but of you roll(twist) your head...
kojack
12 years agoMVP
Check if the quaternion is unit length. A non unit length quaternion can do all kinds of freaky stuff (skewing and distorting), while a unit length one will be a simple rotation.
Hmm. Looking at the code, the oculus sdk converts a quaternion to a matrix using this code:
But the standard formula for converting is:
Everything is the same except the main diagonal.
Hmm. Looking at the code, the oculus sdk converts a quaternion to a matrix using this code:
return Matrix4f(float(ww + xx - yy - zz), float(T(2) * (x*y - w*z)), float(T(2) * (x*z + w*y)),
float(T(2) * (x*y + w*z)), float(ww - xx + yy - zz), float(T(2) * (y*z - w*x)),
float(T(2) * (x*z - w*y)), float(T(2) * (y*z + w*x)), float(ww - xx - yy + zz) );
But the standard formula for converting is:
1 - 2*qy2 - 2*qz2 2*qx*qy - 2*qz*qw 2*qx*qz + 2*qy*qw
2*qx*qy + 2*qz*qw 1 - 2*qx2 - 2*qz2 2*qy*qz - 2*qx*qw
2*qx*qz - 2*qy*qw 2*qy*qz + 2*qx*qw 1 - 2*qx2 - 2*qy2
Everything is the same except the main diagonal.
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
- 4 years ago