From: broeker AT acp3bf DOT knirsch DOT de (Hans-Bernhard Broeker) Newsgroups: comp.os.msdos.djgpp Subject: Re: 3D Problem Date: 3 Jan 2000 16:56:16 +0100 Organization: RWTH Aachen, III. physikalisches Institut B Lines: 28 Message-ID: <84qgr0$135@acp3bf.knirsch.de> References: NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 946914979 19593 137.226.32.75 (3 Jan 2000 15:56:19 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 3 Jan 2000 15:56:19 GMT X-Newsreader: TIN [version 1.2 PL2] To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com First of all, let me point out that this is not the right place to have asked this question in. There is no link to DJGPP in it. This question belongs to the comp.graphics.algorithms newsgroup. Snowman (idzy AT friko5 DOT onet DOT pl) wrote: [...] > I dont know how to sort the faces (I'm using qsort( )) in the correct order. There *is* no correct order, in the general case. Your scene must follow special rules for it to be displayable correctly by simple z-sorting, also called (the naive version of) Painter's algorithm. If it doesn't follow those rules, you'll get display errors. Frequently, debates turn up in c.g.algorithms about how to properly z-sort, what quantity to sort by (max, min or mean z? something else?), and so on. Such debate is useless: the whole idea of painters algorithm is limited to a special type of scenes. For general scenes, you have to apply more involved algorithms, which turn the sorting into a mere preprocessing trick to help speed up the real algorithm, which consists of a combined sorting and *splitting* loop over all polygons in the scene. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.