GL_TRIANGLE 风扇说明 [英] GL_TRIANGLE FAN Explanation
问题描述
我正在尝试填充"我在此处使用此算法绘制的球体的表面:http://paulbourke.net/miscellaneous/sphere_ cylinder/,第一种方法.我知道 GL_QUADS
在 OpenGL 3+ 中不再使用.所以我使用了 GL_TRIANGLE_FAN
.它是一样的吗?这里的问题是我的球面是正方形.所以如果我使用 GL_TRIANGLE
然后我会得到一个奇怪的填充",并不是所有的表面都被覆盖了.我做错了吗?GL_TRIANGLE_FAN
究竟是如何工作的?
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?
推荐答案
GL_TRIANGLE_FAN 究竟是如何工作的?
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.
这篇关于GL_TRIANGLE 风扇说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!