procedure TForm1.FormCreate(Sender: TObject); var LSrcObj : TPlane; LPoolE : TGorillaBitmapPoolEntry; LGrassMat : TGorillaGrassMaterialSource; LAlg : TGorillaAssemblerFlatFilling; begin // creating the source object - here a plane LSrcObj := TPlane.Create(fGorilla); LSrcObj.Scale.Point := Point3D(4, 4, 4); // creating the grass material source FGrassMat := TGorillaGrassMaterialSource.Create(FGorilla); FGrassMat.Parent := FGorilla; // now we load a pool of grass textures, the material shader // randomly chooses from with FGrassMat do begin LPoolE := Bitmaps.Add() as TGorillaBitmapPoolEntry; LPoolE.DisplayName := 'Grass1'; LPoolE.Bitmap.LoadFromFile('grass1.png'); LPoolE := Bitmaps.Add() as TGorillaBitmapPoolEntry; LPoolE.DisplayName := 'Grass2'; LPoolE.Bitmap.LoadFromFile('grass2.png'); LPoolE := Bitmaps.Add() as TGorillaBitmapPoolEntry; LPoolE.DisplayName := 'Grass3'; LPoolE.Bitmap.LoadFromFile('grass3.png'); LPoolE := Bitmaps.Add() as TGorillaBitmapPoolEntry; LPoolE.DisplayName := 'Grass4'; LPoolE.Bitmap.LoadFromFile('grass4.png'); end; // creating the model assembling control FGrass := TGorillaModelAssembler.Create(FGorilla); FGrass .Parent := FGorilla; FGrass.AddSourceObject(LSrcObj); FGrass.MaterialSource := LGrassMat; FGrass.SetSize(GORILLA_ASSEMBLER_SIZE, GORILLA_ASSEMBLER_SIZE, GORILLA_ASSEMBLER_SIZE); // create an individual filling algorithm to multiply the grass planes // on elder Gorilla3D version TGorillaAssemblerRectFilling LAlg := TGorillaAssemblerFlatFilling.Create(FGrass); try LAlg.Count := 1000; FGrass.Fill(LAlg, true); finally FreeAndNil(LAlg); end;