Black Spots

Started by
4 comments, last by GameDev.net 18 years, 8 months ago
Hello, i recently implemented a polygonization algorithm in order to render an implicit surface in opengl. This algorithm returns three vertices each time it computes a valid polygon, and using GL_TRIANGLES I try to render them. However, I get black spots in my model. I am enabling lights, giving each vertex a normal normalized according to the gradient of the surface in that point, checking the vertex order according to the right hand rule, but I can't remove these spots yet. Also, when I change the location of the viewer with gluLookAt using the arrow keys I observe that some polygons that had been rendered well now become black spots, and viceversa. What's wrong? I hope someone can help me.
Advertisement
Can you post a screen shot of what it looks like?
The result I get looks like this:

http://www.angelfire.com/trek/xero0/poly.JPG
could it have anything to do with not clearing the z-buffer properly, I know I had similar looking problems in directX
thanks... I added the following line and the black spots were removed

glEnable(GL_CULL_FACE);
That will work for a simple convex models (a sphere) but may break for complex models.

Check if you are enabling the depth buffer
glEnable(GL_DEPTH_TEST);

and if your window has depth buffer support.

-- Steven Ashley

This topic is closed to new replies.

Advertisement