Game Development Reference
In-Depth Information
3.2.2
Object Space
Object space is the coordinate space associated with a particular object.
Every object has its own independent object space. When an object moves
or changes orientation, the object coordinate space associated with that
object is carried along with it, so it moves or changes orientation too. For
example, we all carry our own personal coordinate system around with us.
If we were to ask you to “take one step forward,” we are giving you an
instruction in your object space. (Please forgive us for referring to you as
an object—you know what we mean.) We have no idea which way you will
move in absolute terms. Some of you will move north, some south, and
those wearing magnet boots on the side of a building might move upward!
Concepts such as “forward,” “back,” “left,” and “right” are meaningful
in object coordinate space. When someone gives you driving directions,
sometimes you will be told to “turn left” and other times you will be told
to “go east.” “Turn left” is a concept that is expressed in object space, and
“go east” is expressed in world space.
Locations as well as directions can be specified in object space. For
example, if I asked you where the mu er on your car was, you wouldn't
tell me “Cambridge, 1 MA,” even if you were Tom or Ray Magliozzi and
your car was actually in Cambridge. In this case, an answer expressed with
a global perspective like this is totally useless; 2 I want you to express the
location of your mu er in the object space of your car.
In the context of graphics, object space is also known as model space,
since the coordinates for the vertices of a model are expressed in model
space. Object space is also known as body space, especially in physics con-
texts. It's also common to use a phrase like “with respect to the body axes,”
which means the same thing as “expressed using body space coordinates.”
3.2.3 Camera Space
One especially important example of an object space is camera space, which
is the object space associated with the viewpoint used for rendering. In
camera space, the camera is at the origin, with +x pointing to the right,
+z pointing forward (into the screen, the direction the camera is facing),
and +y pointing “up.” (Not “up” with respect to the world, “up” with
respect to the top of the camera.) Figure 3.1 shows a diagram of camera
space.
These are the traditional left-handed conventions; others are common.
In particular, the OpenGL tradition is right-handed, with −z pointing into
the screen and +z coming out of the screen towards the viewer.
1 Our fair city.
2 Come to think of it, this is exactly what Tom or Ray Magliozzi would say.
Search WWH ::




Custom Search