# SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

 SM Forums / Maya Questions / Programming / Rotation Matrix from transform, rotation, and pivot
 Register FAQ Calendar Mark Forums Read

 Programming MEL Scripts, Expressions & Programming Related Topics

 01-03-2012, 03:58 PM #1 devthep Registered User   Join Date: Mar 2012 Posts: 1 Rotation Matrix from transform, rotation, and pivot Hi all, I have a problem where i trying to develope a rotation matrix knowing a objects transform (x,y,z), rotation (x,y,z) world pivot (x,y,z). i think key is to figure out theta from rotation (x,y,z), but don't know. This might be a basic algebra question, but i'm trying to do it in maya. Thanks for any help. Do i do it like theta = tan-1 (-z/sqrt(x^2+y^2)) from xyz of rotation and go from there? thanks
 01-03-2012, 04:07 PM #2 NextDesign Technical Director     Join Date: Feb 2004 Posts: 2,988 Hi devthep, you mean like an OpenGL rotation matrix? You can get the transformation matrix of an object by running the following: Code: `xform -q -m `ls -sl`;` This will give you a standard 4x4 matrix. If the object is at the origin, and has not been modified, it returns the 0-1 identity matrix. You can then decompose it to find the rotation matrix. You can also do the following in python: www.akeric.com/blog/?p=1067 __________________ Imagination is more important than knowledge. Last edited by NextDesign; 01-03-2012 at 04:17 PM.