Answers in BLUE

Homework 3, due Thurs Sep 20

Hand in your solution on RPILMS. Each team should submit their solution under only 1 student's name. The other student's submission should just name the lead student. (This makes it easier for us to avoid grading it twice.) For programming exercises, hand in code and screen dumps. We won't run your code, but will use the screendumps to judge how it worked.

  1. (2 pts) What are the lower left front and upper right back corners of the view frustum defined by this statement:
    glFrustum(1.,2.,3.,4.,5.,6.);
    (1,3,-5) (2.4,4.8,-6) (corrected)
  2. (1 pt) What is the biggest advantage of using display lists?
    You can specify a component once and draw it repeatedly. It might also be faster. Various other answers are also ok.
  3. (1 pt) What is the biggest advantage of using glDrawElements?
    You separate geometry from topology. It's more organized for large amounts of data. You execute fewer subroutine calls, which is faster. Various other answers are also ok.
  4. (1 pt) What argument of glDrawElements allows you to intersperse coordinate and color information?
    It's glVertexPointer and glColorPointer, not glDrawElements. In those, it's the stride argument, the 3rd one.
  5. (1 pt) What argument of glDrawElements allows you to specify whether your colors have opacity information?
    It's glVertexPointer not glDrawElements. It's the 1st argument, which gives the number of components per color. Opacity is the 4th component
  6. (1 pt) Before calling glDrawElements, you have to tell OpenGL where the vertices are. How do you do that?
    glVertexPointer
  7. (1 pt) What feature in the way that display lists are created prevents you from making a loop (e.g., list #1 calls list #2, which calls list #1)?
    You can include only a display list that was already compiled. You cannot edit a compiled display list. So you cannot make a loop.
  8. (1 pt) If a display list draws a vertex without first setting a color, what color is used?
    The current color as set by the most recent glColor3f (or similar) routine call that was executed.
  9. (1 pt) When specifying what font to draw, what happens if you make a typo, e.g.,
    glutBitmapCharacter("TIMEZ_ROMAN_12",'a');
    Saying, "it doesn't work," is not specific enough. What fails?
    1st, the font name should be a constant not a string. I got a compiler error on this because of the argument being a wrong type. 2nd, if you remove the quotes, the constant will be undefined, giving a different compiler error.
  10. (4 pts) Do exercise 3.9 on page 77 (held over from Homework 2).
  11. (4 pts) Do exercise 3.12, parts a, b, f, i, on page 78. (If doing this in a team, this will force you to integrate your code into one program.)

Total: 18 points.