|
Author Topic:   Sort polys based on depth
Kaeto
Member
posted May 16, 2000 06:54 PM            
I need a rough way to sort triangles based on depth. I don't care if it mis-sorts overlapping ones, I just want to get the basic order down. I could compute the distance to every point on every triangle but somehow I doubt that would be a good idea.

IP:

Chris C
Member
posted May 17, 2000 09:44 AM         
The simplest way to do this is average the three triangle vertices and use the result as the sort key. It's fast and works reasonably well.

Hope this helps,

Chris

IP:

jester
New Member
posted May 18, 2000 09:49 AM            
or you could try....

If you know the range of the values and they are all integers (very important) you can use a Counting sort. It runs very fast if you are using a moderately sized range with a moderate number of polys.

IP:

Kaeto
Member
posted May 18, 2000 11:04 AM            
Thanks for the info... Doesn't look like I'll be doing any programming for a few weeks, cuz my HD's controls went kablooie (it's a WD, too) so I'm sending it off to drive savers... arg!

IP: