Cool, will try this out, thanks a lot!
Tight fit point cloud into view frustum
![](https://uploads.gamedev.net/forums/monthly_2020_06/0af948feb1ff4f8c8bf20e08a4f1cbcd.image.png)
You were right - this would be a valid solution but all points end up behind the camera.
So you need to include the front clip plane too (short line) to make sure all points are in front.
I finally had the time to implement this solution and it worked perfect! And as you said, I had to make sure all of the points were in front for it to work.
Also something that I would like to mention in case someone comes looking to solve my same problem, I had to make one change regarding the distance calculation. I was taking the shortest distance from each point to the (nearest) plane, but that wasn't working as expected, so instead I ended up taking the shortest distance from the point to the plane intersection in the reverse camera direction ( image below):
![](https://uploads.gamedev.net/forums/monthly_2020_07/8fa106de1b9f43789748b6f0b47d0de8.imagen.png)
Thanks JoeJ, also I just noticed that you replied to the other thread I just created a few days ago, you are very helpful!