CMSI 371/671
Final Exam

The test is open-everything with the sole limitation that you neither solicit nor give help while the exam is in progress.

  1. The call glOrtho(-1, 1, -1, 1, -1, 1) does not generate the default projection matrix. Give the glOrtho call that does.
  2. Write an OpenGL function to draw a "hot dog" (the kind of processed meat-like thing some people eat). The hot dog must be constructed from a cylinder and two speheres. The function's parameters must include a quadric object for generating the cylinder, the length of the hot dog, the width of the hot dog, the number of slices and the number of stacks. (Hint: gluCylinder is described on page 489 of the red book.)
  3. Prove or disprove that (in 2-D) the operation of shearing by 2 in x and 3 in y simultaneously is identical to first shearing by 2 in x and then shearing by 3 in y.
  4. Suppose you had written an OpenGL program that simply drew a nice soccer ball in the middle of a window.
    1. If your projection matrix had been defined with gluPerspective(fovy,a,n,f) with n>0 and f>0, then you modified the code to make n smaller, but still larger than 0, recompiled and reran the program, would the new soccer ball look larger or smaller than the original? Explain.

    2. If your projection matrix had been defined with glFrustum(x1,x2,y1,y2,n,f) with n>0 and f>0, then you modified the code to make n smaller, but still larger than 0, recompiled and reran the program, would the new soccer ball look larger or smaller than the original? Explain.

  5. Give the series of basic transformation matrices that transform the wedge below so that it can sit "on top of" the following parallelepiped to form a simple "house" with the ridge line of the roof parallel to the z-axis. The height of the resulting house should be 5.

    house.gif

  6. For the following fractal, circle the self-similar components, give the set of affine transformations that describe it, give its fractal dimension, and give an L-system that generates it.

    mm.gif

  7. Consider the transformation that turns the figure ABC where A=(2,0), B=(2,-2), and C=(0,-2) into A'B'C' where A'=(15,0), B'=(0,1) and C'=(-15,0). If this transformation is affine, give the transformation, expressed as the composition of basic transformations. If it is not affine, prove why it is not.
  8. The advantage of parameterizing sphere and torus drawing functions with both slices and stacks is obvious: the more of each you have, the less you notice the polygonal approximation. But why do we need to specify stacks for cones?