delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/28/18:49:33

Message-ID: <3868C320.26C1BC3B@maths.unine.ch>
Date: Tue, 28 Dec 1999 15:03:15 +0100
From: Gautier <gautier DOT demontmollin AT maths DOT unine DOT ch>
Organization: =?iso-8859-1?Q?Universit=E9?= de =?iso-8859-1?Q?Neuch=E2tel?=
X-Mailer: Mozilla 4.51 (Macintosh; I; PPC)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: 3D Problem
References: <ojK84.2278$W3 DOT 54472 AT news DOT tpnet DOT pl> <38637BBF DOT CC5A0C04 AT maths DOT unine DOT ch> <BxR84.2831$W3 DOT 67845 AT news DOT tpnet DOT pl>
NNTP-Posting-Host: mac13-27.unine.ch
X-Trace: 28 Dec 1999 15:01:03 +0100, mac13-27.unine.ch
Lines: 30
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> I tried your site, but Im just a starting "programmer" :) and I was not able
> to find the information, I need.

You can take a look at the excellent (and simple) Peroxide tutorial
(link @ http://members.xoom.com/gdemont/e3d.htm, that is http://www.peroxide.dk/ IIRC)
with clear and simple Pascal code (C too).

>     I've got an array FACE which includes a number of arrays QUAD, that
> include
>     the 4 vertex points (x,y,z,color) .(Actually I'm just using faces with 4
> points)

It means the when a point (x,y,z) is shared by n faces, you have to rotate
n times the same point -> Bad!
You should rather have an array of points for the whole object,
and an array of faces with indices to these points p1..p4: (idx,color).

>     First I was just checking the z-coordinate but it worked just partly. :(

How do you define the z-coordinate of a face ? You have to make a choice.
The most convenient is the mean of the z-coord of the points that are vertices
of the face. Then you use that z-coord as the sorting key for your faces.
Remember that a sorting algo will sort the key as well as the information
(the face indices), so the access to face data must use the index
permutation, except the z-coord! (a good bug source)

HTH - happy new bug

-- 
Gautier

- Raw text -


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