home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / gfx / 3d / irit / contrib / poly3d-r / program.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-09  |  3.6 KB  |  102 lines

  1. /*****************************************************************************
  2. * Definitions for the Poly3D-R program:                                      *
  3. *****************************************************************************/
  4.  
  5. #ifndef POLY_3D_R_H
  6. #define POLY_3D_R_H
  7.  
  8. #include "irit_sm.h"
  9. #include "genmat.h"
  10. #include "iritprsr.h"
  11. #include "attribut.h"
  12. #include "allocate.h"
  13. #include "gif_lib.h"
  14. #include "iritgrap.h"
  15. #include "cagd_lib.h"
  16. #include "symb_lib.h"
  17.  
  18. #define DEFAULT_COLOR        15
  19. #define DEFAULT_BACK_GROUND_COLOR    1    /* Blue as default back ground. */
  20. #define RGB_COLOR_GIVEN            -1    /* Or if fill RGB was given. */
  21. #define DEFAULT_NORMAL_AVG_DEGREE    30       /* Less will be averaged. */
  22. #define DEFAULT_SAMPLE_PER_SRF_AXIS    20  /* Fineness srf subdiv. control. */
  23.  
  24. #define DEFAULT_SCREEN_XSIZE    320
  25. #define DEFAULT_SCREEN_YSIZE    200
  26.  
  27. #define DEFAULT_BITS_PER_PIXEL    7
  28. #define DEFAULT_LIGHT_SOURCE    { 1.0, 3.0, 7.0 }
  29. #define DEFAULT_AMBIENT        0.3
  30.  
  31. #define DEFAULT_FINENESS    4
  32.  
  33. typedef struct ShadeInfoStruct {
  34.     int SubSamplePixel;
  35.     int BitsPerPixel;         /* 2^BitsPerPixel == number of colors possible. */
  36.     int LevelsPerColor;        /* Number of levels per each required color. */
  37.     int DefaultColor;
  38.     int BackGroundColor;
  39.     int TwoSources;  /* If true - two sources at opposite direction assumed. */
  40.     int ScrnXSize;                   /* Rendered image dimensions. */
  41.     int ScrnYSize;
  42.     int Gouraud;                 /* If TRUE use Gouraud shading. */
  43.     int BackFacing;           /* If TRUE - delete back facing polygons. */
  44.     int *MinIntensityIndex;   /* Hold minimum intensity of this color index. */
  45.     GifColorType *PColorMap;
  46.     RealType LightSource[3];        /* Vector direction of light source. */
  47.     RealType Ambient;
  48.     RealType NrmlAvgDegree;
  49. } ShadeInfoStruct;
  50.  
  51. typedef struct ScanConvertStruct {
  52.     int MaxEdgeY;              /* When this edge is no longer active. */
  53.     struct IPVertexStruct *VMinY, *VMaxY; /* Which vertices form this bndry. */
  54. } ScanConvertStruct;
  55.  
  56. typedef struct PolygonScanConvertStruct {
  57.     ScanConvertStruct Bndry1, Bndry2;
  58. } PolygonScanConvertStruct;
  59.  
  60. /* The following are global setable variables (via config file poly3d-r.cfg).*/
  61. extern int GlblMore, MouseExists, GraphDriver;
  62. extern ShadeInfoStruct GlblShadeInfo;
  63.  
  64. /* Total number of polygons/vertices to scan converted, in current scene:    */
  65. extern int GlblNumOfPolys;
  66. extern int GlblNumOfVerts;
  67.  
  68. /* Used as global measure on the surfaces subdivision fineness. */
  69. extern int FineNess;
  70.  
  71. /* Amount scene was scaled up from normalized [-1..1] size on both X & Y:    */
  72. extern RealType GlblScaleUpFctr;
  73.  
  74. /* Global transformation matrix: */
  75. extern MatrixType GlblViewMat;              /* Current view of object. */
  76.  
  77. /* All polygons to be scan convert will be inserted into this hash table     */
  78. /* during the preprocessing (PrepareXXXX functions).                 */
  79. extern struct IPPolygonStruct **PolyHashTable;
  80.  
  81. /* And finally the prototypes of the Poly3D-H.c module: */
  82. IPPolygonStruct *ProcessSurfaces(CagdCrvStruct *Crvs, CagdSrfStruct *Srfs);
  83. void Poly3drExit(int ExitCode);
  84. void QuitGifError(void);
  85.  
  86. /* Prototypes of the PrepData.c module: */
  87. void PrepareViewData(IPObjectStruct *PObjects);
  88.  
  89. /* Prototypes of the ColorTbl.c module: */
  90. void PrepareColorTable(IPObjectStruct *PObjects);
  91.  
  92. /* Prototypes of the EvalColr.c module: */
  93. void EvalVrtxColors(IPObjectStruct *PObjects);
  94. int UpdateEqnPolygon(IPPolygonStruct *PPolygon, int SetFlipDir);
  95. int CrossProd(RealType Pt1[3], RealType Pt2[3], RealType Pt3[3]);
  96. void PrintPolyContent(IPPolygonStruct *PPoly);
  97.  
  98. /* Prototypes of the ScnCnvrt.c module: */
  99. void ScanConvertData(GifFileType *GifFile, GifFileType *GifMask);
  100.  
  101. #endif /* POLY_3D_R_H */
  102.