PDA

View Full Version : Skeleton/Bones local axes help!


virtualmic
06-08-2005, 11:00 AM
Using: Maya 6.5
Ref: Maya 4.5 Savvy, Paths and Bones chapter and Maya manual

Hi,
I am really unable to understand how does Maya orient the local axes, when creating bones. One thing about X axis I got right. However, for the other two axes, Maya manual says "the second axis points at right angles to the first and third axes, and the third axis points sideways from the joint and its bone."

Now what does "sideways" in the above statement mean?

Because, though I am following the Bones tut given in the chapter mentioned above, word by word, I am not getting the correct axes orientation, as is expected by the author.

Thanks!

Saurabh.

virtualmic
06-08-2005, 11:13 AM
Hmm.. so I turn to next page of the book, and guess what I find an explanation of why the local axes should re-orient themselves. It says that if you translate the bones, the local axes may re-orient and then you have to manually orient them correctly. Now, that's a bummer. Either that, or I don't really understand the logic behind it. And yes, I still don't understand the statement in the manual.

Someone please care to explain?

Regards all,
Saurabh

michaelcomet
06-08-2005, 09:24 PM
Easy answer
Go to my website and download the Comet Scripts zip with the cometJointOrient and use that tool to help you easily orient the joints the right way, or download Jason Shiefers version etc...

The real easy way to understand this is: (and may not be 100% technically right)
Each joint has it's own orientation. Just like any other object.
Even though you translate a child joint, the parent joint is still oriented the original way.
Think about two cubes parented to each other. You setup cubeA and cubeB so that cube A points to cubeB which is the child. Great. That's how joints get made. But then you decide to move cube B. Well ok so you've moved the child cube, the actual orientation of the first cube isn't changed, it's still aiming or orientated the way it used to be.
Joints work the same way, except that you get the drawing of the connections of the joints LOOKING like they are connected/aiming the right way, even though they aren't.
The fact is when looking at a Maya joint, all you really want to do is look at the root sphere part of it. The longer connection part isn't neccesarily correct for where the axis is, it's just showing you what the next child connection is. It has nothing to do with orientation. So if you translate a child, that drawing looks like it's connected right, but the real orientation may not be down that length at all.
To further complicate things, joints have a local orientation matrix and some other Joint Orient settings that all affect the final orienation...you don't really have to worry about that tho. At least not if you use a script like I mention above.

Buexe
06-08-2005, 10:13 PM
To see what they mean try the following:

go to the side view
get the joint tool
from the origin draw a couple of joints upwards (+Y) to something like an "S"
(try to pretend you are drawing the spine joints for a character for example)
complete the tool
select the root joint with the move tool ( in object mode ) so that it shows you the local orientation
move down your hierarchy using the up/down arrow keys
what you ideally should see is that some joints face into another direction as others

The reason for this is the automatic orientation procedure in the joint Tool. It works in many cases but well, not in all. So there can be cases (many actually) where you want to re-orient your joints. Try thinking of putting a rotation offset into the node, check the Attribute Editor and fiddle with the joint orient values (they are not keyable by default, so you don`t see them in the channel box), you`ll see what I mean. So, that`s why nice ppl created above mentioned handy scripts that help you orient your joints.

To explain the math behind that is probably a little bit too overdone, maybe just create three bones in the persp view, select the middle bone and in the Attribute Editor check "Display Local Axis" and the fiddle around with the joint orient values.

I hope this helps a little bit
buexe

BlueFish
06-09-2005, 05:02 AM
Every object has a pivot point. You access this using the insert key. In a similar fashion, joints also have a pivot point (although not affected by the insert key) (Display -> Component Display -> Local Rotation Axis). This is the axis on which the joint will rotate, scale and translate. With joints, usually the most important thing is the rotation axis. If you keep these axies consistent across a joint hierachy, you can then instruct all the joints to rotate by X and they would all rotate and produce a "curl" (if you chose the right axis to rotate). This is FK behaviour.

When you create a joint, you can specify to orient the joint in alignment with the world XYZ or with some preconceived notions that the Z axis has to point down the bone. However, when you go move the joint around, the pivot point does not reorient. Hence the local axies become slightly misaligned. Comet Script's would issue a recursive mel command to orient all the joints axies again without altering the position of the joints.

Note, joint axis is only necessary for joints you intend to control using FK. For IK, the joint orientations are driven by the IK solution, hence axies are not as important required. If you create a FK/IK rig, then I believe joint axies consistency wouldn't hurt ;-)

virtualmic
06-09-2005, 04:03 PM
Wow.. those are some nice explanations there. Thanks guys.

I have understood quite a bit now... but still am not very clear. Guess that will come with some experience.

Michael: Thanks again. I am sure that I have visited your site before for that nice cartoon eye setup thing, but right now am unable to open both of your sites. Can you please check?

Buexe: If you have a link for the math behind this stuff, can you please pass it on? I am slightly more comfortable with math explanations. :) But please, don't care to type the explanation for me, as you have already helped me. I will try to figure it out on my own then.

Bluefish: Thanks buddy for the clear explanation.

Buexe
06-09-2005, 06:46 PM
well you asked for it:

http://www.zjprogramming.com/html/aimconstraintnode.html

The thing is that you need some quaternion and matrix operations especially to get some offsets between different local spaces. Doing this with MEL is not a good idea. But there is already an aimConstraint node built into Maya, which you can use to get the right rotation values.
cheers
buexe

CGTalk Moderation
06-09-2005, 06:46 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.