is it possible to change color of perticular part of 3d model in three.js ?
i am creating a webpage where i am showing indicator at each part and when use selct any indicator or 3d part then i want to make it selectable i mean i need to change color or opacity if that pertuicular part. If it is possible then please guide me.I need guidence beacuse with single mesh i am not able to do that. In single mesh whole object color is changing when i change color of perticular part.
One way is to find the mesh part you are interested in using the .getObjectByName method and change it as you want… As long as you have named the parts appropriately in e.g. Blender.
const model = gltf.scene;
const part = model.getObjectByName(‘changeable_part’);
This indicates that all parts share a common material, in changing the color of that one material all parts will be affected, you can achieve individual color picking per “part” by either A) cloning the base material and assigning a unique clone to each part of the model, or B) use one common material, enable vertexColors on the material and change the vertexColors and vertexAlphas per object
I have model of roundcut diamond.
Look at this
can anyone help me with this ?
this is diamond so i am showing model like diamond but i want to highlight selected part so anyone can understand all things about diamonds.