Graphics Reference
In-Depth Information
GL_TRIANGLE_FAN also draws a series of connected triangles. In the
example shown in Figure 7-1, the triangles drawn are (v 0 , v 1 , v 2 ), (v 0 , v 2 , v 3 ),
and (v 0 , v 3 , v 4 ). A total of (n-2) triangles are drawn, where n is the number
of indices specified as count in glDraw*** APIs.
Lines
The line primitives supported by OpenGL ES are GL_LINES , GL_LINE_STRIP ,
and GL_LINE_LOOP . Figure 7-2 shows examples of supported line primitive
types.
v 3
v 1
v 1
v 4
v 3
v 0
v 5
v 0
v 2
GL_LINE_STRIP
v 2
v 1
v 3
GL_LINES
v 2
v 0
v 4
GL_LINE_LOOP
Figure 7-2
Line Primitive Types
GL_LINES draws a series of unconnected line segments. In the example
shown in Figure 7-2, three individual lines are drawn given by (v 0 , v 1 ),
(v 2 , v 3 ), and (v 4 , v 5 ). A total of n/2 segments are drawn, where n is the
number of indices specified as count in glDraw*** APIs.
GL_LINE_STRIP draws a series of connected line segments. In the example
shown in Figure 7-2, three line segments are drawn given by (v 0 , v 1 ),
(v l , v 2 ), and (v 2 , v 3 ). A total of (n-1) line segments are drawn, where n is
the number of indices specified as count in glDraw*** APIs.
GL_LINE_LOOP works similar to GL_LINE_STRIP , except that a final line
segment is drawn from v n-1 to v 0 . In the example shown in Figure 7-2,
the line segments drawn are (v 0 , v 1 ), (v 1 , v 2 ), (v 2 , v 3 ), (v 3 , v 4 ), and (v 4 , v 0 ).
A total of n line segments are drawn, where n is the number of indices
specified as count in glDraw*** APIs.
 
 
Search WWH ::




Custom Search