mElite 05: Let's animate planet and satellite
Using your knowledge about animation you have to
- enable double buffering
- register the idle function (animate) using glutIdleFunc in order to compute
frame rate and re-draw the scene with glutPostRedisplay
- register the visibility function (visibility) using glutVisibilityFunc in
order to avoid rendering when window is not visible
- register the reshape function (reshape) using glutReshapeFunc in order to
adjust aspect ratio
- use timer, i.e. glutGet(GLUT_ELAPSED_TIME), in order to:
- rotate planet and satellite along thier main axis
- calculate frame per second and show it in the shell
Click >>here<< for a possible
solution. You can compile it with the following Makefile.
For compiling you need
coriolis.h,
eliteutils.h, and
eliteutils.c in the same directory.
|