View Full Version : Polygon doesn't fill up properly

03-26-2005, 11:33 AM

i'm new to OpenGL..and i'm facing this problem.

on the Y-axis, instead of a surface, i get a bee-hive type of structure..
eg. http://www.ntu.edu.sg/home2003/tayc0003/angle.jpg
the object looks fine from the other axis though

my source code (http://http://www.ntu.edu.sg/home2003/tayc0003/sample.c)

please advise.

03-26-2005, 12:07 PM
You don't ask for a depth buffer when initializing the window.

03-26-2005, 08:30 PM
so, instead of putting it in the init part, where should it be done? before each draw?

03-26-2005, 10:59 PM
you are doing pretty cool stuff, for beeing new to openGL. What book do you use?

03-27-2005, 04:18 AM
Add GL_DEPTH in glutInitDisplayMode. Just like you ask for an RGB color buffer, and just like you ask for a double buffer, you must ask for a depth buffer aswell.

Since you don't ask for the depth buffer, you don't get one. And if you don't have a depth buffer, depth testing doesn't work.

03-27-2005, 05:07 AM
Managed to figure out the problem already. It was the way i plotted the points for the polygon mesh.

the old way i did, plotted the points from the inside to outer surface resulting in the beehive..