OpenGL and concave meshes

Apprentice
Posts: 6
Joined: 2009.11
Post: #1
hey
I am constantly running in to a very annoying problem and I was wondering if anyone knew how to combat it. For the longest while I've been trying to draw concave meshes with OpenGL and can't seem to get it done right because OpenGL always draws the mesh with a polygon right across the concave part of the mesh, so if anyone knows how to solve this problem please post it here.
Thanks in advance.
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #2
Concave *meshes* aren't an issue. You mean you're trying to draw concave polygons? That is not possible. For concave polygons you'll need to tessellate them. gluTess works great for that.
Quote this message in a reply
Apprentice
Posts: 6
Joined: 2009.11
Post: #3
No, seriously I mean concave meshes. For instance I've tried drawing a compass (as in the mathematical instrument), but when it get drawn on the screen a polygon goes right across the legs of the compass. The only thing that I suspected is that OpenGL probably loops the mesh and draws a polygon across the first and last vertices.
But thanks for the advice anyway because I didn't know I could draw concave meshesGrin
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #4
Ashford Wrote:The only thing that I suspected is that OpenGL probably loops the mesh and draws a polygon across the first and last vertices.

No, it won't loop when drawing triangles. You're either loading the model incorrectly, and/or you're sending the wrong info to OpenGL: e.g. wrong number of indices [which would be my most likely guess], or wrong base address, etc. It should draw any mesh just fine, as long as all the faces match the primitive you specify. If you're specifying GL_POLYGON, those polygons have to be convex.

[edit] It could also be that the model file is corrupt or incorrect.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Breaking down a concave mesh into convex pieces Willem 5 4,842 Aug 10, 2008 05:49 AM
Last Post: Willem
  Calculating tangent coords for arbitrary poly meshes TomorrowPlusX 8 5,841 Jul 9, 2007 03:10 PM
Last Post: Hog
  Indexed Face Sets (meshes) wyrmmage 4 4,264 Dec 15, 2006 11:18 AM
Last Post: wyrmmage
  Texture mapping meshes wyrmmage 9 4,794 Nov 30, 2006 08:45 PM
Last Post: OneSadCookie
  Will VBOs be faster than display lists for simple meshes? TomorrowPlusX 14 6,061 Nov 30, 2004 03:32 PM
Last Post: arekkusu