Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  06 June 2013

How does this work from the API documentation? What is it supposed to be?

The transformation matrix is then constructed as follows:

   -1                      -1

where 'x' denotes matrix multiplication and '-1' denotes matrix inversion

Is it supposed to be a matrix in itself? Where are the -1's supposed to sit within the thing?

I presume the final transform matrix is achieved by multiplying the said 4x4 matrices together in the order given, and to get back from the final transform to a point on the line, [R] for example, you would factor out [T] then [Rt] then [Rp] my multiplying by their inverse?

The -1's on the description has confused me though. Am I missing something? Can anyone shed some light on this?

Thanks in anticipation
  06 June 2013
I believe Sp and Rp are the scale and rotate pivot matrices. The -1's above them indicate that you don't use those matrices themselves, but their inverse. The wikipedia article describes it pretty well:

To get the [R] matrix you have to use its explicit form, shown here:

Multiplying by the inverses you listed would only chop off the terms that are to the right of the [R] matrix in the product for the transform matrix. Remember, matrix multiplication is not commutative.
  06 June 2013
Thanks for that.

That being the case, how come the -1 is only on one of the Sp and Rp in the list and not on the others?

I'm not sure what you mean by using it's explicit form - the link you posted is the same link that I posted for the full Tranformation Matrix

I get what you mean about chopping the bits off the end of the line, and generally there would only be Translate, Scale and Rotate which are relatively easy to factor out.

Do you know also what values Maya uses to display in the Attribute Editor/Channel Box? I presume they are the Euler angles taken from the transformation matrix? Would they be from the world matrices? In the order XYZ?
  06 June 2013
The panels usually show you the "local" transform, or rather, the transform relative to the parent, which is an object's world transform multiplied by the inverse of the parent's, with the angle being derived from the world orientation based on rotation order, with the spins counted (as a singular 4x4 matrix can't account for spins, only for an orientation, when it comes to rotations).

That page might seem confusing because it's telling you what Maya considers to obtain the final transform, which is a long chain of operations on different components to make sure that all things that can affect a transform in maya (such as the pivot) are accounted for.

The inversions should be addressing the pivot's behaviour, and without trying, I'd guess it's implied as invert the result of the chain at that point, so first invert the scaling pivot, keep going, then in the chain of operations once you've factored in the rotation pivot invert again and keep moving.
Again, without trying and at a guess, without those inversions I'd imagine you would get a double offset from the pivot if it was non-ID instead of it affecting components the way you want it.

Have you tried implementing your own reconstruction of it to see it happen at the various stages? It should all become fairly clear compared to trying to figure out the hundreds of operations in your head
Most things like missing an inversion should have a visually meaningful repercussion, and show you why it's there (IE: Pivot compensation becomes mirrored or additive instead, matrix changes handedness and stuff like that)
Come, Join the Cult - Rigging from First Principles
  06 June 2013
Thanks for the help.

I've not tried experimenting yet, no. Just been trying to make sense of it theoretically. It might be better to see visually, that's a good idea.

So are we decided that the composition order should read


with the first Sp and Rp being the inverse matrices? That would effectively mean that the scale pivot would be applied after the shear and the rotate pivot would be applied after the rotation right?

As you say the panels should show the local transform, would this be to Euler angles in the order XYZ? If I run the following code on joint2 of a simple 3 joint chain:

joint1 <0, 5, 0>
joint2 <0, 0, 0>
joint3 <3, 0, 0>

rotate -r -os 0 0 -30;
rotate -r -os 0 -60 0

The panel shows rotation to be [40.893, -48.590, -49.107]

Whereas if I print the EulerXYZ on the joint I get

[163.89788624801398, -25.658906273255269, -56.309932474020236]
  06 June 2013
It would appear that it is object space (local) as the following code retrieves the values displayed in the panels

import maya.cmds as cmds

joints ='joint2')

for joint in joints:    
    jntPos = cmds.xform(joint, q=True, ro=True, os=True)

print jntPos

Although the xform docs confuse the matter of composition order and where the inverses go :S
  07 July 2013
aaah, just had to deal with this for a mind blowing animation exporter, maya to game engine. It was fun!
ok so, the transformation matrix that you retrive from maya through .transformation().asMatrix() is the information matrix that you need for placement of a particular node in the scene. It is made up from all other matrixes that represent particular fields that you can control, let's say... translation. The translation is represented by the last row. In the 4x4 matrix the translation iformation is m[3,0] = x ; m[3,1] = y; m[3,2] = z where m is a MMatrix = node.transformation().asMatrix().

By multiplying matrixs made of a variety of 1, 0, -1 elements with the transformation matix you can change, it's local rotation orietation, you can change the cartesian orientation from right hand side to left hand side... and scale factors etc. Or, you can alter that by using changing the options with fuctions provided in the MTansformationMatrix class. I ended up doing algebra rather than altering the scene.

Hope it helps.
  07 July 2013
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 07:22 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.