Threejs: assign different colors to each vertex in a geometry
It has to be geometry.vertexColors instead of geometry.colors (push a colour per vertex). And the material: material = new THREE.MeshBasicMaterial({ vertexColors: THREE.VertexColors });
It has to be geometry.vertexColors instead of geometry.colors (push a colour per vertex). And the material: material = new THREE.MeshBasicMaterial({ vertexColors: THREE.VertexColors });
If you can, do the picking on the CPU by calculating a ray from the eye through the mouse pointer and intersect it with your models. If this isn’t an option I would go with some type of ID rendering. Assign each object you want to pick a unique color, render the objects with these … Read more