相关疑难解决方法(0)

将三角形条转换为三角形?

我正在使用GPC曲面细分库,它输出三角形条带.该示例显示如下呈现:

for (s = 0; s < tri.num_strips; s++)
{
    glBegin(GL_TRIANGLE_STRIP);
    for (v = 0; v < tri.strip[s].num_vertices; v++)
        glVertex2d(tri.strip[s].vertex[v].x, tri.strip[s].vertex[v].y);
    glEnd();
}
Run Code Online (Sandbox Code Playgroud)

问题在于这会呈现多个三角形条带.这对我来说是个问题.我的应用程序使用VBO渲染,特别是1个多边形的1个VBO.我需要一种方法来修改上面的代码,以便它可以看起来像这样:

glBegin(GL_TRIANGLES);
for (s = 0; s < tri.num_strips; s++)
{
    // How should I specify vertices here?      
}
glEnd();
Run Code Online (Sandbox Code Playgroud)

我怎么能这样做?

c c++ opengl

2
推荐指数
1
解决办法
3799
查看次数

标签 统计

c ×1

c++ ×1

opengl ×1