next up previous contents
Next: 3.4.1 Greedy Tri-stripping Up: 3 Modeling Previous: 3.3.2 Smooth Shading   Contents

3.4 Triangle-stripping

One of the simplest ways to speed up an OpenGL program while simultaneously saving storage space is to convert independent triangles or polygons into triangle strips. If the model is generated directly from NURBS data or from some other regular geometry, it is quite straightforward to connect the triangles together into longer strips. You must keep in mind whether you want the first triangle to start off with a clockwise or counterclockwise winding, then all subsequent triangles in the list will alternate winding (see Figure 8). Triangle fans must also be started with the correct winding, but all subsequent triangles are wound in the same direction (see Figure 9).


% latex2html id marker 1471
\fbox{\begin{tabular}{c}
\vrule width 0pt height 0.1...
...}{p{5.7in}}{\small Figure \thefigure . Triangle Strip Winding}\\
\end{tabular}}


% latex2html id marker 1477
\fbox{\begin{tabular}{c}
\vrule width 0pt height 0.1...
...{1}{p{5.7in}}{\small Figure \thefigure . Triangle Fan Winding}\\
\end{tabular}}

Because OpenGL does not have a way to specify generalized triangle strips, the user must choose between GL_ TRIANGLE_STRIP and GL_ TRIANGLE_FAN. In general, more triangles can be placed into a strip than a fan. Triangle fans are great when a large convex polygon needs to be converted to triangles or for geometry that is cone-shaped. Most other cases are best converted to triangle strips.

For regular meshes, triangle strips should be lined up side by side as shown in Figure 10. The goal here is to minimize the number of total strips and try to avoid ``orphan'' triangles (also known as singleton strips) that ca not be made part of a longer strip. It is possible to turn a corner in a triangle strip by using redundant vertices and degenerate triangles as described in [29].


% latex2html id marker 1497
\fbox{\begin{tabular}{c}
\vrule width 0pt height 0.1...
...igure \thefigure . A Mesh Made up of Multiple Triangle Strips}\\
\end{tabular}}



Subsections
next up previous contents
Next: 3.4.1 Greedy Tri-stripping Up: 3 Modeling Previous: 3.3.2 Smooth Shading   Contents
2001-01-10