- Home /
Question by
xavq · Feb 06, 2013 at 05:30 PM ·
scalebackgroundplanefill
Scale plane to resolution
I need scale a plane with texture used as background to screen resolution with a orthographic camera.
I am implementing a page of a book (plane used as background) and i need animate the plane, this is the reason I use a plane and not a guitexture.
Anyone can help me?
Comment
The needed sice will depend on to variables: 1st the distance between camera and plane. 2nd the field of view you are using. It is pretty much geometry homework. Why don't you just scale the plane manually and watch the game view during scaling?
Answer by robertbu · Feb 06, 2013 at 05:49 PM
In Orthographic mode, the Camera.orthographicSize is 1/2 of the vertical size. You can use the ratio of Screen.height/Screen.width to get the width in world coordinates. Something like:
height = Camera.main.orthographicSize * 2.0f;
width = height / Screen.height * Screen.width;
Your answer
![](https://koobas.hobune.stream/wayback/20220613092245im_/https://answers.unity.com/themes/thub/images/avi.jpg)