6
votes

I'm using LWJGL. I'm trying to create a simple 3D map using GL_TRIANGLE_STRIP and it works fine. But now OpenGL automatically fills up every triangle. I was wondering if it is possible for OpenGL to only draw the outlines of each triangle. This way I have a better view on what I'm doing.

1

1 Answers

8
votes

You can use glPolygonMode() to disable fills on front and backward facing geometry:

// enable wireframe
glPolygonMode( GL_FRONT, GL_LINE );

// draw stuff to be wireframe'd
DrawStuff();

// restore regular rendering
glPolygonMode( GL_FRONT, GL_FILL );