12.10 ADVANCED GRAPHICS TECHNIQUES
ؕؓ12.10.1 Animation
To simulate motion we collect a set of still frames of a rendered object being translated and rotated. These are played back to simulate the motion.
The paths of motion may be defined using splines, equations, functions, etc.
Some tricks used for doing animation are,
- Alternating two pictures (double buffering). While one picture is being drawn, the previous picture is displayed.
Buffer swapping gives smooth looking graphics by:
When using interactive animations a program structure is required that separated user inputs from rendering.
The first program loop examines inputs and user requests from the mouse, keyboard, etc. Based on these values we reset internal flags and registers.
Based on the values of the internal registers the drawing is updated.
During execution, the program loops through both of these operations, and thus provides a separation between simultaneous control, and display motion.
With this architecture it is easy to add `real time' control functions.