Graph3D в PascalABC.Net

Броуновское движениеПравить

uses Graph3D;

var
  Objects: List<SphereT>;

begin
  Objects := new List<SphereT>();
  for var i := 0 to 99 do
    Objects.Add(Sphere(-10 + Random(20), -10 + Random(20), -10 + Random(20), 1, RandomColor()));
  
  while true do
    for var i := 0 to Objects.Count - 1 do
      Objects[i].MoveOn((1 - Random(3)) / 10, (1 - Random(3)) / 10, (1 - Random(3)) / 10);
end.

Аналог 2D:

uses ABCObjects, GraphABC;
begin
  var W := Window.Width;
  var H := Window.Height;
  
  for var i := 0 to 100 do
  begin
    var c := clRandom();
    new CircleABC(Random(W), Random(H), 10 + Random(10), ARGB(100, c.R, c.G, c.B));
  end;
  
  while true do
    for var i := 0 to Objects.Count - 1 do
      Objects[i].MoveOn(Random(3) - 1, Random(3) - 1);
end.