Animation
Tom Kelliher, CS 320
Mar. 11, 2011
Read 4.2-4.9.
Discussion of project.
- Animation:
double.c
, pong.c
Objects and transformations.
Project 2.
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
2011-03-11
Tom Kelliher