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?
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.
You probably need a triangle strip instead of a fan.
See also this question: gl_triangle_strip vs gl_triangle_fan
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.