home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / t / triq.zip / VIEW.H < prev   
C/C++ Source or Header  |  1992-05-06  |  2KB  |  70 lines

  1. #define MAXPTS    40
  2. #define MAXPOLY 50
  3. #define MAXEDGE 20
  4. #define MAXPT    40
  5.  
  6. typedef POINTFX4D PNT;
  7.  
  8. typedef struct 
  9. {
  10.     VECTORFX  nvec;        /* Normal vector */
  11.     BYTE      len;        /* number of edges */
  12.     int       ied[MAXPT];   /* list of edge index's, should be variable!! */
  13.     int       ipt[MAXPT];   /* list of edge index's, should be variable!! */
  14.     FIXED     zmin,zmax;
  15.     FIXED     xmin,xmax;
  16.     FIXED     ymin,ymax;
  17.  
  18.     HBITMAP   hbmTexture;
  19.     DWORD     rgb;
  20. }   POLY, *PPOLY, far *LPPOLY;
  21.  
  22. typedef struct 
  23. {
  24.     int     p1,p2;    /* two point indexes make a edge */
  25.     BOOL    f;
  26. }   EDGE;
  27.  
  28. typedef struct 
  29. {
  30.     PSTR        szTexture;    // surface picture
  31.     HBITMAP     hbmTexture;
  32.     DWORD       rgb;
  33. }   SURFACE;
  34.  
  35. /* ---------------------------------------------------- */
  36. /*              STATIC VARIABLE DEFINITIONS             */
  37. /* ---------------------------------------------------- */
  38.  
  39. //typedef POLY  FAR * PPOLY;
  40. //typedef PNT   FAR * PPNT;
  41. //typedef EDGE  FAR * PEDGE;
  42.  
  43. extern  POINTFX4D FAR *POINTSQ;          // original 3d points
  44. extern    POINTFX4D FAR *CPOINTSQ;         // converted 3d points
  45. extern    POINT FAR *PNTS;            // projected 2d points
  46. extern    EDGE  FAR *EDGES;           // all edges in the scene
  47. extern    POLY  FAR *POLYS;           // all polys in the scene
  48.  
  49. int macPoint;
  50. int macPoly;
  51. int macEdge;
  52.  
  53. TRANSFORM  M;           /* Object to World transform */
  54. TRANSFORM  V;           /* Viewing transform */
  55. POINTFX4D    light;       /* light source position */
  56. POINTFX4D    color;       /* Current color */
  57. POINTFX4D    background;  /* background color */
  58.  
  59. DWORD      rgbBackground;
  60.  
  61. extern RECT    rcExtent;
  62.  
  63. int fDebug;
  64.  
  65. /* ---------------------------------------------------- */
  66. /*        PROCEDURE DEFINITIONS            */
  67. /* ---------------------------------------------------- */
  68.  
  69. VECTORFX PolyNormal(LPPOLY pPoly, POINTFX4D FAR *pp);
  70.