Wednesday, April 29, 2015

mathematics - How do I sort isometric sprites into the correct order?


In a normal top-down 2D game one could use the screen y axis to sort the images. In this example the trees are properly sorted but the isometric walls are not:


Example image: sorted by screen y


Wall 2 is one pixel below wall 1 therefore it is drawn after wall 1, and ends up on top.


If I sort by the isometric y axis the walls appear in the correct order but the trees do not:


Example image: sorted by isometric y


How do I do this correctly?




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...