Another question about bones

Started by
8 comments, last by RobM 12 years, 1 month ago
I created a very simple rectangular box in 3ds Max. 5 units long, 1 unit wide. I then created a bone structure inside the box, consisting of 5 simple bones and skinned the box to the bones. All good so far.

I then exported as a collada file and I'm a bit confused about the per-bone local matrices. I would have thought the first (root) bone would be an identity matrix, and each next bone would be a simple no rotation/+1 unit translation matrix.

What I've actually got is the root bone with a +90 rotation about the z axis and no translation and 4 other bone matrices with no rotation and a +1 translation in the x direction.

I'm having a problem understanding why the root bone local pose matrix is not an identity matrix. Obviously the root joint only has a direction and I can understand that because I started it at 0,0,0, but why does it have a rotation? What's the reference point?

Now if I adjust my root bone in 3ds Max to remove the +90 rotation about the z axis and re-export, I get an identity matrix and 4 +1 translation matrices, as expected. Does 3ds Max add bones with a rotation about some axis?

Perhaps I just don't fully understand matrix rotation but if I have a direction, say 0, 1, 0 pointing straight up, how do you store a matrix rotation for that, surely it's impossible unless you have a starting reference? This is what I can't understand.

Now once I had removed the +90 rotation about the z axis, I had a nice identity root bone, etc, I was shocked to see that the inverse bind matrix for my root bone was -90 rotation about the z axis! Surely the inverse of an identity matrix is an identity matrix?

Hope someone can help
Advertisement
Sure its not just the exporter adding the rotation, most have an option to rotate data ?

Cheers

Lee

Code is Life
C/C++, ObjC Programmer, 3D Artist, Media Production

Website : www.leestripp.com
Skype : lee.stripp@bigpond.com
Gmail : leestripp@gmail.com

There's no option for rotation in the collada exporter, only the y up setting...
I think my question is more related to the inverse bind matrix and the local bone poses.

Am I right in thinking that the inverse bind matrix for each bone will take you from bone space back to world/bind space?
The bind pose is the world space pose in which you linked the bones to the vertices.
The inverse bind pose matrices are stored, so you can use these during skinning, to calculate how much the bone has rotated/translated compared to the bind pose.

So if you made your cube mesh, the put bones in it, and linked the bones to the vertices, and the root bone still had that 90 degrees rotation in it, the inverse bind pose will have such rotation in it as well. If you removed the rotation from the bone after you did the bone-to-vertex linking , then your world space matrix of the root bone will not have that rotation, but the inverse bind pose will still have.

If you remove the given unwanted rotation from your root bone, and then link the vertices to the bone, the inverse bind pose transform should also be an identity matrix (assuming there is no scaling/rotation/translation).

Hope that makes sense smile.png
It makes perfect sense... Thanks very much for taking the time to explain it so well
So I understand the post from buckshag perfectly, but I'm still having problems understanding the rootbone's local bind pose matrix... I just created a new 3ds Max document, created two bones pointing straight up in the y direction and nothing else, exported as collada file and the local bind pose for the root bone is a negative rotation around the z axis. If I rotate the root bone +90 in the z direction and then re-export, the root bone bind matrix is practically identity.

So it looks like 3ds Max thinks all bones should start pointing along the positive x axis and any root bone rotation is a delta from that direction. Is this correct?
As I said above all 3D apps manage there 3D space in different ways. that's why exporters have extra options to rotate, set up-axis, select left/right handed etc... sadly your exporter seems to lack some features. You may have to manually correct this. Or write your own format and exporter in MEL.

Good luck.

Cheers

Lee

Code is Life
C/C++, ObjC Programmer, 3D Artist, Media Production

Website : www.leestripp.com
Skype : lee.stripp@bigpond.com
Gmail : leestripp@gmail.com

This is nothing really weird, this is just how Max stores bone hierarchies.
There might be a way to change that in Max but I'm also no Max expert. What you might be able to use is the Reset XForm utility.
I'm not 100% sure if this is useful, but you might want to give it a try.

However, why is this exactly a problem for you?
In case it is no problem and all you want is to understand why this rotation is there, it is just because Max just happens to do it that way. Other programs like Maya might use another axis than the x axis again for example.
I'm just using the normal Export as DAE from 3ds Max 2012. I then have a tool which converts collada files into my own binary format.

I don't have an issue really, I was just tying to get my head around why they chose along the positive x axis to be the reference point for the initial rotation, or whether that wasn't the case and I'd set my bones up incorrectly.

Then I started considering how you'd specify a rotation for a root bone without any reference point and you can't, not even with a quarternion (you can specify the position absolutely from 0,0,0, but not the rotation around that vector).

That messed with my head for a bit but I guess I just have to accept that they have to use something as a reference and they chose the +ve x axis. And why not....

This topic is closed to new replies.

Advertisement