PDA

View Full Version : Polygon Bugs



shep
01-28-2001, 10:37 AM
My OGL scene is bugged, I am rendering a box, but the rear and side polygons are overriding the front polygon.

Any ideas what can cause this?

Leyder Dylan
01-28-2001, 10:56 AM
Can I see the source code ?

Julio
01-28-2001, 12:18 PM
Are you sending the vertices to OpenGL in counter-clock-wise order? This may be a problem.

Osku
01-28-2001, 02:53 PM
Try enableling depth test

glEnable(DEPTH_TEST);

Osku

Deiussum
01-29-2001, 05:25 AM
Sounds like a depth test problem. If you're using glut and linux, also make sure to use GLUT_DEPTH when you call glutInit(). I got burned with that awhile back when I had depth test enabled, but the depth test didn't seem to work right.

shep
01-29-2001, 08:44 AM
I do enable depth testing, but I am not sure about the vertexes being loaded coounter-clockwise.

I copied the vertex code straight from nehe tutorial on texture mapping.

One thing though, I adopted NeHe texture mapping tutorial using QT OpenGL Module. Anyone have experiene using this module, any known problems that might cause these issues.

So far I have only tested it on Windows, it might work without issue on linux. Sigh.

Anyone all input is welcome.

Thanks.

Shep

rhmazza
01-29-2001, 09:11 AM
Hmmm... just in case you haven't, make sure to clear the depth buffer each time you render:

glClear(GL_DEPTH_BUFFER);

Humus
01-29-2001, 09:23 AM
... and don't forget glDepthFunc(GL_LESS);