Slang's .plan




Mesh Skinning Using Vertex Shader (2)

flx_mdl_skinning_01.m1v (6.2 MB, for a limited time only)


Let v denote the vertex position in reference space (the parent bone's local space), and let Mi denote the bone-to-world transformation matrix, then the skinned vertex position v' is given by the expression above; where, wi is the associated weight, and Mrefi-1 is the inverse of the reference transformation matrix.

Since all the bone data defined in the Reference SMD is given by in their parents' local spaces, first of all, I transform all of the bones' local transformation matrices into the bone-to-world transformation matrices (these are Mrefi in the expression). Then I calculate the Mrefi-1 in order to transform the vertex from the model space into the parent's local space, because the bone transformation matrix Mi attached to the keyframe of the animation is also a bone-to-world, 4x4 affine transformation matrix.
| Top Page |