147
Chapter 4 Perspective, Scene Design, and Basic Animation
To give depth, a shading effect
must be added to differentiate
between the flat surfaces on the
cube. These flat surfaces are
known as
faces.
Without this
shading effect or contrast, the
object would not be seen as a 3D
object. Instead, it would appear as
an irregular 2D shape. The same
cube in a
wireframe
view shows
the hidden edges and vertices. See
Figure 4-28.
Scaling
The 3D engine has more work to do than just render the object on the
screen. It must also move the object in a realistic manner. Remember how
an object in the distance appears smaller and darker? The 3D engine must
make the object larger and brighter as it gets closer to the viewer (the
player).
To make an object larger as the player approaches it, the 3D engine must
scale the object. To
scale
an object, its dimensions are changed in a way such
that the object remains proportional. This is done by moving the vertices of the
object farther apart or closer together at the same rate.
CHEAT CODE: WIREFRAME
Wireframe is a view showing objects
as if they are built with wire, not
opaque faces. In a wireframe view,
3D objects have visible lines on the
edges, but the faces are invisible. A view with opaque
faces is called a shaded view.
Figure 4-27.
Goodheart-Willcox Publisher
A—Without pixel shading, some of the edges are not visible. This may make the object
look 2D, not 3D. B—Compare this view to Figure 4-26B. C—In this view, the cube looks
like a square, just as in Figure 4-26C, even without pixel shading.