Hi, I'm writing some simple software 3D rasterization code for a small game me and my friends are going to make. So I have gotten some triangle rasterization code, with some *FULL* matrix concatenator routine (which takes ~3000 clk cycles, is that bad? ). anyway the polygons are respresented using floating point data types using the average Z values of the verticies. I was wondering if there is a floating poit sorting algorithm that you guys use, that is pretty quick?

If the bubble sort will do well let me know so I can implement it instead of bothering you guys :D

Thanks in advance
Posted on 2003-02-27 21:01:01 by x86asm
Posted on 2003-02-27 21:18:05 by bitRAKE
Bubblesort is the best for sorting triangles when the difference between each frame is small. The bubblesort is the absolute fastest sort on already sorted data. You should, however, use Quicksort if the whole scene changes fast. BTW. Remember to sort pointers to the triangles and not sort the actual triangles.
Posted on 2003-02-28 00:22:40 by gliptic

Bubblesort is the best for sorting triangles when the difference between each frame is small. The bubblesort is the absolute fastest sort on already sorted data. You should, however, use Quicksort if the whole scene changes fast. BTW. Remember to sort pointers to the triangles and not sort the actual triangles.


thanks I was about to sort and move the whole triangle entry, stupid me :(
Posted on 2003-02-28 07:11:13 by x86asm


I'll look at your code, and try to convert it to floating point much thanks Gliptic and BitRake
Posted on 2003-02-28 07:20:18 by x86asm