i made 2 spheres. second sphere is made by translating the first, 3 units on x-axis and 2 units on -z aixs. this is the code
glutSolidSphere(1.0,8,15);
glColor3f(0.0,0,0);
glTranslatef(3,0,-2);
glutSolidSphere(1.0,8,15);
if depth buffer enable
glDepthMask(GL_TRUE);
glDepthFunc(GL_LEQUAL);
after first sphere is drawn, depth buffer has z-axis value of first sphere. while drawing second sphere glDepthFunc(GL_LEQUAL); checks stored depth buffer value to the second sphere's value, if it is less than it draws tht pixel other wise not.
this is all wht i understand about depth buffer working. is this right? plz correct if m wrong