solution - Computer Graphics Laboratory at UCSD

advertisement
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.
p  W 1  C.d
(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
6. A triangle has points a, b, and c. Write an equation for the area of the triangle.
area = 1/2 * | ( b – a ) × ( c – a ) |
(note: various other combinations work)
7. Match the term to the definition:
a. Bump mapping
b. Texture mapping
c. Environment mapping
d. Displacement mapping
_b__1. Mapping image colors
_a__2. Mapping normal perturbations
_d__3. Mapping geometric distortion
_c__4. Mapping reflection of a virtual sphere
 m11 m12 m13 
 n11
8. Given matrices M  m21 m22 m23  and N  n21
m31 m32 m33 
n31
for component l 31 of matrix L, where L  M  N .
n12
n22
n32
n13 
n23  , write the equation
n33 
l31 = m31 n31 + m32 n21 + m33 n31
9. Matrix S is the world matrix for a character’s shoulder joint. Matrix E is the local
matrix for the elbow, which is a child of the shoulder. Matrix W is the local matrix for
the wrist, which is a child of the elbow. A vertex v is defined in the local space of the
wrist. Write a single equation that computes v , the world space position of the vertex.
v’ = S ∙ E ∙ W ∙ v
10. Arrange the following spaces in the order we expect a vertex to hypothetically go
through in the traditional transformation process
a. World space
b. Image space
c. Object space
d. Device space
e. Un-normalized view space
f. Camera space
1._c__ 2._a__ 3._f__ 4._e__ 5._b__ 6._d__
11. Match the appropriate technique to the definition/result
a. Cook Torrance
b. Culling
c. Mipmap
d. Single Indexing
e. Gouraud
_c__1. Texture minification
_d__2. Shared vertices
_e__3. Color interpolation
_a__4. Reflection model
_b__5. Removal of invisible geometry
12. Mr. J is standing at point j and facing in direction d. Mr. K is standing at point k.
What angle must Mr. J turn in order to be facing Mr. K ? (NOTE: the sign (+/-) of the
angle is not important)
 k  j  d 


 kjd 
  cos 1 
13. A simulated airplane has a matrix M. Write an if() statement that checks if the plane
is tilted more than 60 degrees from being level (assuming that the y-axis points upwards,
and the tilt can be in any direction). NOTE: +1 point bonus for finding the most efficient
method!
if (M.b.y < 0.5) {…}
or M[1][1] (assuming indexing starts at 0)
14. A rendered animation is suffering from Moiré patterns. Which of the following
techniques will eliminate the problem?
a.
b.
c.
d.
e.
Increasing z-buffer precision
Uniform supersampling
Environment mapping
Random sampling
Galerkin-Taylor formulation
d. Random sampling
15. A perfectly diffuse white vertex has position v and normal n. The surface is
illuminated by a single point light with position p and color c. What is the color reflected
off of the vertex? (assume a physically accurate falloff for the point light intensity)
color  c
n  p  v 
pv
3
Bonus Question: What does the ‘mip’ in mipmap stand for?
Multum in parvo
(latin for ‘many in one’)
Download