Display .obj files that are not all triangles or quads

I understand that in order to get the obj file into the correct vertex format / index for OpenGL, there must be some kind of index mask, but consider the following .obj file:

# WaveFront *.obj file (generated by CINEMA 4D) g Polygon v -136.714894 0 -169.395745 v 134.53617 0 -224.953191 v 321.906383 0 -87.693617 v 358.944681 0 182.468085 v 49.565957 0 264.170213 v -340.425532 0 165.038298 f 6 5 4 3 2 1 

The face is not a triangle or an ATV, does this mean that I will need to do something like tessellation on a processor or gpu? Will this be the standard method for working with this type of geometry description?

EDIT: Also, is there a library that will perform triangulation that is not limited to a license?

+4
source share
2 answers

We hope that they are planar polygons and triangulation using your preferred method.

If they are not flat, you can leave with the PCA by dropping the measurement and triangulating the result.

+2
source

It depends on your landfill. OpenGL has a function for drawing polygons, not quads or tris or stripes, etc. However, the polygon must be a convex polygon. Otherwise, you will need tessellate.

If you use a fixed function, this is "glBegin (GL_POLYGON)"

0
source

All Articles