Graphics Programs Reference
In-Depth Information
y
y
y
Q
Q
z
z
x
x
Positive h
Negative h
Figure 3.35: The Top Vector.
This extra step can be ignored in cases where the projection plane is rotated through
a small angle or is infinitely large. In practice, however, the projection plane is the
screen on which the three-dimensional scene is projected. This screen has a finite size
and should normally be oriented such that its top points in the positive y direction.
The rotation matrix of step 4 is easy to derive. We assume that the first three steps
have brought the screen to the xy plane and have transformed the original top vector
Q to Q =( h, i, 0). [We assume that ( h, i, 0) is already normalized, so h 2 + i 2
=1or
± 1
h =
i 2 .] We further assume that the rotation of step 4 should align Q with the
positive y axis (0 , 1 , 0). The rotation is about the z axis, a nd the angle φ of rotation is
determined by cos φ = Q
(0 , 1 , 0) = i and sin φ = 1
i 2 = h . The rotation matrix is
therefore given by
i
h 00
hi 00
0010
0001
T 4 =
.
Matrix T 4 rotates vector ( h, i, 0 , 1) to the positive y axis. The following Mathemat-
ica code verifies this for the four special normalized vectors ( a, a, 0 , 0), ( a,
a, 0 , 0),
a, 0 , 0), where a =1 / 2. In each case, once the values of h and
i on line 1 are set to a or -a , the result is (0 , 1 , 0 , 0).
(
a, a, 0 , 0), and (
a,
1 a = 1/Sqrt[2];h=a;i=a;
2 T = {{i, h, 0, 0},{-h, i, 0, 0},{0, 0, 1, 0},{0, 0, 0, 1}};
3 {h, i, 0, 1}.T
Exercise 3.25: Assume a viewer located at B =(0 , 2 k,
2 k ) looking in (unnormalized)
1), as in Exercise 3.22 and a value k = 2. Figure Ans.8a
illustrates the geometry of this case.
1. Derive the equation of the projection plane.
2. Multiply the transformation matrices of Equations (3.10), (3.11), and (3.12) to
obtain one transformation T 123 that brings the viewer to the standard position.
3. Pick up a point on the projection plane and compute its coordinate on the xy
plane after transformation T 123 .
direction D =(0 ,
1 ,
 
Search WWH ::




Custom Search