home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / PCTV3N3.ZIP / THREED.H < prev   
Encoding:
C/C++ Source or Header  |  1992-05-27  |  1.9 KB  |  49 lines

  1. // THREED.H: Header file for THREED.CPP.
  2. #ifndef THREEDH
  3. #define THREEDH
  4. #include "vector.h"
  5.  
  6. #define EM_FILEOPENERROR -100
  7. #define EM_FILETOOBIG -101
  8. #define NUMCONNECTIONS 400   // An object can have this many
  9. #define NUMVERTICES 450      // vertices and connections.
  10. #define PCL 0                // Borders of viewing region on
  11. #define PCR 1000             // the screen. These four variables
  12. #define PCT 0                // correspond to the left, right,
  13. #define PCB 1000             // top, and bottom pixel boundaries
  14.                  // of the viewing region.
  15. // A three-dimensional viewing class
  16. class TThreeD {
  17. public:
  18.   double a, b, c, d, dval;
  19.   VECTOR from, at, up;               // Viewing parameters
  20.   double Angle;                      // The viewing angle
  21.   VECTOR a1, a2, a3;                 // Used in 3-D transform
  22.   int connect[NUMCONNECTIONS];       // Vertex connections
  23.   VECTOR pointarray[NUMVERTICES];    // Vertices
  24.   int pcb, pct, pcl, pcr;     // Screen boundaries of viewing area
  25.   int length;                 // Number of vertex connections
  26.   int vertices;               // Number of vertices
  27.   double objxmin, objxmax;    // Extent of 3-D object
  28.   double objymin, objymax;
  29.   double objzmin, objzmax;
  30.   double offsx, offsy, offsz; // Transform variables
  31.   VECTOR dist;                // Distance between from and at points
  32.   TThreeD();
  33.   void Display(HDC hDC, RECT& rect); // High level display routine
  34.   virtual int Read3DObject(char *FileName);
  35.   void MinMax();
  36.   void WORLDtoPC(double xw, double yw, POINT& pc);
  37.   int Code(double x, double y, double z);
  38.   void SetAt();
  39.   virtual void SetFrom();
  40.   void SetEye();
  41.   virtual void View(HDC hDC);
  42.   void TransformSeg(HDC hDC, VECTOR *v1, VECTOR *v2,
  43.     POINT& pc1, POINT& pc2);
  44.   virtual void Clip3D(HDC hDC, double x1, double y1, double z1,
  45.     double x2, double y2, double z2, POINT& pc1, POINT& pc2);
  46. };
  47. typedef TThreeD *PTThreeD;
  48. #endif THREEDH
  49.