to 3D graphics, all of which stem from the lack of a formal model for displaying arbitrary 3D data
realistically on a 2D screen.
Chapter 5 solves the problems of Chapter 4 by developing the mathematical formulas neces-
sary for specifying and projecting arbitrary 3D points onto a 2D plane. We redevelop the example
3D program in a more general, mathematically correct way. We also cover 3D coordinate systems,
3D points, 3D vectors, and operations on 3D vectors. Furthermore, we see how to use point pro-
jection to project entire polygons from 3D into 2D, thereby creating 3D polygonal graphics.
Library classes are developed for all of these concepts.
Chapter 6 serves a number of purposes. First, it explains the idea of transformations as a
manipulation of a 3D point. Second, it justifies the use of matrices to store transformations. Matrix
math can generate a certain aura of mystique or skepticism for new 3D programmers or for those
unfamiliar with the use of matrices in graphics. The justification for matrices is followed by a
series of C++ classes which implement the necessary matrix operations. The chapter then shows
the matrix form of three important transformations: translation, rotation, and scaling of a 3D point.
We demonstrate the power of combining transformations through three practical examples: speci-
fication of an arbitrary camera location and orientation, rotation about an arbitrary axis
(sometimes called “Descent-style” camera rotation, in honor of one of the first PC games incorpo-
rating this technique in real time), and local rotation and scaling. We also discuss some of the
general properties of matrices which are useful for 3D graphics.
Chapter 7 justifies and implements the use of 3D polygons to model individual 3D objects and
entire 3D worlds in computer memory. We also look at basic hidden surface removal, which
allows for a correct display of complex polygonal objects. We discuss how to clip objects against
arbitrary planes in 3D, which is needed for some advanced visible surface determination algo-
rithms covered in the Advanced volume. All of these techniques are implemented in C++ classes.
Chapter 8 introduces Blender, a free and powerful 3D modeling and animation package for
Linux (included on the CD-ROM). The information in the previous chapters gives us the code to
create visually realistic polygonal 3D images, but we still need interesting 3D data to display. Cre-
ating this data is the role of a 3D modeler. We review the extensive features of Blender and then
create, step by step, a basic spaceship model. This 3D model is then imported and displayed in a
3D program.
Chapter 9 briefly introduces a number of advanced topics, all covered in the Advanced vol-
ume. These topics include 3D morphing, more advanced algorithms for visible surface
determination (portals, BSP trees), texture mapping, lighting and light mapping, special visual
effects (particle systems, billboards), and non-graphical elements often used in interactive 3D
graphics programs (collision detection, sound, Newtonian physics).
The Appendix provides installation instructions for the CD-ROM, an explanation of
fixed-point math, information on porting the graphics code to Windows, and a list of useful refer-
ences, both in electronic (WWW) and in print form. Notations in brackets, such as [MEYE97], are
detailed in the “References” section of the Appendix.
The CD-ROM contains the Linux operating system, C++ software development tools, freely
available Linux 3D libraries and applications, the Blender 3D modeling and animation suite, all
sample code from the book, and a series of animated videos illustrating some of the more diffi-
cult-to-visualize 3D concepts discussed in the text (such as the transformation from world space to
Introduction xxi