home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / sphigs / sph_dos.lha / dos / sphsrc.v08 / sph_face.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-26  |  1.7 KB  |  79 lines

  1. #ifndef _H_face_
  2. #define _H_face_
  3.  
  4.  
  5. typedef enum { objFace, objLine, objText, objPoint } objType;
  6.  
  7. typedef struct _typeFace {
  8.      int        numPoints;       /* passed (need minimum 3 points) */
  9.      vertex_index *    points;        /* passed (no sentinel) */
  10. } typeFace;
  11.  
  12. typedef struct _typeLine {
  13.      MAT3hvec            end1, end2;            /* passed */
  14. } typeLine;
  15.  
  16. typedef struct _typeText {
  17.      char *            text;
  18. } typeText;
  19.  
  20. typedef struct _typePoint {
  21.    char dummy;
  22. } typePoint;
  23.  
  24.  
  25. typedef struct _obj {
  26.      
  27.      /* object type */
  28.      objType            type;        /* face, line, or text */
  29.      
  30.      /* pointer to the next object */
  31.      struct _obj *         next;
  32.  
  33.      /* normal (for face, text) */
  34.      MAT3hvec             normal;        /* passed for face */
  35.      
  36.      /* bounding cube */
  37.      /* for face: we calculate */
  38.      /* for point: pass coordinates in min[x], min[y], min[z] */
  39.      /* for line: we calculate */
  40.      /* for text: pass z in min[z], pass min and max [x] and [y] */
  41.      MAT3hvec            min;
  42.      MAT3hvec            max;
  43.      
  44.      /* color intensity */
  45.      double    intensity;      /* should actually be a field in "typeFace" structure */
  46.      
  47.      /* pointer to specifics */
  48.      attribute_group         attributes;
  49.  
  50.      /* plane equation */
  51.      double            directed_distance;
  52.      
  53.      /* object specifics */
  54.      union {
  55.       typeFace        face;
  56.       typeLine        line;
  57.       typeText        text;
  58.       typePoint        point;
  59.      } data;
  60.  
  61.      /* stored for all objects */
  62.      MAT3hvec            p_min;
  63.      MAT3hvec            p_max;
  64.      boolean            already_moved;
  65.      MAT3hvec            p_normal;
  66.      unsigned short        traversal_index;  /* used for pick correlation */
  67. } obj;
  68.  
  69.  
  70. extern void convexify();
  71. extern void cull( );
  72. extern void clip( );
  73. extern void calc_intensity( );
  74. extern void map_to_canon( );
  75. extern void generate_pdc_vertices( );
  76. extern void zsort( );
  77.  
  78. #endif
  79.