Game Development Reference
In-Depth Information
All graphics libraries have some way to specify the lists of triangles we want the
graphics card to render. We then must also provide further information regarding
how we want these list of triangles to be drawn, which is what the rest of this
chapter covers.
Coordinate Spaces
A coordinate space provides a frame of reference to a particular scene. For ex-
ample, in the Cartesian coordinate space, the origin is known to be in the center of
theworld,andpositionsarerelativetothatcenter.Inasimilarmanner,therecanbe
other coordinate spaces relative to different origins. In the 3D rendering pipeline,
we must travel through four primary coordinate spaces in order to display a 3D
model on a 2D monitor:
Model
World
View/camera
Projection
Model Space
When a model is created, whether procedurally or in a program such as Maya, all
the vertices of the model are expressed relative to the origin of that model. Model
space is this coordinate space that's relative to the model itself. In model space,
the origin quite often is in the center of the model—or in the case of a humanoid,
between its feet. That's because it makes it easier to manipulate the object if its
origin is centered.
Now suppose there are 100 different objects in a particular game's level. If the
game loaded up the models and just drew them at their model space coordinates,
what would happen? Well, because every model was created at the origin in model
space, every single object, including the player, would be at the origin too! That's
not going to be a particularly interesting level. In order for this level to load prop-
erly, we need another coordinate system.
World Space
This new coordinate system is known as world space . In world space, there is an
origin for the world as a whole, and every object has a position and orientation re-
lative to that world origin.
Search WWH ::




Custom Search