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
+
kβ
)
t
+(
−
kα,
0
,
−
kβ
)
=((
l
+
kα
)
t
−
kα, mt,
(
n
+
kβ
)
t
−
kβ
)
=
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
+
kα
)
t
0
−
kα
=
β
(
n
+
kβ
)
t
0
−
kβ
.
−
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
kα
=
lkβ
2
k
αl
+
βn
+
k
−
nkαβ
αl
+
βn
+
k
.
−
x
∗
=
P
x
(
t
0
)=(
l
+
kα
)
t
0
−
kα
=(
l
+
kα
)
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
−
kβ
=
−
z
∗
=
P
z
(
t
0
)=(
n
+
kβ
)
t
0
−
kβ
=(
n
+
kβ
)
.
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
∗
:
⎛
⎞
kβ
2
0
−
kαβ
α
⎝
0
k
0
0
⎠
(
l, m, n,
1)
T
=(
X, Y, Z, H
)
implies
T
=
.
(3.7)
−
kαβ
0
kα
2
β
0
0
0
k
Search WWH ::
Custom Search