01/22/2001
15-462 Computer Graphics I
40
Step 10: Toggle Rotation or Exit
•
Keyboard callback
void keyboard(unsigned char key, int x, int y)
{
if (key=='q' || key == 'Q') exit(0);
if (key==' ') {stop = !stop;};
if (stop)
glutIdleFunc(NULL);
else
glutIdleFunc(spinCube);
}