How can I change Mesh material with external image ( must be fit image on material dimensions )

Hi,
I’m trying change a mesh material with external images.
here is my code block ;

            let txt = new THREE.TextureLoader().load(color.texture);
            txt.flipY = false;

            txt.wrapS = THREE.RepeatWrapping;
            txt.wrapT = THREE.RepeatWrapping;

            txt.repeat.set(1, 1);
            txt.offset.set(0, 0);

            new_mtl = new THREE.MeshPhongMaterial({
                map: txt,
                shininess: color.shininess ? color.shininess : 10
            });

            currMesh.material = new_mtl ;

its working but result is ;Adsız

my goal is :
hodo

anyone could help me ?
thanks…

The code looks good so far. Any chances to demonstrate the issue with a live example?

Hi Mugen87,
thanks for reply.

codepen link : https://jsfiddle.net/jemcy46t ( you can see codes here but not works )
live demo link http://3d.lineajans.net/

when you are visit live demo link you will see 3 clickable div on left side.
first div changing front of suit
second div changing back of suit
third div changing center of suit

could you try to change third mesh ? ( select third div and select logo in bottom left )

on live text repeat code is ( for see ) :

    const timesToRepeatHorizontally = 15;
const timesToRepeatVertically = 20;
txt.repeat.set(timesToRepeatHorizontally, timesToRepeatVertically);