Good day!
I use TDrawableImage
for procedural generation of tiled textures. You showed me this method in my previous topic:
For now I want to make cycled texture for imitation of 360-degree observe in 2D Viewport. And, when background texture is generated, I want slice it at two parts for make two cycled scenes.
As I understand, DrawFrom
of TCastleImage
have properties ti do it. But I don’t see possibility to do it with DrawFrom
of TDrawableImage
…
My algorithm is:
...
Canv := TDrawableImage.Create(Tiles.TileW * Ints.Count, 1024, TRGBAlphaImage, True);
// tile texture generation...
DrawblImg := TDrawableImage.Create(Trunc(Canv.Width/2), 1024, TRGBAlphaImage, True);
DrawblImg.DrawFrom(Canv,
FloatRectangle(0, 0, Canv.Width, Canv.Height),
Canv.FloatRect);
FinalImage := DrawblImg.GetContents(TRGBAlphaImage);
Result.NorthWest.LoadFromImage(FinalImage, True);
// Result is class for cycled 2D terrain,
// NorthWest and SouthEast fields - modified TCastleImageTransform's
In this code I load left part (“north” and “west” of the my landscape) to result image.
But I can’t do same thing for right part with “south” and “east”.
So… How to slice TDrawableImage
at two part for drawing in different scenes?
P.S. for now my generation algorithm became more complex and generation of NorthWest
and SouthEast
parts separately seems little difficult, because they depend on each other…