   creating 3 planes in opengl
  Hi all. I am trying to create 3 planes in opengl, each one perpendicualr to other and intersecting others. I cant figure out the drawing order. My drawing order is red, green, blue. But this is not looking good at all, as last drawn plane is in front of previously drawn. Here is what I am gettinghttp://i32.tinypic.com/30town6.jpghttp://i31.tinypic.com/9tkgue.jpghttp://i32.tinypic.com/10d751d.jpgAny help will be appreciated.ThanksKazz   
  Looks like you haven't enabled z-buffering.   ;  When you are specifing your PIXELFORMATDESCRIPTOR make sure you add:pfd.cDepthBits = 24;When you clear the screen to render again, use:glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );And enable the depth buffer://depth buffer clear valueglClearDepth(1.0f);//Enable depth bufferglEnable( GL_DEPTH_TEST );glDepthFunc ( GL_LEQUAL );;  Hi. This is exactly what I am doing, but still same result.When I initialize the renderervoid Renderer::Init(){glShadeModel(GL_SMOOTH);glClearColor(0.0f, 0.0f, 0.0f, 0.0f);glClearDepth(1.0f);glEnable(GL_DEPTH_TEST);glDepthFunc(GL_LEQUAL);glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);}Then in main loopvoid MainLoop( int x, int y, int w, int h ){glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);   glMatrixMode(GL_MODELVIEW);glLoadIdentity();   DrawPlaneRed();   DrawPlaneGreen();   DrawPlaneBlue();};  Fixed. System was calling glDisable(GL_DEPTH_TEST) at a later stage.Thanks every one for helpKazz   