View Full Version : Depth

12-30-2001, 03:32 PM

I have an orthogrphical view. When I draw transparent objects, the last drawn one is in front of all other object. How can I get a later drawn (or last drawn) object behind all other objeczs?

Thanks for helping,
Volker Mische

Rob The Bloke
12-30-2001, 03:41 PM
Either sort them for depth using quicksort (or other sorting algorithm), or use BSP trees to sort the polygons

12-31-2001, 07:56 AM
How can i change the order of the objects?
Can i edit the depth buffer?

01-02-2002, 12:41 AM
You can change the order of the objects using some kind of sorting algorithm. As Rob has said, for example, the Quick Sort.

There are only two options:
a) Enable Z-buffering with glEnable(GL_DEPTH_TEST); Be sure the objects Z coords are correct.
b) Sort your objects to render them in the order you want. Disable Z-buffering.