Re: [PyOpenGL-Users] Depth problem
Brought to you by:
mcfletch
From: George P. <gp...@ti...> - 2008-04-17 19:00:47
|
Prashant, glClearDepth() doesn't do what you think it does. Prashant Saxena wrote: > I am creating a 2D application using pyOpenGL. Here is the init function: > glClearColor(0.5, 0.5, 0.5, 0.0) This means, "when you clear the color buffer, make it all gray". > glClearDepth(1.0) > # Enables Clearing Of The Depth Buffer No. This means, "when you clear the depth buffer, make it all 1.0". > Everything I am drawing with 'z' less the 1.0 is visible. Because its z is less than the z value already in the depth buffer (1.0). > If I am > drawing something where 'z' is greater then 1.0 it's not visible. Because its z is greater than the z value already in the depth buffer (1.0), so why bother drawing it? Call glClearDepth() with a more reasonable value (i.e. one that's greater than the depth you'll be drawing anything at) and you should be fine. --George Paci <gp...@ti...> Most software wakes up each day with a fresh case of amnesia. Unfortunately, software that doesn't learn from history dooms users to repeat it. --Bret Victor |