# CS248 Final Review Practice Questions- Dec. 4, 1999

This page includes a few example problems for the cs248 Final. Answers have been removed, if you want to test yourself before looking at the answers. See also the review notes page , which gives the answers to these questions.

Disclaimer: These questions were designed to give you an idea of what kinds of questions we might ask about the material. This was not intended to be an exhaustive coverage of all material you should know for the exam.

## Geometric Transformations [3D]

(by Lucas Pereira)
(I forgot to cover this at the review session. Even though this class was the Thursday before the midterm, the material was not covered in the midterm, and so will be fair game for the final, although will not be heavily emphasized.)

Questions:

1. Where on earth can you walk forward 6219 miles (1/4 circumference), turn right, walk forward 6219 miles, turn right, walk forward 6219 miles, and be back where you started?

2. When viewed by a perspective projection, which of the following properties of a texture-mapped plane will be preserved: lengths, angles, parallel lines, and straight lines?

3. When rendering with OpenGL texture-mapping (GL_NEAREST, no mipmaps), is this a forward-mapping or backward-mapping operation?

4. Lucas wants to do rotatez(90), but he spilled coffee on his keyboard and his z key no longer works. He decides instead that he can do it with the following: rotatex(90) [ rotatey(angley) [ rotatex(-90) ]]. Is he right? What should (angley) be?

## Texture Mapping

(by Lucas Pereira)

Questions:

1. Can a 1-D texture map be applied to a 2-D surface? How?

2. Can a 2-D texture map be applied to a 1-D line? How?

3. What is minification? Magnification?

4. What are the effects of using GL_NEAREST as your texture filter when minifying? Magnifying? Explain.

5. What are the effects of using GL_LINEAR as your texture filter when minifying? Magnifying? Explain.

6. What is the common OpenGL approach to avoid aliasing while minifying? Will it have any effect on magnifying?

7. What filter kernel does GL_NEAREST correspond to?

8. What filter kernel does GL_LINEAR correspond to?

9. How does mipmapping with tri-linear interpolation compute the texture color for a vertex?

10. To make things simpler, Lucas has turned his '89 Integra Racing game into a drag-racing game. As such, he has his car racing up the Y axis of a single texture-mapped ground polygon. The viewer always looks orthographically straight down on his car. In this orthographic view, the ground texture is magnified (more pixels than texels). Because his car goes so fast (many texels per frame), the ground plane looks choppy, instead of smoothly motion-blurred. Since Prof. Levoy is his advisor, he figures that all problems can be solved with proper filtering. Could standard mipmapping solve his problem? Why or why not?

## Perspective

(by Sean Anderson)

Perspective Questions

1. Give 2 reasons for clipping before homogenization.

2. What is the condition used to determine if the x coordinate (xc) of a non-homogeneous projected point is within the left and right walls (at -1 and +1 on the near plane) of a perspective view frustum?

3. What part of a 4x4 matrix tells you that it is a perspective transformation?

4. Consider a view of a scene with 2 cubes oriented arbitrarily; how many vanishing points could there be in the image?

5. Where is the viewer's eye and what is the viewing direction when the perspective transform is applied?

## Visibility

(by Dave Koller)

Questions:

1. NASA wants to draw a picture of Mars to try to visualize the landing site of the missing Mars Polar Lander probe, and so they're trying to pick a good hidden-surface algorithm. They have a high-powered supercomputer, with 1.7GB of RAM. They want to draw a 3000x3000 pixel image. Unfortunately, their Mars model consists of ten Billion polygons, and so they can only load 2% of it in memory at a time. They want to minimize disk accesses. Alas, they only have programmers who know how to implement Watkin's algorithm, Weiler-Atherton, BSP trees, and Z-buffering. Which algorithm should they use, and why? (For each discarded algorithm, state why it's a bad choice.) If they can load a million polygons per second off disk, how long will it take before they will have a picture to show reporters?

2. [hard] A cs248 student is experiencing difficulties with his z-buffer, so he sends email to the cs248tas. The problem, he says, is that he's seeing really bad artifacts. Upon investigation, they realize that he's setting the near clipping plane to 0.01, the far clipping plane to 20, and most objects are about 10 units away. The TAs tell him that his problem is lack of precision; different surfaces are getting mapped to the exact same Z-value in his 16-bit Zbuffer. What is the depth range of a single z "bucket" at a distance of 10 units away? How could he fix his problem? You may assume the following formula maps zwin into the range 0 to 1:
zwin = [(znear + z) * zfar] / [(zfar - znear) * z]

(by Szymon Rusinkiewicz)

Questions:

1. You change the normal vectors of an OpenGL triangle, but don't change the position of the vertices. Which components of the color seen by the viewer (ambient, diffuse, and specular) might change? Why?

2. An object is sitting in a room with lights you can't turn off. You want to take a picture of the object with only a single point light source. You accomplish this by taking the object's picture with the normal light in the room, and another picture with that light plus a point light source. You then subtract the first picture from the second. Will this work? Why or why not?

3. You are in an empty room (just 4 walls, floor and ceiling), with a single light bulb. You carefully measure the dimensions of the room, the color of the paint on each wall, and the radiant intensity of the light bulb. You use these measurements to construct an OpenGL model of the room, and render the scene. Nevertheless, the rendering will not look like a photograph of the room. Why not?

4. In the table below, write "YES" or "NO" in each of the four squares, to indicate whether a viewer might see a finite-sized specular highlight (shiny spot) on a large flat plane. You may assume the plane is made up of many tiny triangles, so that it is effectively computing a normal for each pixel.
 Directional Light (w=0) Point Light (w=1) Orthographic Projection (viewer w=0) a) b) Perspective Projection (viewer w=1) c) d)