Log in or register to post comments

Why my model has some empty triangle ?

June 25, 2012 - 8:35pm #1

Hi?after I use the "obj2opengl.pl" to convert the ".obj" file to ".h" file,I use the ".h" file to build my model with an UV image,but when the model appear,I see some empty triangle on it,and the location of the UV image has any wrong here.How can I solve it?any one could answer me? Thank you very much!

This has always been a

December 18, 2012 - 1:54am #5

This has always been a complex subject; in fact, every modeling package (3DS, Maya, Blender, etc.) has its own export tips and tricks;

when it comes to OpenGL rendering issues, we can just recommend a few general guidelines:

- make sure that your export options produce "triangulated" meshes, i.e. meshes made up of triangles, as quads and polygons are not renderable with OpenGL ES;

- if possible, enforce a counterclock-wise (CCW) order for vertices in a triangle (as CCW is the default "front-face" assumption in OpenGL when you enable culling)

- if the mesh presents holes (i.e. missing triangles) , try and disable the OpenGL face culling  ( glDisable(GL_CULL_FACE) )

- in general you can control "back-face" versus "front-face" culling using one of these: glCullFace( GL_FRONT ) or glCullFace( GL_BACK)

- if you want to invert the "front-face" settings from CCW to CW (or vice versa ) use glFrontFace ( GL_CW ) or glFrontFace (GL_CCW );



I don't know exactly what's

December 17, 2012 - 9:50am #4

I don't know exactly what's causing it, but I get the same issue.  In my case, I can make some models (for example, the banana model included in the demo of the script) "look" correct by turning off backface culling.  Using only depth testing is more processor-intensive, to my knowledge, but it does appear correct for some models.  Anyhow, this means that there's some kind of winding issue.

In other models, this is inadequate to correct whatever is not working, and that leaves me at a loss to guess what the issue is.

Why my model has some empty triangle ?

June 25, 2012 - 9:14pm #3


I think it happened during the "exported" step  and it may have contract with some option when I export the model.

I use "3dmax" to export my model,I got any wrong here?what the detail step about "export"? could you tell me how to do it?thanks a lot.

Why my model has some empty triangle ?

June 25, 2012 - 8:39pm #2

Typically "missing" faces are caused by non-triangulated models, models exported with triangle strips (but rendered with GL_TRIANGLES), or models exported with some triangles winding the wrong way (CW vs. CCW). Try turning culling off to see if it's the last one: glDisable(GL_CULL_FACE)

Log in or register to post comments