Dynamic Change Material for selected part

Hello,

How can change material for specific selected portion.

https://jsfiddle.net/AmitTank/su7r1byv/51/

For Ex. from this fiddle.

If I Click on Liver it should be change to set color or set material.

Now if I am click it change whole model color.

any suggest how to do it ?

You apply the same material to all parts of your model.
Try this, when you load your model, set an individual material with the same parameters to each part:

child.material = new THREE.MeshStandardMaterial({map: texture, roughness: 0, metalness:0.4, fog:true, skinning:true});

https://jsfiddle.net/prisoner849/su7r1byv/54/

1 Like

Thanks Prisoner849,

Slowly slowly now I am getting how three.js is working :slight_smile: