home *** CD-ROM | disk | FTP | other *** search
/ Quake++ for Quake / Quake++.iso / quake / qkview / threedq.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-10  |  1.2 KB  |  57 lines

  1. // Threed: Three dimentional viewer.
  2.  
  3. #ifndef THREEDH
  4. #define THREEDH
  5.  
  6. #include "vector.h"
  7. #include "array.h"
  8.  
  9. #define EM_FILEOPENERROR -100
  10. #define EM_FILETOOBIG -101
  11. #define NUMCONNECTIONS 65535
  12. #define NUMVERTICES 65535
  13.  
  14. #define VL 0
  15. #define VR 2000
  16. #define VT 0
  17. #define VB 2000
  18.  
  19.  
  20. // Three dimentional viewing class
  21. class TThreeD {
  22. public:
  23.     double A, B, C, D, DVal;
  24.     VECTOR From, At, Up;
  25.     double Angle;
  26.     VECTOR A1, A2, A3;
  27.     ARRAY<WORD> Connect;
  28.     ARRAY<VECTOR> Points;
  29.     int Vl, Vt, Vr, Vb;
  30.     WORD Length;
  31.     WORD Vertices;
  32.     double ObjMinx,ObjMaxx;
  33.     double ObjMiny,ObjMaxy;
  34.     double ObjMinz,ObjMaxz;
  35.  
  36.     double Offsx, Offsy, Offsz;
  37.  
  38.     VECTOR Dist;    // the FROM->AT vector
  39.  
  40.     TThreeD();
  41.     void Display(HDC DC, RECT& rect);
  42.     virtual int Get3dObject();
  43.     virtual int Read3DObject(char* filename);
  44.     void MinMax();
  45.     void WORLDtoPC(double xw,double yw, POINT& pc);
  46.     int Code(double x, double y, double z);
  47.     void SetAt();
  48.     virtual void SetFrom();
  49.     void SetEye();
  50.     virtual void View(HDC DC);
  51.     void TransformSeg(HDC DC, VECTOR& v1, VECTOR& v2,
  52.                             POINT& pc1, POINT& pc2);
  53.     virtual void Clip3D(HDC DC, double x1, double y1, double z1,
  54.                               double x2, double y2, double z2, POINT& pc1, POINT& pc2);
  55. };
  56.  
  57. #endif THREEDH