If you donβt assign your points to something like a BSP tree , you will have to go through them all to see if they are visible or not.
However, using some spatial hierarchy, you can quickly decide which points are not visible. For example, if you divide your space into a grid of 10 x 10 x 10 cells and assign points to one of the cells, you can then check the bounding box of each cell to determine if that cell is visible or not. So if you have 100,000 points, you will have 1000 cells and (if your points are evenly distributed), you will check 6 points (box corners) instead of 100 for each cell.
You can quickly determine which cells are fully visible or completely invisible, and then you only need to check the contents of those cells that are partially visible.
Expanding the hierarchy, so your top-level cells contain smaller cells, not points that you can handle large point clouds.
You can also resize the cells so that they all contain the same number of points.
source share