Mail Archives: djgpp/1999/12/28/18:49:33
> 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 -