Using These 3D Points


Whether you realized it or not, the models you were loading in the Blockers game had many of these points built into the .x files you were loading. Each point in 3D space can be called a vertex, and if you group three of these vertices together, you can create a triangle. As mentioned earlier, the triangle is the building block for all 3D render-able objects. Triangles are used as the primitive type for all 3D objects because they are the simplest polygons possible that are guaranteed to be coplanar (or all on the same plane). Using these objects as the primitives allows the math to be more efficient than worrying about noncoplanar points. For this chapter (and book), it isn't important to understand this point in depth, so let's continue.

Now that you understand that all 3D objects consist of triangles, it's important to visualize it. You remember seeing the character Loopy bounce around the screen in the Blockers game, but did you realize that he is nothing more than a series of triangles stitched together to appear as a solid object? See Figure 10.4 for a view of Loopy as he really is.

Figure 10.4. The real Loopy.


As you can see, the character is nothing but a series of triangles. Any time you see some complex 3D world and wonder how it's all generated, for the most part, there's your answer. Any object, no matter how complex, can be approximated using enough triangles.



Beginning 3D Game Programming
Beginning 3D Game Programming
ISBN: 0672326612
EAN: 2147483647
Year: 2003
Pages: 191
Authors: Tom Miller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net