View Full Version : how to draw wireframe polygon
cjren
01-21-2010, 05:16 AM
hello,
i have a mesh with triangles and quads and polygons, in order to render the edges of the mesh, i need to render polygons (so do not convert to all triangles) and i konw the way using glBegin(GL_POLYGON).
but how it can be done with glDrawElements or even the vbo??
thank you very much.
_x57_
01-21-2010, 05:36 AM
Do you have any specific problems using vbo / glDrawElements ?
GL_POLYGONs can also be rendered using vbo, just pass GL_POLYGON as parameter to glDrawArrays / glDrawElements ...
For using vbo in general there are plenty of tutorials - just google.
cjren
01-21-2010, 07:23 AM
for example, the mesh has a triangle, a quad and a polygon, do i need to :
glDrawElements(GL_TRIANGLE, .... tri_index);
glDrawElements(GL_TRIANGLE, .... quad_index);
glDrawElements(GL_TRIANGLE, .... poly_index);
?
Dark Photon
01-24-2010, 12:55 PM
hello,
i have a mesh with triangles and quads and polygons, in order to render the edges of the mesh, i need to render polygons (so do not convert to all triangles) and i konw the way using glBegin(GL_POLYGON).
but how it can be done with glDrawElements or even the vbo??
What do you see as the problem in using glDrawElements or VBOs?
Also, I'm assuming you've tried this:
glPolygonMode ( GL_FRONT_AND_BACK, GL_LINE ) ;
?? This may be what you want -- unclear. You wouldn't do this if you wanted to suppress some of the triangle edges in your wireframe rendering.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.