home *** CD-ROM | disk | FTP | other *** search
/ PC Interdit / pc-interdit.iso / graph / 3d_fil.pas < prev    next >
Pascal/Delphi Source File  |  1994-10-17  |  2KB  |  59 lines

  1. Uses Crt,ModeXLib,var_3d;
  2.  
  3. Const
  4.     worldlen=8*3;               {tableau des points }
  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;                {tableau des faces }
  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;   {dessine l'espace des objets dans la page d'écran courante }
  28. {$l c:\edition\prog\fr\asm\3dasm.obj}
  29. {$l c:\edition\prog\fr\asm\poly.obj}
  30. {$l c:\edition\prog\fr\asm\bres.obj}
  31. {$l c:\edition\prog\fr\asm\racine.obj}
  32.  
  33. Begin
  34.   vz:=1000;                     {profondeur de l'objet }
  35.   vpage:=0;                     {commence en page 0}
  36.   init_modex;                   {active le mode X }
  37.   rotx:=0;                      {rotation initiale }
  38.   roty:=0;
  39.   rotz:=0;
  40.   Remplir:=false;               {pas de remplissage }
  41.   su_sort:=false;               {pas de tri des faces}
  42.   su_cacher:=false;             {pas de traitement des faces cachées }
  43.   verre:=false;                 {pas de face en verre }
  44.   repeat
  45.     clrx($0f);                  {efface l'écran }
  46.     DrawWorld;                  {dessine l'espace des objets }
  47.     switch;                     {active l'écran }
  48.     WaitRetrace;                {attend le prochain retour de balayage }
  49.     Inc(rotx);                  {poursuit la rotation ... }
  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;             { ... jusqu'à frappe de touche }
  56.   TextMode(3);
  57. End.
  58.  
  59.