Box texture has different rotation on different sides

Hello,

I’ve applied a diffuseTexture to a box, but not all sides have the same rotation/orientation, why is this and how can i make all sides have the same rotation?

image

PG: https://playground.babylonjs.com/#1B2ZC3#1

Does perhaps this example give you enough guidance on rotating the pattern on the faces?

This example uses a “tiled box”, where the side rotation seems to be adjusted automatically (?), in my case I’m trying to apply a diffuseTexture on a simple box :confused:

Have you seen this? Map Materials to Individual Mesh Faces | Babylon.js Documentation (babylonjs.com)

1 Like

This seems to be the only solution, I thought there might be a property of the mesh I can change to correct the orientation… Thanks :+1:

after a bit more researching it seems like there is:
var mesh = new BABYLON.MeshBuilder.CreateBox("box, {size: 1, wrap: true}, scene);

using wrap: true does the trick.