MickeyMouse
03-21-2002, 11:24 PM
hi!
my problem is i want to make some really fast rendering. i disable depth buffer but then have to sort faces back-to-front to get correct effect...
..and i assume there're no 2 intersecting faces, so it's 100% possible to display them in correct order..
for most cases an algorithm sorting all faces by it's distance (distance from the center of it's bounding box or whatever) from the viewer origin is good, but there're some situations when it doesn't work like below
(there're 2 diagonal faces seen from the top and the viewer, dots are only tabs)
........../
.........//
........//
......./
....../
...../
..........*
in this case bigger face will be considered closer, although it should be drawn first, thus we'd be wrong doing simple sorting...
anyway for 2 faces it's easy to determine which should be drawn first by simply checking whether all A face vertices are in front of plane of face B...but using this kind of comparing function would be wrong, cause
A<B B<C doesn't mean A<C (< means should be drawn first)
thx for help
[This message has been edited by MickeyMouse (edited 03-22-2002).]
[This message has been edited by MickeyMouse (edited 03-22-2002).]
[This message has been edited by MickeyMouse (edited 03-22-2002).]
my problem is i want to make some really fast rendering. i disable depth buffer but then have to sort faces back-to-front to get correct effect...
..and i assume there're no 2 intersecting faces, so it's 100% possible to display them in correct order..
for most cases an algorithm sorting all faces by it's distance (distance from the center of it's bounding box or whatever) from the viewer origin is good, but there're some situations when it doesn't work like below
(there're 2 diagonal faces seen from the top and the viewer, dots are only tabs)
........../
.........//
........//
......./
....../
...../
..........*
in this case bigger face will be considered closer, although it should be drawn first, thus we'd be wrong doing simple sorting...
anyway for 2 faces it's easy to determine which should be drawn first by simply checking whether all A face vertices are in front of plane of face B...but using this kind of comparing function would be wrong, cause
A<B B<C doesn't mean A<C (< means should be drawn first)
thx for help
[This message has been edited by MickeyMouse (edited 03-22-2002).]
[This message has been edited by MickeyMouse (edited 03-22-2002).]
[This message has been edited by MickeyMouse (edited 03-22-2002).]