View Single Post
Old 29-Mar-2007, 02:45 AM   #2 (permalink)
Iphone
Fixed Error!
 
Iphone's Avatar

Posts: 4,202
Join Date: Mar 2007
Rep Power: 6 Iphone is on a distinguished road

IM:
Default Re: Isometrics Graphics - Engine Layers Position , how to work out layers, which obje

Sorting by Y value really doesn't solve properly all the cases. We need a generic approach.
In isometric projection, assuming the camera pointing to the orign, the camera could be in one of the 8 octants: front-left-up, back-right-up, etc. So the order should be defined accordly.

If you have already each object drawn in a isometric projection, I am assuming that we see the following three faces: top, front and right. If different of that, just change the faces to adjust them to the general sorting: objects (or their drawings) are renderd from left to right, from lower to upper, from back to front, such that the last object is the rightmost, upmost and frontmost.

Another way of describing the same is to draw from -x to +x, from -y to +y, from -z to +z. Anyway, you can't determine the order by the screen position, but 3D space position. So you will ever redraw each moving object and, sometimes, some static objects that are more at right, up or front than the moved ones.
Iphone is offline   Reply With Quote