
Computer Graphics: Homework 2. Due: 9/30/2004
1. Let’s say that the (interpolated) reflected vector for some fragment is
R= (Rx, Ry, Rz). In cubical environment mapping, this vector is mapped
into texture coordinates (u, v), representing a point on the texture where the
color is to be looked up from. Write out in detail how this mapping works,
i.e. derive an explicit formula for uand vas a function of Rx,Ryand Rz. You
can assume that the cube we use to record incoming colors is axis-oriented,
centered at the origin and has edge lenght 2 (so that its vertices have form
(±1,±1,±1)) and unfold the cube in any ‘reasonable’ way.
In particular, explain how to determine the face intersected by the ray
from the center of the cube in the direction of R. The formula for uand v
will depend on that face.
2. What is the maximum number of edges of a polygon that can be obtained
by clipping a triangle against a cube? Explain your answer.
Hint: Break into two steps: max number of edges of cube-plane intersec-
tion, max number of triangle-convex n-gon intersection. Then put the results
together.
3. Let’s say you are applying cubical environment texture (without any extra
modulation or illumination) that has a constant (unique) color for each of
the 6 faces to a sphere. Assume the viewpoint is far away from the sphere.
How many colors will you see on the sphere? Why?
1