Game Development Reference
In-Depth Information
pots, the refrigerator, and so on—could have been made by an artist at
the center of some scene, and conceptually each undergoes its own unique
transform from object space to world space.
We discussed two useful ways of imagining coordinate space transforma-
tions. One way is to fix our perspective with the coordinate space. This is
the active transformation paradigm: the vectors and objects move around
as their coordinates change. In the passive transformation paradigm, we
keep our perspective fixed relative to the thing being transformed, making
it appear as if we are transforming the coordinate space used to measure
the coordinates. Transforming an object has the same effect on the coor-
dinates as performing the opposite transformation to the coordinate space.
Both the active and passive paradigms are quite useful, and an inadequate
appreciation of the difference between them is a common cause of mistakes.
3.3.2
Specifying Coordinate Spaces
We are almost ready to talk about transformations. But there's actually
one more basic question we should answer first: exactly how do we specify
a coordinate space relative to another coordinate space? 7 Recall from Sec-
tion 1.2.2 that a coordinate system is defined by its origin and axes. The
origin defines the position of the coordinate space, and the axes describe
its orientation. (Actually, the axes can describe other information, such as
scale and skew. For the moment, we assume that the axes are perpendic-
ular and the units used by the axes are the same as the units used by the
parent coordinate space.) So if we can find a way to describe the origin and
the axes, then we have fully documented the coordinate space.
Specifying the position of the coordinate space is straightforward. All
we have to do is describe the location of the origin. We do this just like we
do for any other point. Of course, we must express this point relative to the
parent coordinate space, not the local child space. The origin of the child
space, by definition, is always (0,0,0) when expressed in child coordinate
space. For example, consider the position of the 2D robot in Figure 3.2. To
establish a scale for the diagram, let's say the robot is around 5 1/2 feet
tall. Then the world-space coordinates of her origin are close to (4.5,1.5).
7 We imagine that if this chapter were an episode of Elmo's World, this very obvious
and important question would be the one that Elmo's goldfish, Dorothy, would have
asked right off the bat.
 
Search WWH ::




Custom Search