see how im scaling Y the line before return scene?
tiledBox.scaling.y = 20;
That is whats stretching the TiledBox.
Is there a way to resize the box while the texture of the box is still tileable?
i only manage to do so disposing the box and creating it again from scratch with the new height passed as parameter, otherwise the walls look like the picture above.
mmmmm, i understand, but that would resize the texture everywhere.
I want to be able to have different sized walls. It seems i would need to:
a. Dynamically create one texture per different height to apply the correct uvs to them OR…
b. Dispose and recreate the box with the CreateTiledBox that receives height just fine.
Heres what im trying to achieve…
The goal is to create blocks of 1x1x1 that can grow and shrink in Y keeping it tileable look.
I have, lets say, 10 blocks, with different ground sprites, hidden in the scene.
All blocks would have the same texture (atlas) but with different uvs.
Every time i need to place a new cube somewhere, I create an instance of one of those (because they share the same vertex and uvs).
Tiles should be able to have any height, forming walls and stairs and whatnot. Thats the goal.
But its still a 2D map of tiles. Not a 3D one. The size is just a decorative factor to give terrain effect (higher or lower tiles).
Scaling the Y work just fine, but the texture gets stretched as stated before…
Id love something like this to exist:
MeshBuilder.UpdateTiledBox(“box”, {height: 20}, scene)
Any other WA? I will continue exploring this further…
Thanks