I've been working on rendering a point cloud and attempting to select a single point, but unfortunately, the method raycaster.intersectObjects(scene.children, true) is returning an empty array. I've tried various methods to calculate the pointer.x and pointer.y without success.
Take a look at my CodePen here: https://codepen.io/joshua-holly-fraunhofer/pen/VwyGBVO
Any ideas on what could be going wrong?
function onMouseUp(event) {
event.preventDefault();
const raycaster = new THREE.Raycaster();
const pointer = new THREE.Vector2();
pointer.x = (event.clientX / window.innerWidth) * 2 - 1;
pointer.y = -(event.clientY / window.innerHeight) * 2 + 1;
raycaster.setFromCamera(pointer, camera);
const intersections = raycaster.intersectObjects(scene.children, true);
console.log(intersections); // Returns an empty array
}