Hello friends, good time
I am using the RayCaster class to color the coordinates of the mouse click point.
I use this code to paint:
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
function onPointerMove(event) {
pointer.x = (event.clientX / window.innerWidth) * 2 - 1;
pointer.y = - (event.clientY / window.innerHeight) * 2 + 1;
raycaster.setFromCamera(pointer, camera);
const intersects = raycaster.intersectObjects(scene.children);
try {
for ( let i = 0; i < intersects.length; i ++ ) {
intersects[i].object.material.color.set(0x3d2d3d);
}
renderer.render( scene, camera );
}
catch (e) {
console.log(e.message);
}
}
Now my question is how to color the clicked coordinates?
thanks for your view