Graphics Reference
In-Depth Information
To get this new clip volume into the unit cube, we use the composite of the following
maps: first, translate to
11
È
Í
Ê
Ë
ˆ
¯
˘
˙
[
] ¥ [
] ¥
2
02
,
02
,
b
0
,
d
-
,
dd
n
f
and then use the radial transformation which multiplies the x, y, and z-coordinates
by
1
2
1
2
dd
dd d
nf
,
,
and
,
b
2
(
)
-
f
n
respectively. If M scale is the homogeneous matrix for the composite of these two maps,
then
1
2
Ê
ˆ
0
0
0
Á
Á
Á
Á
Á
Á
Á
Á
˜
˜
˜
˜
˜
˜
˜
˜
1
2
0
0
0
d
M
=
,
scale
dd
dd d
dd d
dd
nf
00
0
2
(
)
-
f
n
(
)
1
2
1
2
-
nf
f
-
1
Ë
¯
(
)
-
d
n
so that
1
2
Ê
ˆ
0
0
0
Á
Á
Á
Á
Á
Á
Á
Á
˜
˜
˜
˜
˜
˜
˜
˜
1
2
0
0
0
d
M
=
M
M
M
=
(4.10)
hcam
Æ
hclip
tr
persp
scale
1
2
1
2
d
dd
1
f
(
)
dd
-
d
d
f
n
nf
dd
dd
00
-
0
Ë
¯
(
-
d
)
f
n
is the matrix for the map T hcamÆhclip that we are after. It defines the transformation
from homogeneous camera to homogeneous clip coordinates. By construction the
map T camÆclip sends the truncated view volume in camera coordinates into the unit
cube [0,1] ¥ [0,1] ¥ [0,1] in clip space.
Note that the camera-to-clip-space transformation does not cost us anything
because it is computed only once and right away combined with the world-to-camera-
space transformation so that points are only transformed once, not twice.
Finally, our camera-to-clip-space transformation maps three-dimensional points
to three-dimensional points. In some cases, such as for wireframe displays, the z-
coordinate is not needed and we could eliminate a few computations above. However,
Search WWH ::




Custom Search