Hi all,
I am currently playing around with loading a skeleton plus mesh manually from a collada file. I am having a problem understanding the setBindingPose() function.
Isn't the bindingPose supposed to be just a matrix for each bone which defines which positions the bones were in when they were bound to the mesh?
And then, shouldn't the meshes vertex positions be multiplied by the inverse of these matrices when the mesh is transformed by a bone?
What I am doing now is that I transform the bones according to the bind poses I load from the collada file, then set the bind pose and then do any additional transformations. But this doesn't seem right, the meshes and bones are always rotated to much, by the exact amount of one bind pose rotation.
Does anyone know what i might be doing wrong?
Thanks,
-Michael
how does setBindingPose() work?
-
- Gnoblar
- Posts: 21
- Joined: Thu Dec 21, 2006 3:18 pm
- Location: Germany
how does setBindingPose() work?
Last edited by michaweyel on Wed Oct 17, 2007 2:29 pm, edited 1 time in total.
-
- Gremlin
- Posts: 196
- Joined: Tue Aug 08, 2006 6:45 pm
- x 14
I think when you set a bind pose its like setting an initalState of the node, then any change of orientation is relative to this... I'm fairly sure this is correct.
Multipling by the UnitInverse of whatever inital orientation would take you back to the world x,y,z axies. The animation keyframe orientations are probably relative to the bind pose.
hope this helps.
Multipling by the UnitInverse of whatever inital orientation would take you back to the world x,y,z axies. The animation keyframe orientations are probably relative to the bind pose.
hope this helps.
-
- Gnoblar
- Posts: 21
- Joined: Thu Dec 21, 2006 3:18 pm
- Location: Germany
Hmm, I'm not sure. I always thought that the bind pose was not only the initial pose of the bones but also used transform the vertices from world to bone space in that initial position, basically like this:
B = bind pose matrix in world/model space
W = world/model space matrix of the joint
V = vertex position in bind pose
The skinning algorithm should work like this:
V' = (0, 0, 0);
for (int i=0; i<numInfluences; ++i)
V' += (V * (Inverse(B) * W)) * influences.weight;
Is this the way Ogre does it? Bc it seems that my mesh isn't affected at all by whatever bind pose I set.
-michael
B = bind pose matrix in world/model space
W = world/model space matrix of the joint
V = vertex position in bind pose
The skinning algorithm should work like this:
V' = (0, 0, 0);
for (int i=0; i<numInfluences; ++i)
V' += (V * (Inverse(B) * W)) * influences.weight;
Is this the way Ogre does it? Bc it seems that my mesh isn't affected at all by whatever bind pose I set.
-michael
-
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66