Still can't get raycaster to work on non page-filling canvas with large coordinates

I am trying to get raycaster to work for my pointcloud using OrbitControls and a PerspectiveCamera. I am loading data from a pcd file (generated in open3d in python). The coordinates are light years, and very large (esp x and z are in the 1000’s).
The canvas only uses part of the page, but I think I managed to at least get the mouse coordinates correctly now by using renderer.getContext().canvas.getBoundingClientRect() to get the bounds of the canvas. When I hover with my mouse I do get mouse coordinates between -1 to 1 for both x and y. But if I then do a raycaster.setFromCamera(mouse, camera), no points are found to intersect. I’m not sure what the cause is.
With the mouse in the top right corner, and a point there too, I log both the calculated mouse coordinates and then log the raycaster.ray and get these results:

It’s not clear to me from the docs what unit/coordinate system the “direction” should be in, but the numbers look a bit low if you compare it to the origin, which seems to be the correct camera position.

I have a working demo on http://allican.be/elitedangerous_3d_mapping/ with the code on https://github.com/dolfandringa/elitedangerous_3d_mapping/blob/cd9083afde539af13a02a76ec5f46ec7b08cb142/docs/index.js

You have to call intersectObjects() like so:

let intersects = raycaster.intersectObjects( scene.children, true );

Notice the second parameter. If set to true, all descendants are checked as well. Consider to use intersectObject() and directly pass in your point cloud.

BTW: Please do not create an instance of Vector2() in onMouseMove(). Create the vector object once in module scope and then just reuse it.

Besides, keep in mind that you raycast against a point cloud. This code will make the entire point cloud red, not just individual points:

Besides, Material.colorNeedsUpdate does not exist. I suggest you study how the following official example works:

https://threejs.org/examples/webgl_interactive_points

Cool, yeah, the recursive part was what I missed. Thanks for that. The color I knew already, just wanted predictable behavior first.