0

I'm have problem with Isometric. I'm don't know how to name this "problem", but I'm show you some sceen what I get and what I'm need to get.

My code now drawing something like: http://2.bp.blogspot.com/_rqhF_8E1nlA/R59d_PmoREI/AAAAAAAAAGo/3yHpmy55moc/s400/lore2.png

But I'm need draw something like this: http://3.bp.blogspot.com/_rqhF_8E1nlA/R59epfmoRFI/AAAAAAAAAGw/cE_o-A0bvm0/s400/lore3.png

I'm hear this is "Depth sort" But what it is? how I'm can apply to my code and where I'm can learn this?

My code: http://jsdo.it/keichioor/exU1

kichu
  • 53
  • 5

2 Answers2

1

You need to sort your sprites by farthest to nearest (so nearer sprites are rendered over the behind ones).

So...

blocks.sort(function(a, b) {
    return a.z - b.z;
});
alex
  • 479,566
  • 201
  • 878
  • 984
0

I thinking this is what your looking for, let me know

I just forked your project

http://jsdo.it/EricRobinson/8h4E

Eric Robinson
  • 2,025
  • 14
  • 22
  • No, I'm not this need. In your example you just move block to another position, but thanks :) – kichu Jul 20 '12 at 13:07
  • I did that so that It would display the block in behind the other. like your table picture. But are you looking for a way to sort the blocks so that you get this effect? – Eric Robinson Jul 20 '12 at 13:15