Hi there,
I try to build a 3D Model Viewer, where you can change the color of different parts of the model.
So far so good.
Is there a way to keep the transparency of the given material and still change the base color?
// part-i set default colores from DB
INITIAL_MAP.push({
childID: `part-${String(i+1).padStart(3, '0')}`, // padding the number
mtl: new THREE.MeshPhongMaterial({ color: parseInt(COLOR_ARRAY[i]), shininess: 10, transparent: true })
})
With transparency and no change of color (default)
NO transparency after adding new colors to part-001…
Is MeshPhongMaterial the right thing to change color or is there a better way to change the color without replacing the material?
P.S. transparent: true ?
EDIT: OK! So some time after work and a nice start into the weekend i realised, that iam creating new materials and replacing the old on, so no way to keep transparency this way. I just need to use a set method in my changecolor function.
o.material.color.set(COLOR_ARRAY[i]);
I hope this will do the trick. Sad that i need to wait until monday to test it…