View Full Version : <--local orient joint and rotaion axes-->

09 September 2005, 10:52 AM

there is one problem in the way maya handles local rotation axis

after creating bones i find that changing the local rotation axesof joint manually and by ORIENT joint tool is diffrent...even if we rotate it manually in 90 degrees

thing is that another attibute that is rotate axes(in attribute editor) also attains certain value

that is not understood by me .....

you try urself
first go to component mode and click question mark icon in toolbar and change the local rotation axes of joint say 90 degree and you will see it also affects rotation axes attribute in attrib editor obviously it is also changing "orient joint" attib

whereas by using orient joint tool only orient joint attib(in attrib editor) are changing

some pro's please through light on these things


09 September 2005, 08:59 PM
Joint transforms in Maya are kind of an odd tricky business. Honestly I'm not quite sure why they had to make the joint orientation transformation matrix different than that of regular transforms. Well actually it inherits transform, but keeps certain things 0, like rotatePivot, shear, etc... Anyhow are you sure the orient joint tools aren't affecting the local axis? Many tools will do a local axis tweak and then also do a freeze transforms to effectively zero out the final value in the channel box.

Anyhow for a better idea of transforms and joints take a look at the Maya "Node" docs for "joint" and "transform". ie: Open the Maya Help, Open Developer Resources on teh bottom, and then choose "Nodes and Attributes" to get the dgnode reference docs. Then look at joint and transform.

Both of these show how the transformation matrix is built and what they are.

-1 -1
matrix = SP * S * SH * SP * ST * RP * RA * R * RP * RT * T
but joints are:
matrix = [S] * [RO] * [R] * [JO] * [IS] * [T]
(where '*' denotes matrix multiplication).

[S]: scale.
[RO]: Rotate Orient (attribute name is rotateAxis).
[R]: rotate.
[JO]: jointOrient.
[IS]: parentScaleInverse.
[T]: translate.

So it may be that since the rotateAxis is really early in the matrix, many tools can just play with rotate and joint orient in order to achieve the desired final orientation of the joint.

So you may want to read some of those notes.

09 September 2005, 10:35 AM
i am honored to have a reply from michael... i can't believe that
you know i was not expecting any reply and i was happy that some one understand my question
but i was off my seat when i see you replied me....
to the point

i have edited my question please read that again

now there are few things i noticed working in maya7 regarding above question

first changing the joint orientation in attibute editor does'nt changes either transformation or rotaion values but still joint changes its position (why so)

also orientation joint tool just changes the local rotaion axes of joint
one more thing
freeze transformation just makes rotation value if any two ZERO
but it changes ORIENT JOINT ATTRIBUTE in attrib editor

so please tell me what should be exact workflow to setup joints

i understand the thing you say michael

but let us find out easy way to setup joints


in bit hurry and will post my other observations too....

but i have found some of info from HRR dvd from alias


09 September 2005, 12:04 PM
I think the post I made should shed light on what you are asking. For example your freeze transforms, yes the point of freeze transforms is that it zero's the rotation. But the joint is not supposed to change orientation, so it has to store the values that used to be on joint somewhere, in this case the JO etc...

Anyhow the simple answer is don't worry too much about it, make your joints, and use any of the free orient joint tools to orient the joint. Don't actually manually manipulate anything other than rotation. I have a free orient joint tool on my website in my file.


09 September 2005, 12:10 PM
hi michael

i found your advice on freeze transform extremely usefull
and studied three attribs in attrib editor and found these things
i think they are worth for sharing....

1. there are three attributes in attribute editor for rotating a joint
a) Rotate
b) Rotate Axis
c) Joint Orient

there is one very intresting thing to note that a) and c) are one and same
thing if we just freeze transform the joint any rotaion value it has is transferred
in degrees from a)to c) that is from rotation to Joint Orient....

whereas b) rotate axis gives the same effect as rotation but it changes the Local Rotation Axis from default to something else...

2. Another fact is that when we manually rotate the Local Rotation axes to some value it changes both B) and C) which is understood (so that to have the final position of local rotation axis.........

But when we change the local orientaion of joint using Orient Joint Tool(under skeleton menu) it just changes the order in which c)joint orient is linked with b)Rotate axis and a)rotate ...that order is defined in ORIENT JOINT TOOL(under skeleton menu)

so in my opinion never ever change rotation axis in attibute editor for joints..... cause it changes LRA.

hope i am correct

meanwhile can you tell me your approach towards setting up bones
and advice to new users for setting up bones



09 September 2005, 12:13 PM
Best approach,

1. Draw joints.
2. Use a free orient joint tool from highend, or my cometJointOrient.mel from my file on my site to orient it properly.
3. Rig normally.

09 September 2005, 06:34 PM
oh thanks

i find both the scripts and will use them i found advice given by my instructur and u extremly useful


09 September 2005, 11:42 AM

As michael says the TM is calculated like this:

matrix = [S] * [RO] * [R] * [JO] * [IS] * [T]

...for us it is only the [RO] * [R] * [JO] part that is interesting.

If you look back at what the RO and R tries to accomplish for a regular transform:

RO - enables you to rotate your object around an arbitary axis by first applying a "pre-rotation" before your desired rotation. I.e. it rotates the axis to the desired positions.
R - then enables you to rotate your object around these axes

However the problem with this is that you will end up with a non-zero rotations in the R-matrix. It is desired for joints that they have 0 rotations when the joint is in its base position. Therefore the JO attribute has been introduced for joints so that rotations can be "frozen", basically adding one more rotation possibility and thus enabling you to reset the R-matrix.

