# Z-sorting methods

**URL:** <https://forum.kirupa.com/t/z-sorting-methods/43392>\
**Category:** Uncategorized\
**Created:** [February 21, 2004, 9:33pm UTC](https://forum.kirupa.com/t/z-sorting-methods/43392 "2004-02-21T21:33:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![microchip](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@microchip](https://forum.kirupa.com/u/microchip)\
**Post date:** [February 21, 2004, 9:33pm UTC](https://forum.kirupa.com/t/z-sorting-methods/43392/1 "2004-02-21T21:33:56Z")

</div>

Hi  
I’ve made this 3D engine, now I’m starting on polygons. Now I have this problem with z-sorting. Currently I’ve avaraged all the z values of the individual vertices. But that doesn’t work. How should I sort my depths?

To see my problem go to:

[3D-engine new](http://home.wanadoo.nl/markvdw/3d-engine%20new.swf)  
To see the problem wait a few seconds (it’s only one or two kb’s), and then click in a clockwise || anticlockwise sequence. Then press a key. A 3D object will be created out of your points. The top left corner is 0, 0 so the closer you click to that the closer you are to the centre of the 3d shape.

I’ve posted this problem on loads of forums, but I havn’t had any answers yet ☹
