5.2 Model Representation
A solid 3D object is represented by a triangle mesh approximation, and consequently, triangles form the basic building blocks of the objects we model. As Figure 5.7 implies, we can approximate any real-world 3D object by a triangle mesh. Generally speaking, the greater the triangle density of the mesh, the better the approximation. Of course, the more triangles we use, the more processing power is required, so a balance must be made based on the hardware power of the application’s target audience. In addition to triangles, it is sometimes useful to draw lines or points. For example, a curve could be graphically drawn by a sequence of short line segments one pixel thick.
Figure 5.7: (Left) A car approximated by a relatively low-density triangle mesh. (Right) A skull approximated by a higher density triangle mesh.
The large number of triangles used in Figure 5.7 makes one thing clear: It would be extremely cumbersome to manually list the triangles of a 3D model. For all but the simplest models, special 3D applications called 3D modelers are used to generate and manipulate 3D objects. These modelers allow the user to build complex and realistic meshes in a visual and interactive environment with a rich tool set, thereby making the entire modeling process much easier. Examples of popular modelers used for game development are 3ds Max (http://www.autodesk.com/3dsmax), LightWave 3D (http://www.newtek.com/lightwave/), Maya (http://www.autodesk.com/maya), and Softimage | XSI (www.softimage.com). Nevertheless, for Part II of this book, we will generate our 3D models manually by hand or via a mathematical formula (the triangle list for cylinders and spheres, for example, can easily be generated with parametric formulas). In Part III of this book, we show how to load and display 3D models exported from 3D modeling programs.

浙公网安备 33010602011771号