With an armature loaded and our vertex skinning in place, we are now ready to playback bone animations. In this recipe, we will access the animation's keyframes that are loaded from the first animation in a mesh, and playback within a loop.
For this recipe, we will continue from where we left off in the Loading bones in the mesh renderer recipe.
The completed project for this recipe, called
Ch04_02Animate, is available within the companion source code provided with this book's code bundle. It is available on Packt website.
How to do it…
We will start by adding a few new properties to our mesh renderer.
MeshRenderer.csand add the following code:
// Create and allow access to a timer System.Diagnostics.Stopwatch clock ...