VScape VML skeletal animation, also known as vertex skinning or matrix palette skinning, refers to the process of animating a polygonal structure by mixing animations applied to an internal virtual skeleton. Each vertex in the attached structure is tied to one or more of the skeleton bones. Let start by defining terms:
In VML, for an object to be animated, it must first be “rigged”. This is the process of defining an animation skeleton, and mapping the vertices in the object to the skeleton. VML defines a “Skeleton” element to facilitate this, as described below. The skeleton also serves to define the “bind pose”, which is commonly used in animation setup. Once the object is rigged, VML defines a “SkeletalAnimation” element to record individual animations.
In typical implementations (such as the VScape client) animations may be played across subsets of the object, such as playing the lower body part of a walk animation while blending in the upper body part of a gesture animation.
We will begin by defining the building blocks of skeletons and their animations.
A translation key defines the position of a bone at a particular point in time. An example of this in XML format is:
<TranslationKey x="0" y="0" z="0.010938" t="0.166667" />
Note that TranslationKey elements require the “x”, “y”, and “z” attributes, which define the position of the bone in 3d space. The “t” attribute defines the time of this sample in seconds. If there is no “t” term, the time is assumed to be zero relative to its parent element.
A rotation key defines the rotation of a bone at a particular point in time. An example of this in XML format is:
<RotationKey x="0" y="-0.707107" z="0" w="0.707107" t="0.166667" />
Note that RotationKey elements require the “x”, “y”, “z”, and “w” attributes, which define rotation of the bone in 3d space as a Unit Quaternion with terms in radians. The “t” attribute defines the time of this sample in seconds. If there is no “t” term, the time is assumed to be zero relative to its parent element.
A VScape VML Skeletal Animation skeleton is a directed acyclic graph of bones. It is defined as a flat list of bone elements which contain the bone index of their parent, the name of the bone, and a definition of the bind pose for that bone. The bind pose is defined by defining a TranslationKey and RotationKey for each bone.
An example of this in XML format is:
<Skeleton> <Bone id="0" parent="-1" name="root" > <TranslationKey x="-0.000018" y="0" z="0.347512" /> <RotationKey x="0" y="0" z="0" w="1" /> </Bone> <Bone id="1" parent="0" name="right-shoulder" > <TranslationKey x="-0.124731" y="0" z="0.17349" /> <RotationKey x="0" y="0" z="0" w="1" /> </Bone> ... </Skeleton>
Note that if id is specified, it must be a unique positive 16-bit integer. Skeletons MUST define a complete set of bone ids - i.e. if there are 17 bones, the skeleton should define bone ids 0 through 16. This constraint greatly simplifies implementation.
If names are specified, they SHOULD be unique.
Note that skeletons are defined as directed acyclic graphs, so any skeleton defining a loop in its bone parent chain MUST be considered an error.
A skeletal animation is a list of keyframes applied to a skeleton. To manage them, VML defines a skeletal animation as a list of tracks, each of which is a list of chronologically sorted timestamped keys applied to a single bone. An skeletal animation does not have to define tracks for all bones - for example a simple wave animation may only need to animate a few bones associated with one arm.
Animations are typically authored as a list of sequences which may be transitioned between. To facilitate this in VML, skeletal animations have a few simple properties which make animation tool chain development simple.
An example of a skeletal animation in XML format:
<SkeletalAnimation duration="0.208333" name="stand" > <SkeletalAnimationTrack bone="0"> <RotationKey x="0" y="0" z="0" w="1" /> <TranslationKey x="0" y="0" z="0.010938" /> <TranslationKey x="0" y="0" z="0.010938" t="0.166667" /> <RotationKey x="0" y="0" z="0" w="1" t="0.166667" /> </SkeletalAnimationTrack> <SkeletalAnimationTrack bone="1"> <RotationKey x="0" y="-0.707107" z="0" w="0.707107" /> <TranslationKey x="0" y="0" z="0" /> <TranslationKey x="0" y="0" z="0" t="0.166667" /> <RotationKey x="0" y="-0.707107" z="0" w="0.707107" t="0.166667" /> </SkeletalAnimationTrack> ... </SkeletalAnimation>
A skeletal animation SHOULD contain the duration attribute, which MUST be equal to or later than the last key time in the animation. If no duration attribute is specified, the animation is assumed to end at the exact time of the last key in the animation.
If a VML file contains more than one skeletal animation, then each SHOULD include a name attribute.
The VScape VML tool chain includes tools for managing sequences of animations, including splitting an exported key list into separate sequences. See the tools page for more details.