MODULE Rings3000b;


(*****************************************************************************)
(*                                                                           *)
(*  Modul: Rings3000                       Version 1.0 vom 1. November 1990  *)
(*                                                                           *)
(*  Für M2Amiga Modula-2 von Olaf Pfeiffer                                   *)
(*                                                                           *)
(*---------------------------------------------------------------------------*)
(*                                                                           *)
(*  Unterschied zu Rings: Interlace-Modus und Auflösung der Ringe.           *)
(*                                                                           *)
(*****************************************************************************)

(* $F- $R- $V- $N- *)

FROM Dos          IMPORT Delay;
FROM GfxDecs      IMPORT GfxMode, GfxPtr, Voxel, Direction, ScenePtr, Pixel;
FROM GfxSystem    IMPORT OpenStdGfx, CloseGfx, ClearGfx, GfxToFront;
FROM Camera       IMPORT SetCameraTo;
FROM System3D     IMPORT SetVoxelTo, SetDirectTo, AddDirect;
FROM SceneLib     IMPORT InitScene, EndScene, TurnObjectX, RecolorObject;
FROM ShapeLib     IMPORT RotatePoly;
FROM ShowScene    IMPORT ShowGrid, HiddenLine, HiddenSurface, SimpleTrace;
FROM ColorLib     IMPORT SetColors, SetEHBColors;

VAR Gfx:         GfxPtr;
    Scene:       ScenePtr;
    Lin:         ARRAY [0..12] OF Pixel;
    tur,add:     Direction;
    pos:         Voxel;
    n:           INTEGER;
    bool:        BOOLEAN;

BEGIN
  Gfx := OpenStdGfx(EHB,TRUE);
  SetColors(Gfx,0,0,"666 A46 46A A4A 777 000");
  SetEHBColors(Gfx,0,"A46 46A A4A 777 000");
  Scene := InitScene();
  Lin[0].x  := -5000; Lin[0].y  := 13000;
  Lin[1].x  := -4330; Lin[1].y  := 15500;
  Lin[2].x  := -2500; Lin[2].y  := 17330;
  Lin[3].x  :=     0; Lin[3].y  := 18000;
  Lin[4].x  :=  2500; Lin[4].y  := 17330;
  Lin[5].x  :=  4330; Lin[5].y  := 15500;
  Lin[6].x  :=  5000; Lin[6].y  := 13000;
  Lin[7].x  :=  4330; Lin[7].y  := 10500;
  Lin[8].x  :=  2500; Lin[8].y  :=  8670;
  Lin[9].x  :=     0; Lin[9].y  :=  8000;
  Lin[10].x := -2500; Lin[10].y :=  8670;
  Lin[11].x := -4330; Lin[11].y := 10500;
  Lin[12].x := -5000; Lin[12].y := 13000;
  SetDirectTo(tur,0,0,0);
  SetVoxelTo(pos,0,6500,0);
  RotatePoly(Scene,"1.Thorus",72,13,Lin,tur,pos,1);
  SetDirectTo(tur,0,900,0);
  SetVoxelTo(pos,0,-6500,0);
  RotatePoly(Scene,"2.Thorus",72,13,Lin,tur,pos,2);
  RecolorObject(Scene,"1.Thorus",TRUE,3);
  RecolorObject(Scene,"2.Thorus",TRUE,4);
  SetDirectTo(tur,200,80,0);
  SetDirectTo(add,-175,500,-280);
  FOR n := 1 TO 3 DO
    SetCameraTo(Gfx,100,tur,0,0,0);
    ClearGfx(Gfx);
    ShowGrid(Gfx,Scene);
    TurnObjectX(Scene,"1.Thorus",100);
    AddDirect(tur,add);
  END;
  FOR n := 1 TO 3 DO
    SetCameraTo(Gfx,100,tur,0,0,0);
    ClearGfx(Gfx);
    HiddenLine(Gfx,Scene);
    Delay(50);
    AddDirect(tur,add);
  END;
  FOR n := 1 TO 3 DO
    SetCameraTo(Gfx,100,tur,0,0,0);
    ClearGfx(Gfx);
    HiddenSurface(Gfx,Scene,-1);
    Delay(50);
    AddDirect(tur,add);
  END;
  RecolorObject(Scene,"1.Thorus",TRUE,1);
  RecolorObject(Scene,"2.Thorus",TRUE,2);
  FOR n := 1 TO 3 DO
    SetCameraTo(Gfx,100,tur,0,0,0);
    ClearGfx(Gfx);
    HiddenSurface(Gfx,Scene,-1);
    Delay(50);
    AddDirect(tur,add);
  END;
  EndScene(Scene);
  CloseGfx(Gfx);
END Rings3000b.


