01/21/2003
15-462 Computer Graphics I
38
Step 8: Animation
•Set idle callback
GLfloat delta = 2.0;
GLint axis = 2;
void spinCube()
{
  /* spin cube delta degrees about selected axis */
  theta[axis] += delta;
  if (theta[axis] > 360.0) theta[axis] -= 360.0;
 
  /* display result */
  glutPostRedisplay();
}