Graphics Reference
In-Depth Information
triangles of a triangle strip differs from the ordering of vertices that
describe odd-numbered triangles of the same strip.
Two cases need to be handled:
• The odd-numbered triangle of the first triangle strip is being
connected to the first (and therefore even-numbered) triangle of the
second triangle strip.
• The even-numbered triangle of the first triangle strip is being
connected to the first (and therefore even-numbered) triangle of the
second triangle strip.
Figure 7-5 shows two separate triangle strips that represent these two
cases, where the strips need to be connected to allow us to draw both of
them using a single call to glDrawElements* .
v 11
v 9
v 1
v 3
v 0
v 2
v 8
v 10
Opposite Vertex Order
v 11
v 9
v 1
v 3
v 4
v 2
v 8
v 10
v 0
Same Vertex Order
Figure 7-5
Connecting Triangle Strips
For the triangle strips in Figure 7-5 with opposite vertex order for the last
and first triangles of the two strips being connected, the element indices
for each triangle strip are (0, 1, 2, 3) and (8, 9, 10, 11), respectively. The
combined element index list if we were to draw both strips using one call to
glDrawElements* would be (0, 1, 2, 3, 3 , 8 , 8, 9, 10, 11). This new element
index results in the following triangles drawn: (0, 1, 2), (2, 1, 3), (2, 3, 3) ,
(3, 3, 8) , (3, 8, 8) , (8, 8, 9) , (8, 9, 10), (10, 9, 11). The triangles in boldface
Search WWH ::




Custom Search