What are triangle strips ??

Started by
3 comments, last by Metal Typhoon 21 years, 10 months ago
i didn't get it.. i know GL_TRIANGLES.. but what does triangle strips do ??? [edited by - Metal Typhoon on June 9, 2002 8:07:40 PM]
Metal Typhoon
Advertisement
In triangle strip mode, GL re-uses the last two vertices you passed with the new vertex you give to create a triangle.

GL_TRIANGLES :
v1 v2 v3 v4 v5 v6 -> (v1 v2 v3) (v4 v5 v6)
GL_TRIANGLE_STRIP :
v1 v2 v3 v4 v5 v6 -> (v1 v2 v3) (v2 v3 v4) (v3 v4 v5) (v4 v5 v6)
GL_TRIANGLE_FAN :
v1 v2 v3 v4 v5 v6 -> (v1 v2 v3) (v1 v2 v4) (v1 v2 v5) (v1 v2 v6)


Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Imagine bisecting a parallelogram about the diagonal to form two equilateral triangles.

Regards,
Mathematix.
quote:Original post by Fruny
...
GL_TRIANGLE_FAN :
v1 v2 v3 v4 v5 v6 -> (v1 v2 v3) (v1 v2 v4) (v1 v2 v5) (v1 v2 v6)
...



Wouldn''t that be
GL_TRIANGLE_FAN :
v1 v2 v3 v4 v5 v6 -> (v1 v2 v3) (v1 v3 v4) (v1 v4 v5) (v1 v5 v6)

I am pretty sure that this one is correct. It doesn''t keep the 2nd vertex to all the other ones it keeps the first vertex.

like this to make a circle

  glBegin(GL_TRIANGLE_FAN);   glVertex3f(0,0,0);   for (float c=0; c<=PI; c+=PI/20)      glVertex3f(cos(PI),sin(PI),0);glEnd();  


that would make a Circle with 20 polys.
"I seek knowledge and to help those who also seek it"
quote:Original post by Xero-X2
Wouldn''t that be
GL_TRIANGLE_FAN :
v1 v2 v3 v4 v5 v6 -> (v1 v2 v3) (v1 v3 v4) (v1 v4 v5) (v1 v5 v6)

I am pretty sure that this one is correct. It doesn''t keep the 2nd vertex to all the other ones it keeps the first vertex.


Yes, you are right, my mistake.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan

This topic is closed to new replies.

Advertisement