Search Unity

Is a 'Quad' really 4:3 aspect?

Discussion in 'General Graphics' started by San_Holo, Dec 11, 2014.

  1. San_Holo

    San_Holo

    Joined:
    Sep 26, 2014
    Posts:
    152
    Hi..

    I've got my main title logo done in photoshop and it's quite high resolution and I noticed in Unity when I applied the PNG file to my quad that I had to manipulate the quad's scale to match my image aspect ratio, so I thought the quad looked square to me, 4:3 aspect, so I re-designed my PNG logo to 1000x1000 pixels and then re-imported then scaled up my quad by a factor of ten and my logo is off again, stretched slightly top & bottom... so I don't want to scale my quad again or do i have to? please advise... I'm just trying to match my logo/image to be pixel perfect and in it's correct aspect ration, perhaps applying to this quad could be the problem, anyhew, thanks
     
  2. Flailer

    Flailer

    Joined:
    Apr 1, 2014
    Posts:
    66
    For a start... 4:3 is not square. Otherwise it would be called 1:1...

    Code (CSharp):
    1.  void Start ()
    2. {
    3.      int height = Camera.main.orthographicSize * 2.0;
    4.      int width = height * Screen.width / Screen.height;
    5.      transform.localScale = Vector3(width,  height,  1.0f);
    6. }
    This wee bit of code might help you understand the relationship between a 1:1 quad and the camera orthographic size. Presuming you are using an ortho camera for your logo or splash screen..
     
    Last edited: Dec 11, 2014
    San_Holo likes this.