
CSE 167: Computer Graphics
Midterm
Fall, 2005
1. A triangle is defined by three points a, b, and c. Write an expression for the vector e
which is in the same plane as the triangle and perpendicular to edge bc, while pointing
towards the inside of the triangle.
e = ( c – a ) × ( b – c ) × ( b – c )
(note: various other combinations work)
2. A 3D line segment from point a to point b intersects a plane described by a unit normal
n and point p, which is an arbitrary point somewhere on the plane. Find the point x where
the line intersects the plane.
da = (a - p) ∙ n
db = (b - p) ∙ n
t = db / (da - db)
x = ta + (1-t)b
3. A vertex has a position p and normal n. Write p and n as 4D homogeneous vectors.
p = [px py pz 1]
n = [nx ny nz 0]
(technically, these should be transposed)
4. An object is placed into the world with matrix W. The camera is placed in the world
with matrix C. Find the position of the camera in object space.
(note: C.d is the position of the camera in world space)
5. Define Gouraud shading and Phong shading (one sentence each should be enough)
Gouraud shading computes lighting at the vertices and interpolates the color
across the triangle
Phong shading interpolates the vertex normal across the triangle and computes
shading per pixel