Making a Mesh
Triangles are to a graphics developer as clay is to a sculptor. Clay is physical and yields to our hands. Triangles are virtual and yield to math. In our software, we push, twist, and stretch triangles into complex and interesting models using two complementary techniques:
- procedural modeling using algorithms
- direct manipulation using the mouse
Most models in games are made by professional 3D artists using direct manipulation tools like 3ds Max, Maya, and Blender. Software developers import these models. But sometimes the developers get to make models themselves by writing code. Models made in either manner are represented in graphics programs using a data structure we'll call a triangle mesh or a trimesh. Some algorithms expect quadrilateral meshes or quadmeshes, but we will stick with trimeshes.
In this chapter, we'll explore both generating models directly in our own programs and importing models made in 3D modeling programs. By its end, you'll be able to answer the following questions:
After working through the exercises ahead, we'll be able to render models that are too much to type in by hand. In the succeeding chapters, we'll learn how to arrange them in space and illuminate them.