For the depth buffer primarily: glEnable(GL_DEPTH_TEST); In addition, with turning on glut: glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH); //need this for lighting/fill But generally when clearing the color buffer you want to: glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); Remember, items will be clipped by near and far planes set by your perspective. Consider updating your reshape to: glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45, graph.winwidth/graph.winheight, 1.0, 10); //10 is the far plane, 1 the near glViewport(0,0,w,h); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookat(eyex,eyey,eyez,atx,aty,atz,upx,upy,upz); graph.winheight = h; graph.winwidth = w;