Calculate the camera radius so that a plane fills the viewport

Hi, I have added a transparent plane, but now I’m stuck with the math. The plane has the same proportion as the canvas. I want the plane to fill the viewport.

I think I need to calculate an appropriate radius for the camera.

Did you have a look to the framing behavior: Camera Behaviors | Babylon.js Documentation

I finally made it after looking at the BabylonJS code for a long time:

1 Like