i
i
i
i
i
i
i
i
7.5. Field-of-View 159
Exercises
1. Construct the viewport matrix required for a system in which pixel coordi-
nates count down from the top of the image, rather than up from the bottom.
2. Multiply the viewport and orthographic projection matrices, and show that
the result can also be obtained by a single application of Equation (6.7).
3. Derive the third row of Equation (7.3) from the constraint that z is preserved
for points on the near and far planes.
4. Show algebraically that the perspective matrix preserves order of z values
within the view volume.
5. For a 4×4 matrix whose top three rows are arbitrary and whose bottom row
is (0, 0, 0, 1), show that the points (x, y, z, 1) and (hx, hy, hz, h) transform
to the same point after homogenization.
6. Verify that the form of M
−1
p
given in the text is correct.
7. Verify that the full perspective to canonical matrix M
projection
takes (r, t, n)
to (1, 1, 1).
8. Write down a perspective matrix for n =1, f =2.
9. For the point p =(x, y, z, 1), what are the homogenized and unhomoge-
nized result for that point transformed by the perspective matrix in Exer-
cise 6?
10. For the eye position e =(0, 1, 0), a gaze vector g =(0, −1, 0),andaview-
up vector t =(1, 1, 0), what is the resulting orthonormal uvw basis used
for coordinate rotations?
11. Show, that for a perspective transform, line segments that start in the view
volume do map to line segments in the canonical volume after homogeniza-
tion. Further, show that the relative ordering of points on the two segments
is the same. Hint: Show that the f (t) in Equation (7.8) has the properties
f(0) = 0, f(1) = 1, the derivative of f is positive for all t ∈ [0, 1],andthe
homogeneous coordinate does not change sign.