PDA

View Full Version : Shading problem with GL_POLYGON..



spidy
11-01-2000, 11:34 PM
I trying to implement 3D map with geographic data. These data were consist of
a large number of vertices, irregularly. So I wrote drawing mode 'glBegin(GL_POLYGON)'
and rendering scene was fine.

But when I filled these polygons for shading, it happened incorrectly result.
I show you some case..

http://my.netian.com/~spidy/images/opengl/before_fill.jpgbefore filling
http://my.netian.com/~spidy/images/opengl/after_fill.jpgafter filling

I think OpenGL renderer designed to optimize, so it fill with winding in outline
for optimization. Is this right? If I fault, tell me good idea this problem.
How can I solve this problem?


[This message has been edited by spidy (edited 11-02-2000).]

[This message has been edited by spidy (edited 11-02-2000).]

[This message has been edited by spidy (edited 11-02-2000).]

jc
11-01-2000, 11:59 PM
Hum hum, am i still sleeping or did you forgot something in this post http://www.opengl.org/discussion_boards/ubb/wink.gif

jc
11-02-2000, 02:27 AM
Ooooops, i was sleeping :

Relic
11-02-2000, 02:54 AM
GL_POLYGON is only specified for convex polygons. Yours is concave.
Have a look at the glu-functions, there should be tesselators in it.