# Z-sorting methods

**URL:** <https://forum.kirupa.com/t/z-sorting-methods/102289>\
**Category:** Uncategorized\
**Created:** [February 21, 2004, 9:33pm UTC](https://forum.kirupa.com/t/z-sorting-methods/102289 "2004-02-21T21:33:56Z")\
**Posts on this page:** 2\
**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/102289/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 ☹

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 22, 2004, 3:00am UTC](https://forum.kirupa.com/t/z-sorting-methods/102289/2 "2004-02-22T03:00:05Z")

</div>

checked out senocular’s 3d tutorial? 🙂
