home *** CD-ROM | disk | FTP | other *** search
/ PC Underground / UNDERGROUND.ISO / graphic / 3d_wire.pas < prev    next >
Pascal/Delphi Source File  |  1995-07-28  |  2KB  |  58 lines

  1. Uses Crt,ModeXLib,var_3d;
  2.  
  3. Const
  4.     worldlen=8*3;               {Point-Array}
  5.     Worldconst:Array[0..worldlen-1] of Integer =
  6.     (-200,-200,-200,
  7.     -200,-200,200,
  8.     -200,200,-200,
  9.     -200,200,200,
  10.     200,-200,-200,
  11.     200,-200,200,
  12.     200,200,-200,
  13.     200,200,200);
  14.     surfclen=38;                {Surface-Array}
  15.     surfcconst:Array[0..surfclen-1] of Word=
  16.     (0,4, 0,2,6,4,
  17.      0,4, 0,1,3,2,
  18.      0,4, 4,6,7,5,
  19.      0,4, 1,5,7,3,
  20.      0,4, 2,3,7,6,
  21.      0,4, 0,4,5,1,0,0);
  22.  
  23. Var
  24.     i,j:Word;
  25.  
  26.  
  27. procedure drawworld;external;   {Draws the world on current video page}
  28. {$l 3dasm.obj}
  29. {$l poly.obj}
  30. {$l bres.obj}
  31. {$l root.obj}
  32.  
  33. Begin
  34.   vz:=1000;                     {solid is located at 1000 units depth}
  35.   vpage:=0;                     {start with page 0}
  36.   init_modex;                   {enable ModeX}
  37.   rotx:=0;                      {initial values for rotation}
  38.   roty:=0;
  39.   rotz:=0;
  40.   Fill:=false;                  {SurfaceFill off}
  41.   sf_sort:=false;               {SurfaceSort off}
  42.   sf_shift:=false;              {SurfaceShift suppression off}
  43.   Glass:=false;                 {glass surfaces off}
  44.   repeat
  45.     clrx($0f);                  {clear screen}
  46.     DrawWorld;                  {draw world}
  47.     switch;                     {switch to finished picture}
  48.     WaitRetrace;                {wait for next retrace}
  49.     Inc(rotx);                  {continue rotating ... }
  50.     If rotx=120 Then rotx:=0;
  51.     Inc(rotz);
  52.     If rotz=120 Then rotz:=0;
  53.     inc(roty);
  54.     if roty=120 Then roty:=0;
  55.   Until KeyPressed;             { ... until key}
  56.   TextMode(3);
  57. End.
  58.