The strange values you see in the JO fields are probably derived from quaternion maths as rotations are deceptively simple to handle with these. However when doing a Euler-Quaternion-Euler conversion, the result might not be the same as what you started with as there are many ways to achielve the same results with euler rotations. The quaternion does not know (or care) which ones were used to create it and thus when converting it back to euler rotations, another set of values might be produced.

Just my $0.02

/ Daniel

08 August 2006, 06:06 AM
thanks guys .. its been a year i posted this question and i was struggling to understand joint matrix...
i need that for one script i am working on.. and thanks comet.. you always and will be inspiration for me

09 September 2006, 12:32 AM
Best approach,

1. Draw joints.
2. Use a free orient joint tool from highend, or my cometJointOrient.mel from my file on my site to orient it properly.
3. Rig normally.

Gee, I.....uh....Hi Michael. =)
I've been struggeling with this alot recently. Been watching videos and reading alot about skeleton setup. Some people say never to rotate your joints into place, only translate, and some people say the opposite - only rotate joints into place.

But let's say you just lay out your joints and then adjusting them by moving them one by one (transform) and then use a joint orient script to get them pointed in the right direction. then you'll probably have translation values in x,y,z. And I'm just wondering how big of a deal this really is. Your joint rotations read 0 so shouldn't it be just fine?

Just now I watched a video with Jason Schelifer where he explained his approach. He stressed that you should have your joint read values only in x except for the root joint of course. Seems the only reason for it is because he needs it when stretching joints with animation that comes from motion capture. Doesn't work with x-scale so he uses transform on x plus all of the characters on Lord of the rings where to have similar skeletons - if I understood it correctly.

Thanks guys. please just reply now =) really need some answers!

09 September 2006, 03:59 AM
If you use a joint orient script it doesn't matter how you get there, then translate/rotate is ok...otherwise it is better to rotate and not translate since when you translate it "looks" like you've rotated the local joint axis but in fact you haven't. Regardless if you use a joint orient script...which you SHOULD always do, then how you position the joints doesn't really matter because when you are done, it will be cleaned up.

As for values, yes you will have translate values but it should be only on one axis, since the joint should be aiming at the child...then the child offset from the parent will only be in the one axis... whichever one is the aim axis. I typically use Y so all my child joints will have some Y translate value which is how far away they are from the parent.

09 September 2006, 11:43 AM
Thank you so much for taking your time answering me. I really, really appreciate that. I've had much help from your scripts and this is so cool you're answering me!
However, some more questions arised and I'll try to explain as thoroughly as I can. I'm sorry for my bad english...guess it's a lot of grammar going wrong here.

Anyway. If you look at the first picture I've oriented the joints so x points to the next joint in the chain.
Looks good? If not, how should I orient them instead? (

Ok, just want to make sure I'm doing this the right way. If you look at my clavicle joint you can see it has transform values in all the three axis. I guess it must be like this becaus the joint splits into two branches. One going up to the head and the other going to the arm. (

The same thing happens at the hand joints. (picture below) (

Now, one more thing I'm having problem to understand is rotation order. You can set the rotate order for a joint going into the attribute editor. Now, what does this means and In what way are the joints affected.

09 September 2006, 02:19 PM
Yeah that looks mostly right. The only thing looking odd is some of the joints in the arm the Z or Y axis is rotate 90 or 180 degrees...from the others. Usually you will want to be consistent for each limb... like all arm joints have X forward and then Z or Y backwards etc... It looks like it gets rotated part way thru the chain.

As for the 3 values that is correct, I kinda forgot about that, oops. But it makes sense because the start of that chain is parented under a node that has a different orientation. That is the clavicle has X to the right but is parented to the spine where X is up and is moved from it, so it will have values. I often parent that clav joint under an extra group with the same orientation to zero it out though myself.

Rotation order is the order the rotations will occur at based on the values. ie: 20x 30y 40z will give you a different end result if you rotate X first then Y then Z versus say Y first then X then Z etc...

Typically the middle axis will end up getting gimbal if the 1st/last go 90 degrees. This is one reason I use Y axis down the chain. X Y Z means that typically Y will have gimbal problems. I use Y down the chain, which means for my joints Y is a spin action. Usually when animating you don't spin so much as rotate the other main axis, in my case X and Z. So I can keep the default XYZ order and I don't have to worry about changing it. It also makes it nicer for the animators since I make X the main/primary axis and it's the first in the channel box of course.

X down the chain with XYZ means Y will gimbal and Y is one of your major cross axis. Therefore if you use X down the chain you really ought to change the rotation order to a YXZ or ZXY ordering. I'd pick based on which is your major axis for rotation. For example if you are orienting your joints so the knee/elbow uses Y I'd use YXZ if Z then I'd use ZXY the main thing is X is in the middle since it's the spin joints. This is important to do not only on the joints but also to set the rotation order on the controls. Actually it's probably more important on the controls since that's what will actually be animated.

Anyhow that's one of the main reasons I use Y down the chain, I don't have to worry about changing rotation order.

09 September 2006, 03:16 PM
This is so cool of you. I appreciate it a whole lot.

I think in that screenshot that I was too far away so the axis went into each other (If I haven't misunderstood you). This is perhaps a better view of how it actually looks. changed it so now Y goes down the axis. It continues in this orientation all the way to the wrist joint. (

You're awesome!

09 September 2006, 04:31 PM
thats so cool of u mr. comet.. you explained very well..
i was not aware of benifits of having Y as down axis..( i am so lame :eek: )

CGTalk Moderation
09 September 2006, 04:31 PM
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.