


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Exam; Class: Computer Graphics; Subject: Computer Science; University: University of Maryland; Term: Spring 2005;
Typology: Exams
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Practice Final Solutions CMSC 427 Final: 8:00 AM Monday, May 16, 2005
Sample Problems (Note, some of these problems may be a bit more involved than ones I’d ask on a time-limited exam).
The ray begins at (1,2,3), and goes in the direction (1,1,1).
We can describe the line the ray is on with the equations x = z/2, y = 0. The sphere has the equation:
(x-3)^2 + (y-2)^2 + (z-12)^2 = 9 (^2 means squared)
Combining these equations we get:
x^2 – 6x + 9 + 4 + 4x^2 – 48x + 144 = 9 5x^2 – 54x + 144 = 0 The solution to this quadratic equation is: x = (54+- 6)/10 = 6, 4.8. So we intersect the sphere at the points:
(6, 0, 12) and (4.8,0,9.6).
We get the same equation for a line, and for a sphere we get:
(x-3)^2 + (y-2)^2 + (z-12)^2 = 25 (^2 means squared)
Combining these equations we get:
x^2 – 6x + 9 + 4 + 4x^2 – 48x + 144 = 25 5x^2 – 54x + 132 = 0 The solution to this quadratic equation is:
x = (54 +- sqrt( 276))/10 = 7.1, 3.7. These produce the points (7.1, 0,14.2), (3.7, 0, 7.4). The ray starts at the origin, and x and z increase as we go along, so it first reaches the point with the smallest values of x and z, which is (3.7,0,7.4). The normal of this point is a unit vector in the direction from the center of the sphere to this point, which is (3.7,0,7.4) – (3,2,12) = (.7, 2, -4.6)/5. (There’s a bit of round-off error here).
a. Suppose we look at this scene from the right side, instead of the left. Use the BSP tree to determine the order in which the triangles should be rendered.
From the right, we’re behind 3, so we want to first render things in front of 3. We’re in front of 2, so we first render things behind it, which is 1. Then we render 2, then anything in front of it, which is 5a. Then 3. Then we are behind 4, so we first render things in front of it. But there is nothing there, we render 4, then finally 5b.
b. Construct a valid BSP tree starting with triangle 1 instead of triangle 3.
Starting with 1 as the root, 3, 4 and 5 are in front, and 2 is behind. We could pick any of 3, 4 or 5 to be the child of 1. Let’s pick 4. Then 3 and 5 are in back of it. Pick it’s child to be 5, and 3 is the final child, behind 5.
a. What reflectance model might you choose, and what parameters might you use? Why? You might want to limit yourself to using the models we’ve discussed in class (eg., Phong, Lambertian).
You could use a combination of Phong and Lambertian. The Phong exponent should be very large, so there is a mirror-like reflection. But the hood is also part Lambertian, because we don’t just see the world reflected in it, we also see the color of the hood.
b. Suppose you have a flat piece of blue car hood. You shine a light on the car from an angle of pi/4. Then you take a few pictures of the car from different angles. How might you use these images to determine what parameters you should use to model its reflectance? How many images do you think you would need?
If you take a picture in any direction other than that of the mirror reflection, you’ll just get the diffuse component of reflection. In the mirror direction you get lambertian plus mirror reflection. If you subtract the first image from the second, you get the pure mirror part of the reflection. This gives both Lambertian and mirror separately. Note that a real car hood reflects light in a way that is more complicated than Lambertian plus mirror; this is just a simple model.