开发者

OpenGL: Draw lines with VBO

开发者 https://www.devze.com 2023-03-01 03:25 出处:网络
How to draw several separate lines using a sin开发者_如何学运维gle VBO?glDrawElements(GL_LINES, ..., ..., ...);In OpenGL-3.1 and later there\'s a functionality called primitive restart. It works by sp

How to draw several separate lines using a sin开发者_如何学运维gle VBO?


glDrawElements(GL_LINES, ..., ..., ...);


In OpenGL-3.1 and later there's a functionality called primitive restart. It works by specifying a special vertex array element index that causes the current primitive to be restarted. That way a single element array allows to draw several GL_LINE_STRIP, GL_LINE_LOOP, GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP, GL_QUAD_STRIP.

http://www.opengl.org/sdk/docs/man4/xhtml/glPrimitiveRestartIndex.xml

This is largely based on the NV_primitive_restart extension: http://www.opengl.org/registry/specs/NV/primitive_restart.txt

Apart from that you can use a primitive type in which vertices are not shared and blow up the element index array a bit.

0

精彩评论

暂无评论...
验证码 换一张
取 消