Hi,
I’m trying to update the Watch dialer with another dialer, and that images are in PNG format on Click event.
But when i update the image it will adding some strips in image.
I don’t know where i’m doing wrong and i try many solution but alas. I also even try with THREE.MeshPhongMaterial but nothing helps.
Here’s they code i’m using currently
function selectSwatch(e) {
let color = colors[parseInt(e.target.dataset.key)];
let new_mtl;
let txt = new THREE.TextureLoader().load(color.texture);
// txt.wrapS = THREE.RepeatWrapping;
// txt.wrapT = THREE.RepeatWrapping;
txt.repeat.set(1,1,1);
txt.flipY = false;
new_mtl = new THREE.MeshStandardMaterial( {
map: txt,
shininess: color.shininess ? color.shininess : 10
});
setMaterial(theModel, activeOption, new_mtl);
}
function setMaterial(parent, type, mtl) {
parent.traverse(o => {
if (o.isMesh && o.nameID != null) {
if (o.nameID == type) {
console.log(o.material);
console.log(o.material.needsUpdate);
o.material = mtl;
}
}
});
}
Original 3D model:
After update the image:
Dialer Image: