View Full Version : overlapping polygons
02-14-2003, 07:19 AM
i am trying to draw sd shapes from the data file ( where they are being defined) and they consist of polygon primitives.
my question is that often times the polygons overlap and the faces that are in the back get drawn in the front
how do i avoid that?
thanx a bunch
02-14-2003, 07:22 AM
one way would be to order the polygons so that you draw them from back to front, and then draw them that way. this may be extremely difficult to do, depending on how the data is set up.
02-14-2003, 10:30 AM
thanks, i thought about that but some of the shapes are pretty complicated and i think there should be another way of doing it....maybe through some OpenGL routines???
02-14-2003, 10:55 AM
Use glEnable(GL_DEPTH_TEST) in your intitialization and in your rendering loop glClear(... | GL_DEPTH_BUFFER_BIT) where ... could also include color, accum, and/or stencil buffer bits.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.