Game Development Reference
In-Depth Information
Thus, in the special circumstance of an orthonormal basis, we have a simple
way to determine the body space coordinates, knowing only the world coor-
dinates of the body axes. Thus, assuming p , q , and r form an orthonormal
basis,
b x = u p ,
b y = u q ,
b z = u r .
Although our example uses body space and upright space for concreteness,
these are general ideas that apply to any coordinate space transformation.
Orthonormal bases are the special circumstances under which our lie
from Chapter 1 is harmless; fortunately they are extremely common. At the
beginning of this section, we mentioned that most of the coordinate spaces
we are “accustomed to” have certain properties. All of these “customary”
coordinate spaces have an orthonormal basis, and in fact they meet an even
further restriction: the coordinate space is not mirrored. That is, p × q = r ,
and the axes obey the prevailing handedness conventions (in this topic, we
use the left-hand conventions). A mirrored basis where p × q = − r can
still be an orthonormal basis.
3.4
Nested Coordinate Spaces
Each object in a 3D virtual universe has its own coordinate space—its own
origin and its axes. Its origin could be located at its center of mass, for
example. Its axes specify which directions it considers to be “up,” “right,”
and “forward” relative to its origin. A 3D model created by an artist for
a virtual world will have its origin and axes decided by the artist, and the
points that make up the polygon mesh will be relative to the object space
defined by this origin and axes. For example, the center of a sheep could
be placed at (0,0,0), the tip of its snout at (0,0,1.5), the tip if its tail
at (0,0,−1.2), and the tip of its right ear at (0.5,0.2,1.2). These are the
locations of these parts in sheep space.
The position and orientation of an object at any point in time needs
be specified in world coordinates so that we can compute the interactions
between nearby objects. To be precise, we must specify the location and
orientation of the object's axes in world coordinates. To specify the city of
Cartesia's position (see Section 1.2.1) in world space, we could state that
the origin is at longitude p o and latitude q o and that the positive x-axis
points east and the positive y-axis points north. To locate the sheep in a
virtual world, it is su cient to specify the location of its origin and the
orientation of its axes in world space. The world location of the tip of
its snout, for example, can be worked out from the relative position of its
snout to the world coordinates of its origin. But if the sheep is not actually
 
Search WWH ::




Custom Search