Hi,
check is your matrix isn't reflection (reflection: det(A) = -1, rotation: det(A) = 1).
M.
Convert Matrix to Quaternion
Oh, my god, i think i solved it.
It seems my look-at matrix was incorrect. When i negate the 3rd column (the z-vector), everything (regarding quaternions) works, as expected. It seems i accidentally used a false sign in that function, but in all my code that used that matrix i just picked a look-at vector that corrected the problem. It was only the matrix-to-quaternion conversion code, that could not convert that matrix correctly. Damn.
Thanks for all your help and suggestions!
Jan.
It seems my look-at matrix was incorrect. When i negate the 3rd column (the z-vector), everything (regarding quaternions) works, as expected. It seems i accidentally used a false sign in that function, but in all my code that used that matrix i just picked a look-at vector that corrected the problem. It was only the matrix-to-quaternion conversion code, that could not convert that matrix correctly. Damn.
Thanks for all your help and suggestions!
Jan.
Quote:Original post by Jan K
Oh, my god, i think i solved it.
It seems my look-at matrix was incorrect. When i negate the 3rd column (the z-vector), everything (regarding quaternions) works, as expected. It seems i accidentally used a false sign in that function, but in all my code that used that matrix i just picked a look-at vector that corrected the problem. It was only the matrix-to-quaternion conversion code, that could not convert that matrix correctly. Damn.
Thanks for all your help and suggestions!
Jan.
see also:
http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm
For this method matrix on input must be so called special orthogonal matrix (no reflection), while the matrix you posted didn't satisfy this property. I recommend you to guard this condition with good old assertion. This way you would be able find problem with that lookAt much more quickly.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement