PDA

View Full Version : 3D GL drawing over polygons



D_Lux
06-19-2001, 08:07 AM
What is the easiest way to avoid having a polygon that is behind another polygon from drawing over the one in front. For some reason when i draw 2 triangles lets say, and one is behind the other, the one that is drawn last covers up, wheather its in front or back. Do I have to sort this out by drawing all my 3D chit from front to back, or is there a Open GL command that can do this for me?

bsperlin
06-19-2001, 09:28 AM
Are you enabling the depth buffer?

glEnable( GL_DEPTH_TEST );

Also put in main() in glutInitDisplayMode(

Barry