Scaling a face uv of a Babylonjs created box geometry using the gui slider value?

Hey guys,

I am digging into the Mesh creation documentation of BabylonJS. In the following BJS Playground,
I am trying to figure out how to match the scaling/stretching of a BJS MeshBuilder box face UV to the scaling of that box in 3D. The scaling is controlled by a GUI slider.

box scale uv stretch | Babylon.js Playground

In this example, the box stretches horizontally in 3D as intended. What is not working and what I want is for the face uv to compensate for this scaling and maintain the integrity of the mapped texture.

Thanks.

The uv vertex data is an array of numbers, not Vector4:

2 Likes

Thank you so much. It works!

1 Like