in a wavefront object file (.obj) how am i supposed to render faces with more than 4 vertices in opengl?

Derick F picture Derick F · Feb 5, 2012 · Viewed 7.5k times · Source

So using a Wavefront object file how am i supposed to render faces that have more than 4 vertices in OpenGL?

I understand that if it has 3 vertices I use GL_TRIANGLES, if it has 4 I use GL_QUADS, but if it has 5 or more, what am I supposed to use? Is there a standard?

Answer

Nicol Bolas picture Nicol Bolas · Feb 5, 2012

First, you should tell any exporting tool to not export faces with that many vertices. Faces should have 3 vertices, period.

If your exporting tool can't do that, then your loading tool should break the polygons down into 3 vertex faces. I'm fairly certain that the Asset Importer library can do that.