



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




November 18, 2003
Instructor: Sam Buss, UC San Diego
Write your name or initials on every page before beginning the exam.
You have 75 minutes. There are eight problems. You may not use โcheatโ sheets, calculators, notes, textbooks, or other materials during this exam. You must show your work in order to get credit. Good luck!
Student ID:
Total
ใ 1 , 0 ใ
ใ 1 , 1 ใ
ใ 0 , โ 1 ใ
ใ 0 , 0 ใ
ใ 0 , 1 ใ
y
x (^) =โ ใโ 2 , 0 ใ ใ 0 , 0 ใ
ใโ 1 , 1 ใ ใ 0 , 1 ใ
ใโ 1 , 0 ใ
y
x
a. Give a 3 ร 3 matrix that represents A over homogeneous coordinates.
b. Give a 3 ร 3 matrix that represents Aโ^1 over homogeneous coordinates.
glMatrixMode(GL MODELVIEW); glLoadIdentity(); glRotatef( 90.0, 0, 1, 0 ); glRotatef( 90.0, 0, 0, 1 ); glRotatef( -90.0, 0, 1, 0 ); // Watch out: negative sign! glTranslatef( 3, 4, 5 );
Show explicitly the contents of the 4 ร 4 ModelView matrix after these commands have been executed.
You must be careful here to note that the glTranslatef comes after the glRotatefโs.
H = {ใx, y, zใ : x^2 โ y^2 โ z^2 = 1, x > 0 }.
Suppose p = ใp 0 , p 1 , p 2 ใ is a point on H. Give a formula for a unit vector normal to the surface H at the point p.
ANSWER: Let f (x, y, z) = x^2 โ y^2 โ z^2. Then โf = ใ 2 x, โ 2 y, โ 2 zใ. A unit vector normal to the surface p = ใp 0 , p 1 , p 2 ใ is given by
โf (p) ||โf (p)||
ใp 0 , โp 1 , โp 2 ใ โ p^20 + p^21 + p^22
ANSWER: Gouraud shading computes the colors at each vertex of a triangle (or quad or polygon) with the Phong lighting model and interpolates their colors into the interior of the shape. Phong shading interpolates normal vectors from the vertices into the interior of the shape, and recomputes illumination levels (i.e., color values) of each pixel with the Phong lighting model.
Gouraud shading is commonly used by OpenGL.
Advantages of Gouraud shading are speed, simplicity and ease of implementa- tion.
Advantages of the Phong shading: Much better at catching specular highlights and spotlights. Better results with rendering with large polygons and when animating a scene.
The disadvantage of Phong lighting is that infomation about the lights, and the material propertes, etc., must be remembered until late in the graphics rendering pipeline.
(a) What is the point u 1 = Lerp(x, y, 1)?
ANSWER: ใโ 1 , 1 ใ.
(b) What is the point u 2 = Lerp(x, y, 12 )?
ANSWER: ใ 12 , โ 12 ใ.
(c) What is the point u 3 = Lerp(x, y, โ2)?
ANSWER: ใ 8 , โ 8 ใ.
(d) Let u 4 = ใ 1 , โ 1 ใ. Find the value of ฮฑ such that Lerp(x, y, ฮฑ) = u 4.
ANSWER: ฮฑ = 13.
(a) What point v 1 has barycentric coordinates ใ 13 , 13 , 13 ใ?
ANSWER: ใ 1 , 2 , 23 ใ.
(b) What point v 2 has barycentric coordinates ใ 1 , 0 , 0 ใ?
ANSWER: ใโ 1 , 0 , 5 ใ.
(c) What point v 3 has barycentric coordinates ใ 14 , 14 , 12 ใ?
ANSWER: ใ 74 , 32 , 0 ใ.
(d) What point v 4 has barycentric coordinates ใ 13 , 23 , 0 ใ?
ANSWER: ใ โ 31 , 103 , 1 ใ.
(e) What are the barycentric coordinates of the point y?
ANSWER: ใ 0 , 1 , 0 ใ.