I have been experimenting with dynamically changing the color of a selected vertex. Based on my work at https://jsfiddle.net/pmankar/m70cpxes/, I constructed an IcosahedronGeometry point cloud geometry. When a click event occurs, my goal is to alter the color of vertex 100
.
document.addEventListener('click', function() {
mesh.geometry.colorsNeedUpdate = true;
mesh.geometry.colors[100] = new THREE.Color("rgb(255,0,0)");
console.log(mesh.geometry);
})
Currently, I have two queries:
- How can I successfully change the colors of vertex
100
? - What might be causing the point cloud to display random colors?