PDA

View Full Version : Problems with culling



aptt
09-23-2005, 12:41 AM
I get a strange behaviour using culling.
The piece of code below, print out a triangle drawn as points.
Why ???


...
glFrontFace(GL_CW);
glPolygonMode(GL_FRONT, GL_LINE);
glPolygonMode(GL_BACK, GL_FILL);
glCullFace(GL_FRONT);
glEnable(GL_CULL_FACE);
...
glBegin(GL_POLYGON);
glVertex2f(100, 200);
glVertex2f(200, 100);
glVertex2f(350, 350);
glEnd();
...Thanks in advance.

aptt

Vexator
09-23-2005, 02:09 AM
what are you trying to do?! if you want to cull back faces, why are you setting the polygon mode for them and why do you set the cull mode to cull front faces?! btw usually you want counter-clockwise polygons to be the front faces.

http://www.mevis.de/opengl/glPolygonMode.html
http://www.mevis.de/opengl/glCullFace.html

aptt
09-23-2005, 02:46 AM
Originally posted by Vexator:
what are you trying to do?! if you want to cull back faces, why are you setting the polygon mode for them and why do you set the cull mode to cull front faces?! btw usually you want counter-clockwise polygons to be the front faces.

http://www.mevis.de/opengl/glPolygonMode.html
http://www.mevis.de/opengl/glCullFace.html I know what those routines do and the program has no a specific goal, I'm just trying to see what happen.

Theoretically in this example, the triangle could be drawn filled, lined or not drawn at all (depends on Cullface and FrontFace).

With the source above, I get points.
Why ???