home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / 3 / 3d120.zip / HDR3D.PAS < prev    next >
Pascal/Delphi Source File  |  1992-08-08  |  2KB  |  90 lines

  1. (******************************************************************************
  2. *                                    hdr3d                                    *
  3. ******************************************************************************)
  4. unit hdr3d;
  5.  
  6. {this is the 3D program header of globals, types etc..}
  7.  
  8. interface
  9.  
  10. const
  11.     MaxPoints  = 20;
  12.     MaxLines   = 50;
  13.     maxObjects = 9; {size of object table}
  14.     maxMacros  = 5; {size of macro table}
  15.     maxNest    = 10; {size of loop table of interpreter}
  16.     UNTITLED   = 'UNTITLED';
  17.     UNTITLEDC  = 'UNTITLED.3DS';
  18.     UNTITLEDS  = 'UNTITLED.3D2';
  19.  
  20. const ScreenWidth = 1000;
  21.       HalfWidth   = screenWidth / 2;
  22.  
  23.        radFactor = 180 / 3.1415926535897932385;
  24.  
  25. type
  26.     Line3d  = record
  27.        FromP, ToP  : integer;
  28.     end;
  29.     screenPoints = record
  30.        sX,sY : integer;
  31.     end;
  32.     axisType = (x,y,z);
  33.  
  34. type
  35.     point3d = record
  36.        x, y, z     : real;
  37.     end;
  38.  
  39. const
  40.        zeroPoint : point3d = (x:0.0; y:0.0; z:0.0);
  41.        xAxis : integer = 45;
  42.        yAxis : integer = 45;
  43.  
  44. var
  45.        cosine_x,cosine_y,sine_x,sine_y : Real;
  46.        currentPath : string[32];
  47. const
  48.        currentAxis : axisType = x;
  49.  
  50.  
  51. Procedure CalcAxisDeg;
  52. procedure setDefaultSuffix(var Fname : string; suffix : string);
  53.  
  54. implementation
  55.  
  56. (******************************************************************************
  57. *                                 CalcAxisDeg                                 *
  58. ******************************************************************************)
  59. Procedure CalcAxisDeg;
  60.  
  61.  {calculate sines & cosines of axis, xAxis + yAxis = 90!}
  62.  
  63. Begin
  64.      Cosine_X := cos(Xaxis/RadFactor);
  65.      Cosine_Y := cos(Yaxis/RadFactor);
  66.      Sine_X   := sin(Xaxis/RadFactor);
  67.      Sine_Y   := sin(Yaxis/RadFactor);
  68. End;
  69.  
  70. (*******************************************************************************
  71. *                              setDefaultSuffix                                *
  72. *   Set the suffix if Fname to .suffix, if it does not have a suffix           *
  73. *******************************************************************************)
  74.  
  75. procedure setDefaultSuffix;
  76. var
  77.     i  : integer;
  78. begin
  79.     i := length(Fname);
  80.     while (i > 0) and (Fname[i] <> '.') do
  81.        dec(i);
  82.     if (i = 0) then
  83.        Fname := Fname + '.' + suffix;
  84. end;
  85.  
  86. begin
  87.        getdir(0, currentPath);
  88.        calcAxisDeg;
  89. end.
  90.