Game Development Reference
In-Depth Information
Figure 8-10. The plain quad mesh passes through a pre-processing stage that generates the triangle mesh that's going
to be used for display.
Table 8-1. Difference in Data Volume of the Two Grid Models
No. of faces
No. of vertices
Size of model file
Input quad mesh
384
386
16.7 KB
Output triangle mesh with holes
2300
1536
127 KB
For the remainder of the chapter, I will refer to the original quad mesh of the grid as the “grid mesh” and
the triangle mesh that has holes as the “grid model.” The grid mesh is used intensively for the various
calculations that make the game mechanics work. The grid model is used only for display on the 3D view.
You may wonder at this point about the origin of the grid meshes used in the game levels. How were they
produced? Before starting work on the game, I wrote a little C++ program that takes as input a definition of
a simple quad mesh—say a cube with six faces—and performs a Catmul-Clark subdivision on it. This
algorithm takes every face of the mesh and subdivides it into smaller and “smoother” faces. With repeated
iterations of the process, the mesh becomes denser and smoother. The tool I wrote is called “KawaiiGL”
and it is available as open source at http://sourceforge.net/projects/kawaiigl/ .
Another, more conventional, way to create geometric models is by simply using one of the many available
3D-modelling applications out there, such as Maya, 3ds Max, or LightWave 3D. I did not make use of
these tools for creating geometry for CycleBlob, however, since I have little experience working with them.
 
Search WWH ::




Custom Search