Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Up until this point, we have always defined lists of triangles, where each triangle has its own set of vertices. We have actually only ever drawn a single triangle, but adding more would not have been a big deal.
There are cases, however, where two or more triangles can share some vertices. Let's think about how we'd render a rectangle with our current knowledge. We'd simply define two triangles that would have two vertices with the same positions, colors, and texture coordinates. We can do better. Figure 7–14 shows the old way and the new way of rendering a rectangle.
Figure 7–14. Rendering a rectangle as two triangles with six vertices (left), and rendering it with four vertices (right)