animation.c Questions

Tom Kelliher, CS 320

Apr. 4, 2000

Refer to animation.c in answering these questions. You are encouraged to compile, run, and modify the program. Some of the following questions require you to refer to the OpenGL man pages. These man pages are on phoenix, accessible from a shell or by following the online man pages link from my personal home page. You need to remember two things:

  1. The command line argument to man needs to be ``downcased.''

  2. The function suffixes for number and type of arguments should be stripped off.

For example, to read the man page for glColor3f, type:
man glcolor
What is unfortunate is that some of the descriptions are included with other descriptions. For example, if you want to see the man page for glutGetWindow(), you somehow have to know that you need to ask for the man page for glutSetWindow().

The questions (A -- Aaron, R -- Rachel, S -- Sze-Ling):

  1. (A) When a window is resized, why do the squares' change size? The call
    glRectf(-25.0, -25.0, 25.0, 25.0);
    
    creates a square. Yet, by resizing the window I can resize the square.

  2. (R) Explain why the rotating squares in the single-buffered window are so ``choppy.''

  3. (S) Explain how we are able to stop and start the animation.

  4. (A) Why does the rotation rate change as the window is resized?

  5. (R) Explain how to modify the program so that if the user clicked in the single buffered window they would be able to stop/start the sspin rate and if they clicked in the double buffered window they would be able to stop/start the dspin rate.

  6. (S) Compare and contrast the functions displayd() and displays(). In particular, explain what glLoadIdentity(), glRotatef(), glRectf(), and glutSwapBuffers() do. Also, explain why displayd() doesn't need to call glFlush().



Thomas P. Kelliher
Tue Apr 4 16:25:36 EDT 2000
Tom Kelliher