Graphics Programs Reference
In-Depth Information
applied to the viewer (denoted by P 1 )andtopoint P =( l, m, n ) (denoted by P 2 ), it
yields
P ( t )=( l + kα, m, n + ) t +(
kα, 0 ,
)
=(( l + ) t
kα, mt, ( n + ) t
)
= P x ( t ) ,P y ( t ) ,P z ( t ) .
Our next task is to find the intersection point of the line and the projection plane.
This is obtained at the value t 0 that satisfies αP x ( t 0 )=
βP z ( t 0 )or
α ( l + ) t 0
=
β ( n + ) t 0
.
The solution is
k ( α 2 + β 2 )
αl + βn + k ( α 2 + β 2 ) =
k
αl + βn + k .
t 0 =
The intersection point is P ( t 0 ).
The next task is to find the three coordinates of the projected point P = P ( t 0 ).
The x coordinate is
= lkβ 2
k
αl + βn + k
nkαβ
αl + βn + k .
x = P x ( t 0 )=( l + ) t 0
=( l + )
The y coordinate is
mk
αl + βn + k ,
y = P y ( t 0 )= mt 0 =
and the z coordinate is
lkαβ + nkα 2
αl + βn + k
k
αl + βn + k
=
z = P z ( t 0 )=( n + ) t 0
=( n + )
.
From ( x ,y ,z )=( X/H, Y/H, Z/H ), we obtain
X = lkβ 2
nkαβ,
Y = mk,
Z =
lkαβ + nkα 2 ,
H = αl + βn + k.
Using the four expressions above and keeping in mind that ( l, m, n ) are the coor-
dinates of point P , it is easy to figure out the transformation matrix that projects P to
P :
2
0
kαβ
α
0
k
0
0
( l, m, n, 1) T =( X, Y, Z, H )
implies
T =
.
(3.7)
kαβ
0
2
β
0
0
0
k
Search WWH ::




Custom Search