Remap UV coordinates proportionally after scaling

Hey all!

For a table Configurator project i have imported some table models made in Blender.
Right now i’am trying to scale the table’s length/width according to a certain user input. However, when scaling the original blender table model, the textures also get stretched.

In order to prevent this i think i would have to remap the UV’s on the geometry after scaling. I’ve tried several things, like: scaling the u coordinate with the geometry
u = u*scale_factor_x, this does seems to help a little bit, but it still offsets the texture, and doesn’t scale down proportional.

I think there might be some trick with the Minimal and Maximal U coordinates but my knowledge is not yet deep enough to fully grasp this concept.
If you have any tips or tricks for me, (or can point me in the right direction), please let me know!

Kind regards.

Darryn

Maybe you can just change texture repeating scale like:

tex["floor"]=texture_loader.load("images/floor.jpg");
tex["floor"].wrapS=tex["floor"].wrapT=THREE.RepeatWrapping;
tex["floor"].repeat.set(1,1);

Scaling to 1.7,1.9 change:
tex[“floor”].repeat.set(1.7,1.9);

Wow that was easy…

Thanks alot!

1 Like