FORUMS: list search recent posts

Isometric depth sorting

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mark Arenz
Isometric depth sorting
on Mar 14, 2006 at 3:30:03 pm

I've built several games using isometric display math and they've worked out well enough, but for a new project I've elected to use a method that allows objects to be pushed & raise above the floor. I'm using concepts used in this tutorial:

So far, it's working really well, but depth-sorting has me at a loss. Using traditional methods like the ones described in this tutorial don't work for my purposes:

I'm using a set of functions to convert x,y,z (3d space) to x,y (screen). I've come up with a way to assign a depth value to every object and then sort them (rather than swapping directly to that number which limits the depth resolution since Flash supports a finite # of layers). That works OK, but I can't seem to get it to take an object's dimensions (a,b,c) into account.

Any ideas? I can post some of the code here, but I fear that it might just confuse the issue.

Return to posts index

Mark Arenz
Re: Isometric depth sorting
on Mar 23, 2006 at 10:21:43 pm

In case anyone was watching this thread with the same problem I figured it out. You can sort them based on the same function that derives the _y as though both objects are on the floor (y=0). Here's the kicker: to include the volume of the objects, use the point furthest from the origin (x+a,0,z+c) build those values into an array, sort and season to taste. It's worked beautifully so far.

Here's the finished game: Buzzle, a bouncing, tweaking, puzzling thing. The rules are very simple- arrange the objects on screen so that the ball hits the target when you press "GO." In other words, its a little like those Laser puzzles from a few years ago but with quasi-3D physics.

It should keep you interested for a few minutes, anyway.

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved