Chapter 6 -- Rendering 3D Primitives

[Previous] [Next]

Chapter 6

Now that you've learned how to set up a 3D environment with Microsoft Direct3D Immediate Mode, you can add the last key piece of the puzzle: creating a 3D object and rendering it. In Chapter 5, you saw all the vertex types available in Direct3D. You also saw how you can allocate the memory for vertices yourself or use vertex buffers to manage this memory for you. In this chapter, you'll use these vertices to create what's known as a 3D primitive.

A 3D primitive is an object composed of a group of vertices. The most basic primitive you can create is a point list, which is nothing more than a collection of single-pixel points. You can also create and render a line list, which is a collection of 1-pixel-thick lines. Usually, however, you create 3D primitives that are triangles. Direct3D uses triangles (rather than another kind of polygon) to describe the faces of 3D objects because triangles are always coplanar and convex (which means that they are easy to render quickly). Direct3D lets you combine triangles to create more complex polygons and meshes. By using large numbers of triangles, you can approximate curved surfaces such as spheres.



Inside Direct3D
Inside Direct3D (Dv-Mps Inside)
ISBN: 0735606137
EAN: 2147483647
Year: 1999
Pages: 131

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