Archived

This topic is now archived and is closed to further replies.

ogracian

How to convert an orientation matrix to quaternion and viceversa?

Recommended Posts

ogracian    180
Hello I have my object orientation stored in a 4x4 matrix in the following way: „ Rx, Ry, Rz, 0„  „ Ux, Uy, Uz, 0„  „ Ax, Ay, Az, 0„  „ Px, Py, Pz, 1„  where: R = Right vector U = Up Vector A = At Vector P = Position Vector so my trouble is how can I convert this orientation matrix to a quaternion to use this quatrnion for SLERP, and then convert the resulting quat to my new orientation matrix? Thanks! Oscar

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I found this a while ago, and it''s awesome! I used it in Blender 3D to convert from a Quat back to a matrices..

http://www.gamasutra.com/features/19980703/quaternions_01.htm

Scroll down, and you will see the code examples. They are written in C. I had to convert them to python!

-nt20

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Hi!

Thank you all for your posts, it has been a valuable info!!

Best Regards!
Oscar

Share this post


Link to post
Share on other sites