home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / CDEMO4SR.ZIP / OBJCALC.TXT < prev    next >
Text File  |  1994-06-01  |  3KB  |  140 lines

  1. These are the calculations used for the various 3D objects used in this Intro.
  2. For speed and size they are calculated once, and then written to a .BIN file
  3. wich produced (using Binobj) the file Sxhmata.OBJ
  4.  
  5. const
  6.    CCMsg : Array[-3..3] of string[44]=
  7.         (' ...    ...    ...   ..   ..   ...    ...     ',
  8.          '.....  .....  .....  ... ...  .....  .....    ',
  9.          '..     .. ..  ..     .......  .. ..  ..       ',
  10.          '..     .. ..    ..   .. . ..  .. ..    ..     ',
  11.          '..     .. ..     ..  ..   ..  .. ..     ..    ',
  12.          '.....  .....  .....  ..   ..  .....  .....    ',
  13.          ' ...    ...    ...   ..   ..   ...    ...     ');
  14.  
  15.  
  16. Procedure CalcV1;
  17. Var z : ShortInt;
  18.     i,l     : Byte;
  19.     S,c   : Integer;
  20. begin
  21.   l:=1;
  22.   For z:=0 to 11 do
  23.   begin
  24.     For i:=0 to 12 do begin
  25.       S:=round(sin(2*I*pi/13)*23);
  26.       C:=round(Cos(2*I*Pi/13)*23);
  27.       Sxhmata[0][l,3]:=z*5-24;
  28.       Sxhmata[0][l,1]:=S;
  29.       Sxhmata[0][l,2]:=C;
  30.       inc(l);
  31.     end;
  32.   end;
  33. end;
  34.  
  35. Procedure CalcV2;
  36. Var z       : ShortInt;
  37.     i,l     : Byte;
  38.     S,c     : Integer;
  39. begin
  40.   l:=1;
  41.   For z:=0 to 7 do
  42.   begin
  43.     For i:=0 to 12 do begin
  44.       S:=round(sin(2*I*pi/13)*(15-(Cos(2*(z+4)*Pi/12)*15)));
  45.       C:=round(Cos(2*I*Pi/13)*(15-(Cos(2*(z+4)*Pi/12)*15)));
  46.       Sxhmata[1][l,3]:=z*5-24;
  47.       Sxhmata[1][l,1]:=S;
  48.       Sxhmata[1][l,2]:=C;
  49.       inc(l);
  50.     end;
  51.   end;
  52.   For z:=8 to 11 do
  53.   begin
  54.     For i:=0 to 12 do begin
  55.       S:=round(sin(2*I*pi/13)*((z-7)*(z-7)));
  56.       C:=round(Cos(2*I*Pi/13)*((z-7)*(z-7)));
  57.       Sxhmata[1][l,3]:=z*5-24;
  58.       Sxhmata[1][l,1]:=S;
  59.       Sxhmata[1][l,2]:=C;
  60.       inc(l);
  61.     end;
  62.   end;
  63. end;
  64.  
  65. Procedure CalcV3;
  66. Var z       : ShortInt;
  67.     i,l     : Byte;
  68.     S,c     : Integer;
  69. begin
  70.   l:=1;
  71.   For z:=0 to 11 do
  72.   begin
  73.     For i:=0 to 12 do begin
  74.       S:=round(sin(2*I*pi/13)*(Sin(2*Succ(z)*Pi/26)*30));
  75.       C:=round(Cos(2*I*Pi/13)*(Sin(2*Succ(z)*Pi/26)*30));
  76.       Sxhmata[2][l,3]:=Round(-Cos(2*Succ(z)*Pi/24)*28);
  77.       Sxhmata[2][l,1]:=S;
  78.       Sxhmata[2][l,2]:=C;
  79.       inc(l);
  80.     end;
  81.   end;
  82. end;
  83.  
  84. Procedure CalcV4;
  85. Var z       : ShortInt;
  86.     i,l     : Byte;
  87.     S,c     : Integer;
  88. begin
  89.   l:=1;
  90.   For z:=0 to 11 do
  91.   begin
  92.     For i:=0 to 12 do begin
  93.       S:=round(sin(2*I*pi/13)*(Sin(2*(z+8)*Pi/26)*28));
  94.       C:=round(Cos(2*I*Pi/13)*(Sin(2*(z+8)*Pi/26)*28));
  95.       Sxhmata[3][l,3]:=Round(-Cos(2*Succ(z)*Pi/24)*26);
  96.       Sxhmata[3][l,1]:=S;
  97.       Sxhmata[3][l,2]:=C;
  98.       inc(l);
  99.     end;
  100.   end;
  101. end;
  102.  
  103. Procedure CalcV5;
  104. Var z : ShortInt;
  105.     i,l     : Byte;
  106.     S,c   : Integer;
  107. begin
  108.   l:=1;
  109.   For z:=0 to 11 do
  110.   begin
  111.     For i:=0 to 12 do begin
  112.       S:=round(sin(2*I*pi/13)*28);
  113.       C:=round(Cos(2*I*Pi/13)*(Sin(2*Succ(z)*Pi/26)*30));
  114.       Sxhmata[4][l,3]:=((z-6)*4)+(i DIV 3);
  115.       Sxhmata[4][l,1]:=S;
  116.       Sxhmata[4][l,2]:=C;
  117.       inc(l);
  118.     end;
  119.   end;
  120. end;
  121.  
  122. Procedure CalcV6;
  123. Var x,y,z : ShortInt;
  124.     i,l     : Byte;
  125.     S,c   : Integer;
  126.  
  127. begin
  128.   l:=1;
  129.   For x:=1 to 42  do
  130.     For y:=-3 to 3 do
  131.       IF CCMsg[y][x]='.' Then
  132.       begin
  133.         Sxhmata[5][l,3]:=-Round(Cos(2*(y+4)*pi/20)*20);
  134.         Sxhmata[5][l,1]:=-Round((Sin(2*(x)*Pi/120)*40)*Sin(2*(y+20)*Pi/100))+20 ; { x*2 }
  135.         Sxhmata[5][l,2]:=Round((Cos(2*(x)*Pi/120)*40)*Sin(2*(y+20)*Pi/100))-10 ;  { y*2 }
  136.         inc(l);
  137.       end;
  138. end;
  139.  
  140.