#### Archived

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

# How to convert an orientation matrix to quaternion and viceversa?

This topic is 6091 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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 on other sites
http://skal.planet-d.net/demo/matrixfaq.htm

Probably in there somewhere

##### Share on other sites
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 on other sites
Hi!

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

Best Regards!
Oscar

• 11
• 19
• 12
• 9
• 34
• ### Forum Statistics

• Total Topics
631398
• Total Posts
2999840
×