Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Metal Typhoon

What are triangle strips ??

This topic is 5826 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 ]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 ]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!