With fresh motivation, here is another go. I have the algorithm, implementation is in progress. But better have it checked for flaws first.
The general principle is that (a) objects don't intersect and (b) need to be rendered from "back" to "front". Rians idea of doing a simple depth-sorting based on the distance to the view plane did not work, because of large objects. My own idea of checking if objects overlap others and only draw those that do not overlap anything failed, because of implementation flaws. Now here's a proposal that combines the two :-). Project the shadow of each object onto a common plane to check for overlap. If two objects do overlap, use their distance to the view plane to figure out which one's above and below. The algorithm then goes as follows: Pick an object and compare it against all other objects. If it ends up not overlapping any of those or is the "lowest" object, it can be drawn and removed from the queue. If provision (a) holds and the implementation is correct, there should be no chance for deadlock. But I'd still implement a safety check for that case. As usual, I'll let you know how it goes. Wish me luck! ;-) Kai _______________________________________________ Adonthell-devel mailing list Adonthell-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/adonthell-devel