# Calculate the camera radius so that a plane fills the viewport

**URL:** <https://forum.babylonjs.com/t/calculate-the-camera-radius-so-that-a-plane-fills-the-viewport/17194>\
**Category:** Questions\
**Created:** [January 5, 2021, 12:59pm UTC](https://forum.babylonjs.com/t/calculate-the-camera-radius-so-that-a-plane-fills-the-viewport/17194 "2021-01-05T12:59:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maz](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@maz](https://forum.babylonjs.com/u/maz)\
**Post date:** [January 5, 2021, 12:59pm UTC](https://forum.babylonjs.com/t/calculate-the-camera-radius-so-that-a-plane-fills-the-viewport/17194/1 "2021-01-05T12:59:49Z")

</div>

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.

> **[Babylon.js Playground](https://playground.babylonjs.com/#MY7PR1%232)**

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [January 5, 2021, 4:26pm UTC](https://forum.babylonjs.com/t/calculate-the-camera-radius-so-that-a-plane-fills-the-viewport/17194/2 "2021-01-05T16:26:56Z")

</div>

Did you have a look to the framing behavior: [Camera Behaviors | Babylon.js Documentation](https://doc.babylonjs.com/divingDeeper/behaviors/cameraBehaviors#framing-behavior)

---

<div class="post-metadata">

**Author:** ![maz](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@maz](https://forum.babylonjs.com/u/maz)\
**Post date:** [January 5, 2021, 8:27pm UTC](https://forum.babylonjs.com/t/calculate-the-camera-radius-so-that-a-plane-fills-the-viewport/17194/3 "2021-01-05T20:27:23Z")

</div>

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

> **[Babylon.js Playground](https://playground.babylonjs.com/#MY7PR1%233)**
