Game Development Reference
In-Depth Information
{
name "FlagD"
parent "FlagC"
pos {60.33911,0,-0.00000}
rot {0.99996,0,0,-0.00877}
}
CIwAnimBone
{
name "FlagE"
parent "FlagD"
pos {60.36695,-0.00000,-0.00000}
rot {0.99985,0,0,0.01754}
}
}
The SKIN file
The
SKIN file
is the bridge between the skeleton and the vertices of the 3D model in
its bind pose. It contains all the data representing which vertices are influenced by
which bones.
The file starts by defining an instance of the
CIwAnimSkin
class. This instance contains
references to the
CIwAnimSkel
instance that defines the bones of the required skeleton,
and also the
CIwModel
instance that will be used for rendering the model once the new
vertex positions have been calculated. As with the SKEL file, the name given to the
CIwAnimSkin
instance is derived from the filename of the SKIN file.
The file then contains a number of instances of the
CIwAnimSkinSet
class, which
indicates which vertices are modified by which bones. This is achieved by first listing
the bones, up to a maximum of four, then the number of vertices in the set. The bone
weights are then specified for each vertex by providing the index of the vertex in
the model vertex stream, followed by a weight value for each bone. The sum of the
weight values for each vertex must total to one.
The SKIN file is also exported to the
models
subdirectory and the following code
provides a partial example of one. These files tend to be quite large due to the sheer
amount of data required for even a simple animation, so an extract should provide
enough of a flavor of what these files look like.
CIwAnimSkin
{
skeleton "FlagPoleBase"
model "Flag"
CIwAnimSkinSet
Search WWH ::
Custom Search