CH5 - Computer Animation
CH5 - Computer Animation
1
Computer Animation
1. Raster Methods for Computer Animation
2. Design of Animation Sequences
3. Traditional Animation Techniques
4. Computer-Animation Languages
5. OpenGL Animation Procedures
2
Computer Animation
• Computer-graphics methods are now commonly used to produce
animations for a variety of applications, including entertainment
(motion pictures and cartoons), advertising, scientific and
engineering studies, and training and education.
3
Computer Animation
• Two basic methods for constructing a motion sequence are real-time
animation and frame-by-frame animation.
5
Raster Methods for Computer Animation
• Most of the time, we can create simple animation sequences in our programs
using real-time methods.
• The animation can then be viewed by cycling through the completed frame
sequence, or the frames could be transferred to film.
6
Raster Methods for Computer Animation
• If we want to generate an animation in real time, however, we need
to produce the motion frames quickly enough so that a continuous
motion sequence is displayed.
• For a complex scene, one frame of the animation could take most of
the refresh cycle time to construct.
7
Raster Methods for Computer Animation
• For very complex animations, the frame construction time could be
greater than the time to refresh the screen, which can lead to erratic
motion and fractured frame displays.
8
Double Buffering
• One method for producing a real-time animation with a raster
system is to employ two refresh buffers.
• When that frame is complete, we switch the roles of the two buffers
so that the refresh routines use the second buffer during the
process of creating the next frame in the first buffer.
9
Double Buffering
• This alternating buffer process continues throughout the animation.
• Graphics libraries that permit such operations typically have one function
for activating the double buffering routines and another function for
interchanging the roles of the two buffers.
• For example, if the screen refresh rate is 60 frames per second and it
takes of a second to construct an animation frame, each frame is
displayed on the screen twice and the animation rate is only 30
frames each second.
12
Double Buffering
• Because of slight variations in the implementation time for the
routines that generate the primitives and their attributes, some frames
could take a little more time to construct and some a little less time.
• Thus, the animation frame rate can change abruptly and erratically.
• One way to compensate for this effect is to add a small time delay to
the program.
14
Operations
• Sequences of raster operations can be executed to produce realtime
animation for either two-dimensional or three-dimensional objects.
• We can also animate objects along two-dimensional motion paths
using colortable transformations.
• Here we predefine the object at successive positions along the
motion path and set the successive blocks of pixel values to color-
table entries.
• The pixels at the first position of the object are set to a foreground
color, and the pixels at the other object positions are set to the
background color.
15
Operations
• The animation is then accomplished by changing the color-table
values so that the object color at successive positions along the
animation path becomes the foreground color as the preceding
position is set to the background color (Figure 1).
16
Design of Animation Sequences
• Constructing an animation sequence can be a complicated task,
particularly when it involves a story line and multiple objects, each
of which can move in a different way.
17
Design of Animation Sequences
• The storyboard is an outline of the action. It defines the motion
sequence as a set of basic events that are to take place.
19
Design of Animation Sequences
• A key frame is a detailed drawing of the scene at a certain time in the
animation sequence.
• Within each key frame, each object (or character) is positioned according to the
time for that frame.
• Some key frames are chosen at extreme positions in the action; others are
spaced so that the time interval between key frames is not too great.
• More key frames are specified for intricate motions than for simple, slowly
varying motions.
• Development of the key frames is generally the responsibility of the senior
animators, and often a separate animator is assigned to each character in the
animation.
20
Design of Animation Sequences
• In-betweens are the intermediate frames between the key frames.
• The total number of frames, and hence the total number of in-betweens,
needed for an animation is determined by the display media that is to be used.
• Film requires 24 frames per second, and graphics terminals are refreshed at the
rate of 60 or more frames per second.
• Typically, time intervals for the motion are set up so that there are from three
to five in-betweens for each pair of key frames.
• Depending on the speed specified for the motion, some key frames could be
duplicated.
• As an example, a 1-minute film sequence with no duplication requires a total of
1,440 frames. If five in-betweens are required for each pair of key frames, then
288 key frames would need to be developed.
21
Design of Animation Sequences
• There are several other tasks that may be required, depending on
the application.
22
Traditional Animation Techniques
23
Computer-Animation Languages
• We can develop routines to design and control animation sequences
within a general-purpose programming language, such as C, C++,
Lisp, or Fortran, but several specialized animation languages have
been developed.
25