Practical sessions
Try out the following ideas to enhance the code for the animation playback:
- Add a class to append multiple animation clips to a longer animation track. You could join the running and jumping clips to create the illusion of a long-running glTF model by playing jump animation clips between a couple of running animation clips.
- Add the ability to control the looping of an animation, such as not only switching the loop on and off, but also controlling the number of loops to play in a row. The animation should stop after the last loop has finished.
- Add a UI control and the logic to play the clips backward. For many clips, this will result in quite interesting behavior of the model, but animations such as sitting and leaning will become more meaningful. The model will stand up from a sitting position and lean back to the upright position.