Graphics Reference
In-Depth Information
transforms vertices from WC to the
eye coordinate
(EC) space, and
M
P
trans-
forms vertices from EC space to the NDC space. In this way, conceptually,
M
W
World transform.
Because
the result of this transform is
the
model
of the world, this is
also referred to as the
model
transform.
performs the
world transform
,
M
V
performs the
eye transform
,and
M
P
performs
the
projection transform
,or
eye
projection
world
M
W
−→
C
M
V
C
M
P
OC
(
V
i
)
W
−→
E
−→
NDC
(
V
o
)
.
(14.2)
In computer graphics, we refer to this series of coordinate transformations as
the coordinate transformation pipeline, or sometimes simply the transformation
pipeline.
As discussed in Section 10.3, most graphics APIs (including OpenGL and
D3D) expect the output of this transformation pipeline,
V
o
, to be in the normal-
ized device coordinate (NDC) space. The graphics API will then automatically
transform the
V
o
from
±
1 NDC space to the device coordinate (DC) space for
displaying on the output device. In other words, for
V
i
to be visible on the output
display device, the transformed result,
V
o
, must be in the NDC range, or
⎧
⎨
−
1
≤
x
o
≤
+
1
,
V
o
=
x
o
y
o
z
o
,
where
−
1
≤
y
o
≤
+
1
,
⎩
−
1
≤
z
o
≤
+
1
.
We will begin our discussion by learning and reviewing coordinate spaces and
how to transform between them. We will then use our first 3D program from
Tutorial 13.1 to demonstrate how these coordinate spaces work together.
14.4
The World Transform: OC to WC
In Chapter 11, we defined the
SceneNode
class to transform primitives and or-
ganized the
SceneNode
objects into tree hierarchies. Recall that the
SceneNode
class works through the
DrawHelper
class to manipulate a matrix stack and sets
the
M
W
matrix processor. In this way, the
SceneNode
class controls the world
transform. Besides the facts that we now work in 3D space and we treat
xz
as the
horizontal plane, all concepts discussed in Chapter 11 generalize to 3D space.
Search WWH ::
Custom Search