11 static const int FPS = 20;
 
   20     glViewport(0, 0, w, h);
 
   21     GLfloat aspect = (GLfloat)w / (GLfloat)h;
 
   22     glMatrixMode(GL_PROJECTION);
 
   27         glOrtho(-50.0, 50.0, -50.0 / aspect, 50.0 / aspect, -1.0, 1.0);
 
   34         glOrtho(-10.0 * aspect, 10.0 * aspect, -10.0, 10.0, -1.0, 1.0);
 
   40     glClear(GL_COLOR_BUFFER_BIT);
 
   41     glMatrixMode(GL_MODELVIEW);
 
   44     glColor3f(1.0, 1.0, 1.0);
 
   46     glutWireTorus(0.5, 3, 15, 30);
 
   90 void mouse(
int button, 
int state, 
int x, 
int y) {
 
   91     if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN) {
 
   93     } 
else if (button == GLUT_RIGHT_BUTTON && state == GLUT_DOWN) {
 
   99     glClearColor(0.0, 0.0, 0.0, 1.0);
 
  100     glColor3f(1.0, 1.0, 1.0);
 
  102     glMatrixMode(GL_PROJECTION);
 
  104     gluPerspective(60.0, 4.0 / 3.0, 1, 40);
 
  106     glMatrixMode(GL_MODELVIEW);
 
  108     gluLookAt(4, 6, 5, 0, 0, 0, 0, 1, 0);
 
  111 int main(
int argc, 
char **argv) {
 
  112     glutInit(&argc, argv);
 
  113     glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
 
  116     glutInitWindowPosition(80, 80);
 
  117     glutInitWindowSize(1000, 800);
 
  118     glutCreateWindow(
"A Torus on a Plane");
 
  125     glutTimerFunc(100, 
timer, 0);
 
  126     glutMouseFunc(
mouse);
 
void reshape(GLint w, GLint h)
static GLfloat current_rot
int main(int argc, char **argv)
void mouse(int button, int state, int x, int y)