   Basic trouble getting GL_DEPTH_TEST to work properly.
  Hi,I'm having some basic troubles with GL_DEPTH_TEST. I'm drawing a simple surface using GL_QUAD_STRIP and am getting a lot of artifacting. I'm new to OpenGL and I'm unsure of where to look for the problem. Does anyone know what might be causing this? It would help a lot to be pointed in the right direction.With GL_DEPTH_TEST Disabled: With GL_DEPTH_TEST (GL_LESS) Enabled:  Thanks a lot for your help  -Patrick   
  Did you actually create a depth buffer when you initialised the window?   ;  Aha. After an hour more of tweaking. I've found the problem.gluPerspective(45, 1, 0, 1000)The near plane cannot be set to zero. So I changed it to this:gluPerspective(45, 1, 0.1, 1000)Does anyone know why this is? I haven't found any documentation that says this is the case. What if I don't want near objects to be clipped? Thanks for the help  -Patrick   ;  Any decent documentation should have mentioned this. But anyway, the prupose of the projection matrix is to project the view volume to a plane corresponding to your screen. Since the view volume for a perspective projection have a pyramid shape, the projection happens towards a single point, onto a plane positioned away from the point as specified by the near-parameter.If you set the near value to zero, the plane decays into a point of projection, and the point cannot be expanded to the surface of your screen. It's a singularity, sort of like how multiplication by zero cannot be undone to get the original value.   ;  Thanks for the clear explanation of the Projection Matrix. I've never understood at that way before. That makes everything make sense now.  -Patrick   ;  Thanks for the clear explanation of the Projection Matrix. I've never understood at that way before. That makes everything make sense now.  -Patrick   