Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
588 views
in Technique[技术] by (71.8m points)

opengl - GL_TRIANGLE FAN Explanation

I am trying to "fill" a surface of a sphere that I drew using this algorithm here: http://paulbourke.net/miscellaneous/sphere_cylinder/, the first method. I know that GL_QUADS is no longer used in OpenGL 3+. SO I used GL_TRIANGLE_FAN. Is it the same thing? The problem here is that my sphere facets are squares. So if I use GL_TRIANGLE then I get a weird "filling", not all the surface is covered. Am I doing it the wrong way? How does GL_TRIANGLE_FAN work exactly?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

How does GL_TRIANGLE_FAN works exactly?

The first vertex of a triangle fan acts like a hub. The vertices following connect with the previous non-starting vertex and the hub.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...