Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411654 Posts in 69395 Topics- by 58451 Members - Latest Member: Monkey Nuts

May 15, 2024, 11:46:40 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)GL_POLYGON "skipping" vertices
Pages: [1]
Print
Author Topic: GL_POLYGON "skipping" vertices  (Read 2109 times)
Gagege
Level 1
*



View Profile WWW
« on: May 25, 2010, 10:05:40 AM »

Here's a video of my game:




I'm have a problem with it though. Sometimes my GL_POLYGON will "skip" a vertex and just draw a straight line between the previous and next vertex. At the very beginning of the video if you look near the lowest vertex of the blue polygon you can see how the color blue is spilling outside of the polygon's outline. It usually happens when the vertex is "inside" the polygon. Where it should be a concave part of the polygon it just flattens it out, but only sometimes.
 
Question:
Has anyone else has had problems with openGL "skipping" vertices? If so, do you know what's causing it or how I can fix it?
Logged

blog
Soli Deo Gloria
mcc
Level 10
*****


glitch


View Profile WWW
« Reply #1 on: May 25, 2010, 10:09:21 AM »

GL_POLYGON only supports convex polygons. Period.
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
muku
Level 10
*****


View Profile
« Reply #2 on: May 25, 2010, 10:09:37 AM »

I think GL_POLYGON supports only convex polygons.

EDIT: Haha that was close
Logged
Polly
Level 6
*



View Profile
« Reply #3 on: May 25, 2010, 10:15:59 AM »

Solution : Triangulate concave polygons.
Logged
Gagege
Level 1
*



View Profile WWW
« Reply #4 on: May 25, 2010, 10:18:22 AM »

Then how am I able to have a concave part elsewhere in my polygon?

Am I wrong to think that the blue polygon (in the video) is somewhat concave on the bottom?
« Last Edit: May 25, 2010, 10:25:55 AM by Gagege » Logged

blog
Soli Deo Gloria
muku
Level 10
*****


View Profile
« Reply #5 on: May 25, 2010, 10:27:11 AM »

Then how am I able to have a concave part elsewhere in my polygon?

The spec doesn't guarantee that GL_POLYGON will fail with concave polygons, it just doesn't guarantee that it will work Wink

GLU seems to have a tesselator, check this out: http://www.flipcode.com/archives/Polygon_Tessellation_In_OpenGL.shtml
Logged
Gagege
Level 1
*



View Profile WWW
« Reply #6 on: May 25, 2010, 10:30:05 AM »

Got it. Thank you guys.
I guess i'll just have to look for another solution.
Thanks for the tip muku.
Logged

blog
Soli Deo Gloria
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic