Mail Archives: djgpp/1997/04/05/18:54:59
Doug Johnson wrote:
> I've been playing with the 3-D example in Allegro, the one with the tiled
> floor-grid. I have replaced the grid-drawing function with a box-drawing
> function, but I notice that the box's sides are not drawn as expected. Does
> this mean that my function must calculate the proper order to render the
> polygons? Is there any simple way to do this?
Yes, that's what it means.
To see how it can be done you might check the cubes example (I think it
is ex18). It basically uses an array with pointers to the projected
polygons and a function to compare a polygon's depth with another's.
Then the array is passed to qsort() with the routine as the helper,
after that you get the ordered array back to front, draw the polygons in
order and you have it.
Adios
--
_*
\ |/_|\/||\ sigma AT ctv DOT es
_\|\/| ||_\ (formerly Sigmatech) Jerez / Cadiz / Spain
- Raw text -