Maya, Euler Rotation and Gimbal lock

272 views
Skip to first unread message

illunara

unread,
May 29, 2018, 7:04:33 AM5/29/18
to Python Programming for Autodesk Maya
Hi everybody
I have a question about euler rotation, you will find below the link to an picture


These 2 objects have same local space, rotate-order, position, identical rotation but difference rotate-value, is this a gimbal-lock issues? how can i retrieve the "similify rotate value" (0,0,-122) instead of (180, 180, -60)?

I'm using Maya 2017 Thanks

AK Eric

unread,
May 29, 2018, 2:46:45 PM5/29/18
to Python Programming for Autodesk Maya
I wouldn't say gimbal lock more as a function of how Euler rotations work within the gimbal system that constrains them:  You can have the exact same "heading" of the local axis between to objects, but they got there by rotating in completely opposite directions.  For example, one rotated with all positive values, and the other rotated with all negative values, but ultimately they keep rotating until they line up.  Or in your case, one rotated -122 on z, while the other spun all over the place to get to the same heading.  Both legit.

You said "identical rotation but difference rotate-value": I'd rephrase that:  "Identical orientations (meaning, same worldspace matrix values), but different rotate values"

Tuan Nguyen

unread,
May 29, 2018, 3:15:14 PM5/29/18
to python_in...@googlegroups.com
Hi Eric
Like you said, i used matrix to calculate data and apply rotation value back to controller. I understand that both values are legit, but is there anything i can do to control the result? How can i know which value i will get after extract data from matrix? or can i convert them vice-versa?

Thanks

On Wed, May 30, 2018 at 1:46 AM, AK Eric <war...@sbcglobal.net> wrote:
I wouldn't say gimbal lock more as a function of how Euler rotations work within the gimbal system that constrains them:  You can have the exact same "heading" of the local axis between to objects, but they got there by rotating in completely opposite directions.  For example, one rotated with all positive values, and the other rotated with all negative values, but ultimately they keep rotating until they line up.  Or in your case, one rotated -122 on z, while the other spun all over the place to get to the same heading.  Both legit.

You said "identical rotation but difference rotate-value": I'd rephrase that:  "Identical orientations (meaning, same worldspace matrix values), but different rotate values"

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/iQ2Pe-mfgRE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f7d0b89f-0592-48fa-8126-0632e10f260e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

AK Eric

unread,
May 29, 2018, 7:36:30 PM5/29/18
to Python Programming for Autodesk Maya
If you're applying the same worldpsace matrix to two nodes, but they give different rot values yet have the same heading, I would infer that each of the nodes parent's have different orientations, and you're seeing that expressed as different rot values on the two nodes.

python

unread,
May 30, 2018, 3:53:10 AM5/30/18
to Python Programming for Autodesk Maya
Hi.

I would check also if 'rt_arm_loArm_fk_ctrl' is a joint (with a shape on it), with some rotate axis or joint orient values.

Tuan Nguyen

unread,
May 30, 2018, 9:03:16 AM5/30/18
to python_in...@googlegroups.com
Hi, it's a joint and it has it own values on jointOrientation and rotateAxis. But  when i extract euler-rotation value from MTransformationMatrix, i have switch the rotateOrder match to the target as well.

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/iQ2Pe-mfgRE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.

Michael Boon

unread,
May 31, 2018, 8:22:56 PM5/31/18
to Python Programming for Autodesk Maya
Unless I'm mistaken, the Euler rotations (0, 0, -120) and (180,180, 60) are identical for any rotation order.
Having said that, you don't have those. You have roughly (180, 180, -60) for your second one, plus there's an extra 2 degrees in the first one.
I'd be looking at AK Eric's suggestion that the objects are in different parent spaces.
Reply all
Reply to author
Forward
0 new messages