Changing faceUV after mesh created


I’m wondering if there’s any recommend function or approach to change faceUV of meshes I’ve created or imported?

Something like fellowing:

var faceUV = new Array(6);
for (var i = 0; i < 6; i++) {
    faceUV[i] = new BABYLON.Vector4(i / columns, 0, (i + 1) / columns, 1 / rows);
var box = BABYLON.MeshBuilder.CreateBox('box', scene);
box.faceUV = faceUV;

The reason of doing this is that I want to change the texture of a specific face of the meshes in the imported model, so I can change it whenever the designer want the picture of that mesh changed.

Thanks and have a nice day~

You can get the existing UVs, change them for one of the faces, and then set the UVs. Here’s a little example that changes the front face’s UVs every 500 ms. :slight_smile:


Oh, That is an impressive demo!
Thanks, for helping!

1 Like