Hallo,
ich möchte mit zwei forschleifen unterschiedliche große objekte erzeugen hier ist mein code:
Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
var
cub:TGLCube;
x,z,i:Integer;
begin
for x:=0 to 50 do begin
for z:=0 to 50 do begin
cub:=TGLCube(GLScene1.objects.AddNewChild(TGLCube));
cub.CubeDepth:=random(10)+2;
cub.CubeWidth:=random(10)+2;
cub.Position.X:=(x)*cub.CubeWidth;
cub.Position.y:=4;
cub.Position.z:=(z)*cub.CubeDepth;
cub.Material.FrontProperties.Diffuse.Red:=random;
cub.Material.FrontProperties.Diffuse.Green:=random;
cub.Material.FrontProperties.Diffuse.Blue:=random;
end;
end;
GLSphere1.position.y:=50;
GLSphere1.Position.x:=60;
GLSphere1.Position.z:=60;
end;
doch leider sind abstände zwischen den objekten und ich weiß nicht warum !