Graphics Programs Reference
In-Depth Information
(Try to convince yourself that α is positive in the gray area above and to the right of
the screen because x + z +2 ψ is positive in this area.)
Thenextstepistocomputevector d
d = b + α ( P
b )
2 ψ
x + z +2 ψ ( x + ψ, y, z + ψ )
=(
ψ, 0 ,
ψ )+
ψ
x + z +2 ψ ( x
=
z, y, z
x ) .
Notice that P =(0 , 0 , 0) is transformed to P =(0 , 0 , 0).
Also, every point P =
x ) is transformed to P =(0 , 0 , 0).
Since the screen is centered at the origin, we have c = α ( P
( x, 0 ,
b )+ b =
d . The next step is to calculate the local screen vectors u and w from Equation (3.17).
This is straightforward and results in u =(0 ,
b )
a = α ( P
ψ, 0) and w = ( ψ, 0 ,
ψ ). After normal-
1 , 0) and w =(1 / 2 , 0 ,
1 / 2). Notice that u is the y
ization, these become u =(0 ,
axis and w is in the xz plane.
The screen equation is obtained from a
( x, y, z ) = 0, which implies ψ ( x + z )=0
or x =
z . The last step is to derive the transformation matrix. From
X
H
z )
x + z +2 ψ ,
ψ ( x
Y
H
ψy
x + z +2 ψ ,
Z
H
x )
x + z +2 ψ ,
ψ ( z
x =
=
=
=
=
=
we get
ψ
0
ψ
1
0
ψ
00
( X, Y, Z, H )=( x, y, z, 1)
.
ψ 0 ψ 1
000 ψ
(Notice the two 1's in the last column. They indicate that the projection plane intercepts
the x and z axes but not the y axis. This is a two-point perspective.)
3.9 A Coordinate-Free Approach: II
This approach to the problem of perspective projection also uses vectors instead of
coordinates, but we assume that the following are given (Figure 3.38):
1. the position of the viewer (vector b );
2. the direction and distance from the viewer to the projection plane (vector a );
3. an “up” vector Z , which determines the direction of the local screen vector w ;
4. two viewing half-angles h and v , an approach that is handy when we want to
limit the projected image to certain viewing angles, as in Figure 3.13.
 
Search WWH ::




Custom Search