I have Three.Geometry object consisting of many vertexes and faces (grid). I want to dynamically change the color or material of selected face.
geometry.colorsNeedUpdate = true;
geometry.faces[1].color.setHex(0xcccccc); //this doesn't work
Above code makes new color opacity weird. It behaves like it doesn't replace the color but blends new color with old. Therefore overwriting darker color with ligher is imposible. How to fix this ? My materials do apply :
mat = new THREE.MeshBasicMaterial({color:"white",shading: THREE.FlatShading,side: THREE.DoubleSide,vertexColors: THREE.FaceColors, needsUpdate : true});
Another approach i wanted to do is also with changing the reference to other material:
geometry.faces[0].materialIndex = 1; // works only when disabled OpenGL in browser
Already set material.needsUpdate flag to true
and checked https://github.com/mrdoob/three.js/wiki/Updates
still no change.