Setting the Universal Camera Bounds so that a plane fills the viewport

Hello,
i was wondering how I can set the UniversalCamera’s z position to make a plane fill a certain percentage of the viewport.
I created this playground, where I load a texture an on loaded create the plane.
Now since in my application that texture can have various sizes, I was wondering how to calculate the correct camera z position to fill lets say 80% of the viewport size.
Thanks a lot

You need to basically reverse the maths creating the projectionof the camera to find the position.

This will help Make a Perfect Plane to Fit Frustum - Questions & Answers - HTML5 Game Devs Forum

1 Like

Thanks.
i will dissect whats written.

1 Like