The test is open-everything with the sole limitation that you
neither solicit nor give help while the exam is in progress.
Problem | You got | Out of |
1 | | 20 |
2 | | 20 |
3 | | 20 |
4 | | 20 |
5 | | 20 |
TOTAL | | 100 |
- The call
glOrtho(-1, 1, -1, 1, -1, 1)
does not generate
the default projection. Give the glOrtho call that does.
- 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 spheres. 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.
You probably haven't used gluCylinder before, so this problem is testing
how well you can pick up a book or visit some online help and integrate
a new concept quickly while building an OpenGL application.
- Suppose you had written an OpenGL program that simply drew a
nice soccer ball in the middle of the viewport.
- 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.
- 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.
- 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?
- One of the freshmen is just learning OpenGL, and defines a nice house
right at the origin, sitting on the xz plane, with a height of 1 unit, say.
To simulate walking around the house, the student includes an animation loop
containing the line
gluLookAt(10*cos(u), 0.5, 10*sin(u), 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
This works fine. Then the student tries to get fancy and changes the animation
loop to
gluLookAt(0, 10*cos(u), 10*sin(u), 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
What problems could occur here?