Game Development Reference
In-Depth Information
approximations can be very expensive to simulate. Simple lattice deformers have
been around for a while—like ChainMail (see [Gibson and Mittrich 97] again),
which, although providing speed and robustness suitable for interactive process-
ing, suffers from limited realism.
Here again, shape matching can come to our help. In [Rivers and James 07],
an algorithm is presented to efficiently calculate the shape matching of a cubic
lattice.
The idea is to voxelize the mesh and flood the inside of the mesh with solid
objects in a cubic lattice. Steinemann [Steinemann et al. 08] uses an octree-based
hierarchical sampling instead of an evenly spaced lattice. The original mesh is
then deformed using trilinear interpolation of the vertex positions in the lattice.
Although this approach results (depending on the resolution of the lattice) in inter-
active rates, we will use a much more simple approach to account for volumetric
effects that is more suited to character animation. It is presented in the next para-
graph.
14.4.3 A Link to the Bone
When there is a bone model that drives the mesh, another simplified model can be
used that mimics the real situation quite well [Shi et al. 08]. We apply yet another
spring to our surface vertex for each bone and link it to the bones they are assigned
to. But we do not fix the end at a certain position along the bone, allowing it to
slide freely along the bone. This way, the force tries to maintain the original
distance from the bone. Before constructing this force, a bone model is defined
that assigns each vertex just one bone. This will be extended to a model that
assigns more than one bone to a vertex for smooth skinning. Here, the calculated
force will be the (weighted) sum of the contributions of each bone.
A basic bone model. We start with a simple bone model to discuss the basic
structure. The bone model will be built up from the joints, where each joint has
a position, an orientation, and a parent. A joint without a parent is called a root
joint.
struct Joint { Quat4 orient; Vector3 pos; int parent; } ;
The link between a joint and its parent is called the bone . Each vertex is
assigned a joint, and its rest position x i is calculated by
x i = qx re i q 1 + j i ,