Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 472
Derick F Avatar asked Feb 05 '12 05:02

Derick F


1 Answers

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.

like image 64
Nicol Bolas Avatar answered Oct 11 '22 13:10

Nicol Bolas