Graphics Programs Reference
In-Depth Information
A simple test verifies that the product ( x, y, z, 1) T p yields ( x, y, 0 ,rz +1) or, after
dividing by the fourth coordinate, ( x/ ( rz +1) ,y/ ( rz +1) , 0 , 1). This agrees with Equa-
tion (3.1) if we assume that r =1 /k . (Recall that k is strictly positive and is never
zero. The viewer never presses his eyes to the projection plane.)
It is now clear that there are two more special cases that are geometrically equiv-
alent to our standard position. These are the cases where the viewer is positioned on
thenegativesideofthe x axis (or the y axis) at a certain distance from the origin and
the projection plane is the yz (or xz ) plane. The object is located on the positive side
of the x (or y ) axis. These cases correspond to the transformation matrices
000 p
0100
0010
0001
1000
000 q
0010
0001
T x =
and
T y =
,
where both 1 /p and 1 /q are the distances of the viewer from the origin.
The general case, where the viewer can be positioned anywhere and looking in
any direction, is covered in Section 3.5. Before we get to this material, here are some
examples of points projected in the standard position.
Linear example . We arbitrarily select the two points P 1 =(2 , 3 , 1) and P 2 =
(3 ,
1 , 2) and the distance k = 1. Notice that the z coordinates of these points are
nonnegative. The points are projected to
P 1 = 2
=(1 , 3 / 2) and P 2 = 3
=(1 ,
3
(1 / 1) + 1
1
(2 / 1) + 1
(1 / 1) + 1 ,
(2 / 1) + 1 ,
1 / 3) .
We now select the midpoint P m =( P 1 + P 2 ) / 2=(5 / 2 , 1 , 3 / 2) and project it to
P m = 5 / 2
=(1 , 2 / 5) .
1
,
3 / 2
1
3 / 2
1
+1
+1
Point P m is located on the straight segment connecting P 1 to P 2 (it is the midpoint
of the segment) and P m is on the segment connecting P 1 to P 2 (although it isn't
themidpoint,becauseitiseasytoseethat P m =0 . 4 P 1 +0 . 6 P 2 ). The perspective
projection of a straight segment is a straight segment, which is why it is done in practice
by projecting the two endpoints and connecting them on the projection plane with a
straight segment.
Converging lines . We now select an arbitrary point P 3 =(0 , 2 , 3) and compute
anewpoint P 4 =(1 ,
2 , 4) from the relation P 4 P 3 = P 2 P 1 . The difference of
two points is a vector, so this relation guarantees that the vector from P 3 to P 4 equals
the vector from P 1 to P 2 , or, equivalently, that the two line segments P 1 P 2 and P 3 P 4
are parallel. The two new points are projected to yield
P 3 = 0 ,
=(0 , 1 / 2)
P 4 = 1
=(1 / 5 ,
2
(3 / 1) + 1
2
(4 / 1) + 1
and
(4 / 1) + 1 ,
2 / 5) .
Search WWH ::




Custom Search