Mail Archives: djgpp/1999/11/13/09:31:02
Hi all,
I am working on a 3D engine, and I am having a little trouble. Here are
the relevant source
//==============
// structures
typedef struct // a point
{
float x, y, z;
int scrx, scry;
int distance;
int color;
}point_s;
typedef struct // a face (trigon)
{
point_s p1;
point_s p2;
point_s p3;
}face_s;
typedef struct // an object
{
face_s *faces;
int numfaces;
}object_s;
I want the object_s structure to be able to have any number of faces, hence
face_s *faces. But, if I want to add a face (or a pointer to a face), how
do I do it? Also, how do I access any given face, if I have say 20
pointers
to 20 faces in a given object?
Thank you,
Marius Myburg
- Raw text -