The following sections give an overview of the sample projects accompanying this chapter.
This example demonstrates playing back both a main and sub-animation. A flag is rendered waving in a virtual breeze. Every few seconds the flagpole will wobble around but the flag on the end of the pole will continue to flap around. A screen grab can be seen in the following figure:
The animation of the flag waving is achieved as a looping sub-animation, while the flagpole wobble is the main animation, which is started every five seconds as a one-shot animation.
One of the problems with this approach is that the sub-animation will only play if there is a main animation currently in progress. Rather than create a one frame animation of the flagpole standing still, a cunning trick has been employed.
The flagpole wobble animation is actually playing continuously, but at zero speed. Since the first frame of the wobble animation is of the pole in an upright position, we have achieved...