Practice Final Exam Solutions - Computer Graphics | CMSC 427, Exams of Computer Graphics

Material Type: Exam; Class: Computer Graphics; Subject: Computer Science; University: University of Maryland; Term: Spring 2005;

Typology: Exams

Pre 2010

Uploaded on 07/29/2009

koofers-user-wjz
koofers-user-wjz 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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).
1. Suppose the camera’s focal point is at (1,2,3), you are looking in the direction
(1,1,1), and the focal length is 1. Give a ray from the focal point through the
center of the image.
The ray begins at (1,2,3), and goes in the direction (1,1,1).
2. Suppose the camera has a focal point at (0,0,0), and you cast a ray through a
pixel whose center is at (1/2, 0, 1). Does this ray intersect a sphere centered at
(3, 2, 12) with a radius of 3?
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).
3. Suppose the camera has a focal point at (0,0,0), and you cast a ray through a
pixel whose is at (1/2, 0, 1). This ray definitely intersects a sphere centered at
(3, 2, 12) with a radius of 5. What are the coordinates and surface center
normal of the first point that the ray intersects?
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:
pf3
pf4

Partial preview of the text

Download Practice Final Exam Solutions - Computer Graphics | CMSC 427 and more Exams Computer Graphics in PDF only on Docsity!

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).

  1. Suppose the camera’s focal point is at (1,2,3), you are looking in the direction (1,1,1), and the focal length is 1. Give a ray from the focal point through the center of the image.

The ray begins at (1,2,3), and goes in the direction (1,1,1).

  1. Suppose the camera has a focal point at (0,0,0), and you cast a ray through a pixel whose center is at (1/2, 0, 1). Does this ray intersect a sphere centered at (3, 2, 12) with a radius of 3?

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).

  1. Suppose the camera has a focal point at (0,0,0), and you cast a ray through a pixel whose is at (1/2, 0, 1). This ray definitely intersects a sphere centered at (3, 2, 12) with a radius of 5. What are the coordinates and surface center normal of the first point that the ray intersects?

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).

  1. Consider the BSP tree discussed in class:

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.

  1. Suppose we construct a model by taking a sphere centered at (10,0,10) with a radius of 2, and subtracting a cylinder. The cylinder is centered also at (10,0,10). It has a circular cross-section with a radius 1 when we slice it with a plane that has a constant z value (eg., if we intersect the cylinder with the z

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.