Animation
Tom Kelliher, CS 320
Feb. 16, 1998
Announcements:
From last time:
- Viewports, rendering adjacent objects properly.
Outline:
- Double buffering.
- Modelview transformations.
- Pong design.
Assignment: Read 6.1--6.4 (pay particular attention to orthographic
projection), 12.6 (animation), and work on pong.
Two example programs: double.c and pong.c .
- Why did the time look so bad in paint.c?
- Consider video refresh and OpenGL refresh:
Synchronization?
- Consider double buffering:
- Is double buffering a cure-all? No, some jitter is possible if
render rate is a near multiple of refresh rate.
- A rotating square.
- Demo with and without double buffering.
- Key points:
- Use of
GLUT_DOUBLE
in call to glutInitDisplayMode.
- The idle function, spinDisplay updates spin factor and posts
a display callback.
- display re-renders.
- Use of
glRotate*
to multiply current matrix.
- First parameter is degrees of rotation.
- Next three parameters specify axis of rotation as a vector.
- Use glPushMatrix/ glPopMatrix to save/restore original
values.
My first video game. Wow.
- What are the elements in the game?
- What animations are there? What functions do they map to?
- What are the boundary conditions?
- Velocity.
- Bounces.
- Acceleration.
- Randomization.
- Misses.
- Points, time?
Details:
- Creating/rendering the ball.
- Moving the ball: glTranslate.
- Accessing cursor control keys: glutSpecialFunc.
Thomas P. Kelliher
Sun Feb 15 17:45:41 EST 1998
Tom Kelliher