www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/05/18:54:59

From: Jose Manuel Lopez-Cepero <sigma AT ctv DOT es>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro 3D : Sorting Polygons
Date: Sat, 05 Apr 1997 22:44:30 +0200
Organization: Unisource Espana NEWS SERVER
Lines: 24
Message-ID: <3346B9AE.4A60@ctv.es>
References: <E7rD4t DOT 9zL AT news DOT uwindsor DOT ca>
Reply-To: sigma AT ctv DOT es
NNTP-Posting-Host: macarena.ctv.es
Mime-Version: 1.0
CC: johnsoe AT uwindsor DOT ca
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019