Game Development Reference
In-Depth Information
evant ones. Furthermore, any data provided by sensors would be expressed
in object space. Of course, our own bodies work under similar principles.
All of us are capable of seeing a tasty morsel in front of us and putting it
into our mouths without knowing which direction is “north.” (And thank
goodness, too, or many of us would starve to death.)
Further, suppose that we wish to render an image of the robot picking
up the sandwich, and that the scene is illuminated by the light mounted on
her shoulder. We know the position of the light within the robot's object
space, but to properly light the scene, we must know the position of the
light in world space.
These problems are two sides of the same coin: we know how to express
a point in one coordinate space, and we need to express that point in
some other coordinate space. The technical term for this computation
is a coordinate space transformation. We need to transform the position
from world space to object space (in the example of the sandwich) or from
object space to world space (in the example of the light). Notice that in
this example, neither the sandwich nor the light really move, we are just
expressing their locations in a different coordinate space.
The remainder of this section describes how to perform coordinate space
transformations. Because this topic has such fundamental importance, and
it can be so darn confusing, please allow us to present a very gradual tran-
sition from the warm fluffy high level to the cold hard math. Section 3.3.1
considers transformations in the very context they are often encountered for
beginning video game programmers: graphics. Using the most ridiculous
example we could think of, we show the basic need of transformations, and
also demonstrate the duality between two useful ways of visualizing trans-
formations. Section 3.3.2 makes sure we are clear about what it means to
specify a coordinate space in terms of another space. Finally, Section 3.3.3
presents the key idea of basis vectors.
3.3.1
Dual Perspectives
In our robot example, the discussion was phrased in a way such that the
process of transforming a point didn't really “move” the point, we just
changed our frame of reference and were able to describe the point using
a different coordinate space. In fact, you might say that we really didn't
transform the point, we transformed the coordinate space! But there's
another way of looking at coordinate space transformations. Some people
find it easier in certain situations to imagine the coordinate space staying
still while the point moves from one place to another. When we develop the
math for actually calculating these transformations, this is the paradigm
that is more natural. Coordinate space transforms are such an important
tool, and the confusion that can arise because of an incomplete awareness
 
Search WWH ::




Custom Search