SimplyMaya Forums

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

SM Forums / Maya Questions / Programming / Rotation Matrix from transform, rotation, and pivot

Programming MEL Scripts, Expressions & Programming Related Topics

Join the conversation. Reply to post
Thread Tools
01-03-2012, 03:58 PM   #1
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?

  Reply with quote
01-03-2012, 04:07 PM   #2
Technical Director
NextDesign's Avatar
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:

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:
Imagination is more important than knowledge.

Last edited by NextDesign; 01-03-2012 at 04:17 PM.
  Reply with quote

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Precise Editing: Pivot Point diazdevinr Maya Modeling 3 25-07-2017 12:50 AM
Cannot permanently set the pivot of my group! AtaurRaziq Animation 1 25-01-2016 12:06 AM
Reset pivot point to original position and rotation AJRead Maya Basics & Newbie Lounge 1 08-12-2015 04:49 PM
transform node quation catchyid Programming 0 08-11-2015 12:47 PM
very simple Melscript needed...move selected object to origin (0,0,0) juggler7 Maya Basics & Newbie Lounge 35 14-07-2015 02:12 AM