Graphics Reference
In-Depth Information
Finally, we do a simple check to see whether we have reached the end of the animation
sequence; and if looping is enabled, we reset the timer.
if (!PlayOnce && CurrentAnimation.HasValue &&
CurrentAnimation.Value.EndTime <= time)
{
this.Clock.Restart();
}
By allowing the CurrentAnimation variable to be defined, and if the animation will be
looped, it is possible for the calling code to determine which animation in the mesh will be
played and when it will start/stop.
There's moreā€¦
Animation blending is possible by interpolating between frames from different animation
sequences over a period of time. This is similar to how we have implemented the smoothing
between frames in this recipe. For example, a walking sequence blending into a jumping
animation when a character jumps.
It is possible to apply transforms manually to animate the bone by performing the transform
against a bone's bind pose. For example, applying a rotation to the bone's bind pose
matrix will apply the rotation to the bone relative to its bind position. This would take place
irrespective of where we have applied the animation frame transforms in this recipe. This is
still a tricky process, and it is much easier to bake animations using a 3D modeling software.
Another option that can be used instead of baking animations or manual transformations
is ragdoll physics, a type of procedural animation. This technique is named so due to the
fact that characters using the system would typically fall into a heap like a toy rag doll.
Ragdoll physics involves using a physics solver that takes into consideration collisions and
the constraints built into each of the joints in a collection of rigid bodies that make up the
character. This can allow a character to respond more dynamically to its environment. For
example, if a character were to be hit by a bus or trip down some stairs, it may flop and
bounce around realistically.
As already mentioned, getting models to work as expected after three conversions ( .blend ,
.fbx , and then .cmo ) can be quite tricky at times. For any large scale development, it would
be worth investigating using other formats directly, or by using a custom structure that aligns
with the projects requirements more closely.
The types of issues that can be encountered include, among others, incorrect normals,
inconsistent vertex winding between meshes, and issues with coordinate handedness
(that is, right-handed instead of left-handed). When choosing a 3D modeling package,
be sure that it has the flexibility to apply custom export logic. Blender supports the
extension of the export modules by editing the applicable Python script.
 
Search WWH ::




Custom Search