Graphics Programs Reference
In-Depth Information
and the figure shows that this projection should be at the origin because the viewer is
looking directly at the point. The Mathematica code
<< LinearAlgebra'Orthogonalization'
k = 3.; r = 1/k;
{a, b, c} = {0, 0, -k}; {d, e, f} = Normalize[{-1, 1, k}]
T = {{(e^2+f+f^2)/(1 + f), -d e/(1 + f), 0, d r},
{-de/(1+f),(d^2+f+f^2)/(1 + f), 0, e r},
{-d, -e, 0, f r},
{(cd+bde-ae^2-af+cdf-af^2)/(1 + f),
(-bd^2+ce+ade-bf+cef-bf^2)/(1 + f),
0,-(ad+be+cf) r}};
{-1, 1, 0, 1}.T
computes the normalized components of D as (
0 . 3015 , 0 . 3015 , 0 . 9045) and the pro-
jected point as the 4-tuple (0 , 0 , 0 , 1 . 1) (i.e., the origin).
The second test (Figure 3.33b) assumes that the viewer is located at B =(0 , 2 k,
2 k )
looking in (the still unnormalized) direction (2 k,
2 k, 2 k ). We compute the projection
of point (2 k, 0 , 0), and the figure again suggests that this projection should be at the ori-
gin because the viewer is looking directly at the point. Code similar to the above yields
the normalized direction vector D as (0 . 577 ,
0 . 577 , 0 . 577) and the projected point as
(0 , 0 , 0 , 3 . 5), again the origin.
Exercise 3.22: Perform a similar test for B =(0 , 2 k,
k ) and unnormalized D =
(0 ,
1 ,
1). Use mathematical software to compute the projection of point (0 , 0 ,
4 k ).
Notice that the viewer is looking at the z axis a little “past” this point.
The rightmost column of T g is especially interesting. Its three top elements are
dr , er ,and fr ,where r =1 /k is the inverse of the (strictly positive) distance k of the
viewer from the screen and ( d, e, f )arethecomponentsofvector D . If any of these
components is zero, the corresponding element of T g will also be zero, which implies
that there is a simple relationship between these three matrix elements and the direction
D of the viewer's line of sight. Since the screen is perpendicular to the line of sight, we
end up with the following interesting result.
The three matrix elements dr, er,andfr indicate which of the three coordinate axes is
intercepted by the screen before the screen is transformed to the standard position.
For example, if e =0and d and f are nonzero, then D is a vector in the xz plane (and
is not in the x or z direction), so the projection plane intercepts the x and z axes but is
parallel to the y axis and does not intercept it. This result has already been mentioned
several times in the past and is often referred to as n-point perspective ,where n can
be 1, 2, or 3. Figure 3.34 illustrates the justification for this term. The figure shows a
cube centered on the origin and three viewers looking at it. Viewer 1 is located on the
z axis and sees one vanishing point. Viewer 2 is located on the xz plane and therefore
sees two vanishing points, and viewer 3 is located above the xz plane and so sees three
vanishing points. However, the term “ n -point perspective” refers to the number of
coordinate axes, 1, 2, or 3, intercepted by the projection plane, not to the number of
vanishing points actually observed by the viewer. The viewer can observe any number
Search WWH ::




Custom Search