I have a basic 3D model (a rectangular box from an FBX file format) imported in Threejs with an applied texture. I need to scale it horizontally and vertically without stretching the texture but repeating it as infinite pattern.
If I scale it horizontally that’s the result:
I also looked at this thread: https://discourse.threejs.org/t/updating-uv-coordinates-of-buffergeometry/9180
where I need to obtain the similar effect in and I tried to apply the solution that “Mugen87” proposed.
Nevertheless the texture seems to be stretched as the uvs don’t update correctly.
Here is the code that I use:
As you see I update the model coordinates but the uvs don’t change.
I also set the textures like this:
const texture = new THREE.TextureLoader().load( ‘models/mensola/texture/34056_SU_CENERE.jpg’ );
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
texture.repeat.set( 1, 1);
texture.needsUpdate = true;
but it doesn’t seem to work.
Can you please help me?
Thanks a lot,