1.10 ADVANCED GRAPHICS TECHNIQUES

 

 

1.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,

- Only drawing the part of the screen that is changing

- Blurring images for fast moving objects reduced the flicker.

- Alternating two pictures (double buffering). While one picture is being drawn, the previous picture is displayed.

 

• Buffer swapping gives smooth looking graphics by:

 

i) Swapping the screen with a memory block,

ii) Erasing the previous image (within a bounding box),

iii) Redrawing the image,

iv) Repeat the loop.

 

• 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.