Uvs on regular meshes

When I use the solid particle system, I get access to:

particle.uvs.x = 0.2; // left lower corner : 20% image width
particle.uvs.y = 0.1; // left lower corner : 10% image height
particle.uvs.z = 0.6; // right upper corner : 60% image width
particle.uvs.w = 0.3; // right upper corner : 30% image width

When I create a mesh with a material and texture, I can’t find this same functionality. To me, it makes more sense to give the upper left corner and lower right corner of the texture atlas than to use:

U offset
V offset
U scale
V scale

Thanks,

You can for some meshes

1 Like

Thanks for the response. I worry I am missing something.

the FaceUv is attached to the mesh. The uOffset, vOffset, uScale, vScale, uAng, vAng, wAng are attached to the texture. No uvs controls seem to be referenced with the Material.

the uOffset (etc) and .uvs seem to refer to the faceUV[0] and the other faceUV[1] etc., are relative to faceUV[0].

the faceUV array has to be know at the time the mesh is created and can’t be applied or modified later.

I am just wondering if this is correct.

You are correct.

This PG show that you can apply bottom left and top right uv values across an existing mesh.

https://playground.babylonjs.com/#H03W2D

To apply this type of mapping to a texture should be possible. You could put in a feature request to see how popular it might be.

Thanks John,

That answers my question.