Comments and answers for "How to scale a plane & fit it screen..?"
http://answers.unity.com/questions/491826/how-to-scale-a-plane-fit-it-screen.html
The latest comments and answers for the question "How to scale a plane & fit it screen..?"Comment by speedacidrain on speedacidrain's answer
http://answers.unity.com/comments/1419831/view.html
Thanks!!!!Thu, 12 Oct 2017 20:07:46 GMTspeedacidrainComment by Serotonindude on Serotonindude's answer
http://answers.unity.com/comments/1126913/view.html
hi,
the distance of the plane from the camera's origin (along the forward vector)Thu, 14 Jan 2016 08:19:01 GMTSerotonindudeComment by danny7 on danny7's answer
http://answers.unity.com/comments/1126852/view.html
Hey, for this example, what's the distance variable?
ThanksThu, 14 Jan 2016 03:43:40 GMTdanny7Answer by Serotonindude
http://answers.unity.com/answers/1037187/view.html
**ATTENTION:**
If you try the correct, simplified formulas
var height = 2.0 * Mathf.Tan(0.5 * Camera.main.fieldOfView * Mathf.Deg2Rad) * distance;
var width = height * Camera.main.aspect;
with *Unity planes* consider, that a plane in Unity with the scale 1 is actually 10 units in size (wtf?!), in contrast to every other basic primitive (cube, sphere, etc...).
It took me 6 hours to find out, why i had to divide the height by 10 to match the screen.Fri, 28 Aug 2015 12:07:52 GMTSerotonindudeComment by scottstephan on scottstephan's answer
http://answers.unity.com/comments/922476/view.html
What is distance in this example?Thu, 12 Mar 2015 19:01:20 GMTscottstephanComment by robertbu on robertbu's answer
http://answers.unity.com/comments/772699/view.html
Yep. Thanks. Fixed my answer.Sun, 17 Aug 2014 14:51:18 GMTrobertbuAnswer by RobDaPraia
http://answers.unity.com/answers/772622/view.html
Thanks a lot, small typo:
var height = 2.0 * Mathf.Tan(0.5 * Camera.main.fieldOfView * Mathf.Deg2Rad) * distance;
var width = height * Screen.height / Screen.width;
Should be:
var height = 2.0 * Mathf.Tan(0.5 * Camera.main.fieldOfView * Mathf.Deg2Rad) * distance;
var width = height * Screen.width / Screen.height;Sun, 17 Aug 2014 14:20:48 GMTRobDaPraiaAnswer by robertbu
http://answers.unity.com/answers/491858/view.html
At any given distance from the camera, you can calculate the size of a plane to fill the camera by:
var height = 2.0 * Mathf.Tan(0.5 * Camera.main.fieldOfView * Mathf.Deg2Rad) * distance;
var width = height * Screen.width / Screen.height;
But if you are just trying to resize a plane for different resolutions, size the plane in the editor so that the height fits then do the second line of the calculation above to get the width in a script.Fri, 12 Jul 2013 14:12:06 GMTrobertbu