Animation
Tom Kelliher, CS 320
Feb. 26, 2001
Read 4.1, Appendices B and C.
Pong project handout.
Finished paint.c
lab.
- Animation:
double.c
, pong.c
Objects and transformations.
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
Sat Feb 24 16:21:56 EST 2001
Tom Kelliher