Skinned meshes

Started by
2 comments, last by Lantz 21 years, 9 months ago
I need some help with skinned meshes. Could anyone explain the basics? I know I need a couple of (animated) matrices and vertex weights, but how should it be put together? Should there be some kind of hiearchy? And there should be some kind of matrix interpolation right? Any information you could provide would be great. Regards, Lantz
Advertisement
Bump. Anyone? All help I could get would be greatly appreciated.
the idea is a fairly simple extension of hierarchical animation. With straight hierarchical animation, each mesh that is assigned to a bone is affected only by the movement of that bone. You could extend the idea to say that all vertices in that mesh are affected by the transformation of that specific joint. Now for hierarchical animation, the mesh that is attached to any given bone is usually defined in the local space of that bone, ie, the bones axis forms the `origin` of the mesh so all vertices etc are defined from there.

Skinning (at the most simple level) basically says that each vertex is transformed by one joint; this is rigid skinning btw. When multiple bones are used a mesh can be affected by different bones in different locations to give the skinning effect. The only real problem with this is that you have to know the co-ordinates of the vertex defined in local space with respect to the joint it''s attached to. (you might want to ensure that the bind pose of your models always has the root node centered at the origin with all of the joints axis aligned. The only reason is that the local space of vertex1 can be defined as (vertex1 - jointPosition); having models set up any differently will require some inverse transforms to determine the local space co-ords.)

Once you have the vertex in local space, animate the hierarchy as you would normally and perform the following operation for each vertex:

currentVertexPos = WorldSpaceJointTransformMatrix * LocalSpaceVertexCoord


There are certain situations where you want more than one bone affecting a particular vertex; say for example you wanted a vertex at the knee to have an equal influence from the shin bone and the thigh bone, you could figure out the vertex when influenced by both bones, and then average them. This is where the concepts of skin weights come from, essentually the case above would look like :

currentVertexPos = 0.5*WorldSpaceJointTransformMatrix1 * LocalSpaceVertexCoord1 + 0.5*WorldSpaceJointTransformMatrix2 * LocalSpaceVertexCoord2;

here we are using 0.5 as the vertex weights of both bones to ensure that we will have an equal influence between both. Now, we could basically add as many bones as we want and average them in a similar way to add influences to the vertices movement. The only restriction is that the weights for any given vertex must add up to 1.
So, if I understood correctly, what I need is first a matrix for every joint to translate the vertices into the joints coordinate space, and then the regular matrices for the animation/transformation stuff. Have I got it right?
And a follow up question, does the joint matrices need to be transformed by parent bones or something?

This topic is closed to new replies.

Advertisement