How to properly sort a set of axis-aligned boxes so they are drawn correctly under this projection? Given a set S of axis-aligned, non-overlapping boxes {x,y,z,w,h,l}, where x,y,z are their center-positions and w,h,l their width, height and lengths, and given the following orthographic projection:
proj_x = x - z*sqrt(2)/2
proj_y = y - z*sqrt(2)/2

What is a function f(a,b) that determines wheter box A is above (and, thus, should be drawn after) B under that projection?


Here's a potential problem. You can have three thin boxes with different long axes that occlude each other in a rock-paper-scissors manner, i.e. non-transitively:

If you like, the boxes can be made short enough so that they just barely occlude each other; they don't have to fully cross. What should happen then?
