cube.c Questions

Tom Kelliher, CS 320

Apr. 24, 2000

Refer to cube.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 and/or the textbook. The 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().

Assume the x- and y-axes have their usual orientation and that the +z-axis points towards you. The questions (A -- Aaron, R -- Rachel, S -- Sze-Ling):

  1. (R) Draw the cube in 3-dimensional space, labeling (0-7) the vertices.

  2. (S) What are the indices of the vertices making up the front and back (as seen from the +z axis) faces of the cube?

  3. (A) Modify the program so that only the (0,4,7,3) and (1,2,6,5) cube faces are rendered. Run the program with and without depth-buffering enabled. Explain the results.

  4. (R) The edges of the cube don't appear to be parallel. Why?

  5. (S) Explain polygon().

  6. (A) Explain the cube ``data structure.''



Thomas P. Kelliher
Wed Apr 19 07:37:16 EDT 2000
Tom Kelliher