Game Development Reference
In-Depth Information
culate the signed distance D
from the transformed plane to the origin using the
equation
(
(
)
)
=−
1T
(
)
D
MNMPT
MNMPMNT
+
(
(
)
)
(
(
)
)
=−
1T
T
1T
T
T
1
T
1
=−
NM MP NM T
NM T
1
=−⋅
D
.
(5.23)
Recall from Equation (4.27) that the inverse of the 4
×
4
matrix F constructed
from the 3
×
3
matrix M and the 3D translation vector T is given by
1
1
MMT
1
F
=
.
(5.24)
0
1
1
We therefore have for the transpose of
F
(
)
1T
M
0
(
)
F
1T
=
.
(5.25)
1
MT
1
1
The quantity
D
−⋅
NM T is exactly the dot product between the fourth row of
(
)
1T
NNN . This shows that we may treat planes as
four-dimensional vectors that transform in the same manner as three-dimensional
normal vectors, except that we use the inverse transpose of the 4
F
and the 4D vector
,
,
,
z D
x
y
×
4
transfor-
mation matrix. Thus, the plane
=
N
, D
transforms using the 4
×
4
matrix F as
L
(
)
1T
L
′ =
F
.
(5.26)
5.3 The View Frustum
Figure 5.8 shows the view frustum , the volume of space containing everything
that is visible in a three-dimensional scene. The view frustum is shaped like a
pyramid whose apex lies at the camera position. It has this shape because it rep-
resents the exact volume that would be visible to a camera that is looking through
Search Nedrilad ::




Custom Search