Brock University
COSC 3P98 Computer Graphics
Instructor: Brian J. Ross
Animation
basic idea:
Loop { draw frame alter picture }
animation is conceptually done in either 2D cartoons or 3D
The 4 dimensions of animation:
1, 2, 3: 3D space
4. time
Other factors: sound, artistry, emotional impact, ...
Given 3D image and time, we can describe an animated sequence with
a 4D function (likewise, a 2D animation with a 3D volume)
Animation
Consider animated movies (eg. Dinosaur, Shrek, Final Fantasy,... ):
objects are quite complex, highly photorealistic
the photorealism uses lighting, texture, materials, optics
challenge of animation: defining convincing 3D transformations (eg. aircraft in sky) and geometric changes to models
(eg. rain drops in a puddle, stepping on a ball) over time variable
animation tasks:
model effective movements and transformations
effective definition, description and implementation of such models
Modeling physical objects
define properties of physical objects and the environment world
how solids interact; how liquids and gases behave; particle physics;
gravity; friction; Newtonion physics; ...
if you can model the above, then you can use the results in your animation
eg. an animation of particles in a swirling glass of water
can exploit Brownian motion equations for modeling how they move
temporal aliasing: jerkiness or jumps in object movement per frame
solution: increase temporal resolution: show more intermediate movement
Also, change motion rates/curves.
this can also happen with textures that are too fine of resolution!
poor cinematography: you need to apply artistic & aesthetic principles
to computer animation
proper framing of scene, colour choices, lighting, not to much zooming
... everything that is a factor in conventional animation and/or movies
is also important in computer animation
lighting, rendered output is very tricky; youíll likely need
gamma correction
watch your material definitions, light intensity
watch your timing! Too much or too little in your time span can occur.
OpenGL Animation
computer animation:
draw picture --> modify a little --> draw new one --> modify
a little --> etc
illusion of movement
problems:
lots of stuff to calculate and draw means the frame rate can be slow,
and animation effect isn't convincing
disturbing to see entire picture rewritten each time "flicker"
programming solution: double buffering -- while showing one frame,
you draw into a back buffer
then when back buffer drawing done, give a command to swap buffers
(can be done very fast when hardware supported)
I/O dependent -- depends on the I/O library you use (aux, glut, X, ...)
initialize graphics (GLUT):
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE);
draw your frame (remember to clear it before drawing -- otherwise you overwrite the old picture!)
Draw the frame:
glutSwapBuffers(); /* swaps backbuffer and visible buffer */
Does a 'glFlush' implicitly.
Conclusion
Cheaper, faster hardware is good news for computer animation
CPU, storage, 3D graphics HW support
3D modelling, rendering, animation has been consumerized