Get texture to fixed when scaling circular meshes

Hi,

I’ve applied a texture to a circular mesh (disc). I want to incrementally decrease the size of the disc by scaling it. I’m changing the uScale and vScale of the texture since I want the size to remain the same, but what happens is that the texture is moving as the mesh is scaling.

Here is an example of what’s happening: https://playground.babylonjs.com/#HRJIQX#5

So what I want to achieve is that the texture is “fixed” when scaling just as it is on the box in the example. Any ideas on how to do this?

Thank you.

Welcome aboard!

You will need to change the uOffset and vOffset values of the texture, something like:

https://playground.babylonjs.com/#HRJIQX#6

or:

https://playground.babylonjs.com/#HRJIQX#7

Depending on the effect you want to achieve.

Thanks a lot! Was exactly what I wanted to achieve :slight_smile: