Uses Crt,ModeXLib,var_3d;

Const
    worldlen=8*3;               {Point-Array}
    Worldconst:Array[0..worldlen-1] of Integer =
    (-200,-200,-200,
    -200,-200,200,
    -200,200,-200,
    -200,200,200,
    200,-200,-200,
    200,-200,200,
    200,200,-200,
    200,200,200);
    surfclen=38;                {Surface-Array}
    surfcconst:Array[0..surfclen-1] of Word=
    (0,4, 0,2,6,4,
     0,4, 0,1,3,2,
     0,4, 4,6,7,5,
     0,4, 1,5,7,3,
     0,4, 2,3,7,6,
     0,4, 0,4,5,1,0,0);

Var
    i,j:Word;


procedure drawworld;external;   {Draws the world on current video page}
{$l 3dasm.obj}
{$l poly.obj}
{$l bres.obj}
{$l root.obj}

Begin
  vz:=1000;                     {solid is located at 1000 units depth}
  vpage:=0;                     {start with page 0}
  init_modex;                   {enable ModeX}
  rotx:=0;                      {initial values for rotation}
  roty:=0;
  rotz:=0;
  Fill:=false;                  {SurfaceFill off}
  sf_sort:=false;               {SurfaceSort off}
  sf_shift:=false;              {SurfaceShift suppression off}
  Glass:=false;                 {glass surfaces off}
  repeat
    clrx($0f);                  {clear screen}
    DrawWorld;                  {draw world}
    switch;                     {switch to finished picture}
    WaitRetrace;                {wait for next retrace}
    Inc(rotx);                  {continue rotating ... }
    If rotx=120 Then rotx:=0;
    Inc(rotz);
    If rotz=120 Then rotz:=0;
    inc(roty);
    if roty=120 Then roty:=0;
  Until KeyPressed;             { ... until key}
  TextMode(3);
End.
