unity-game-engineorthographicstretching

Unwanted stretching with Unity in orthographic mode


I am creating a 3D playing card game in Unity. I couldn't get the look I wanted with the camera in Perspective mode, so I switched to Orthographic. However, now my cards and other game objects are stretched (in the X-direction). Can someone explain why this is?

I found many videos and forum answers regarding orthographic size, but they do not help or address stretching.

I found many settings regarding aspect ratio, but I am not sure if they are relevant to my problem or what combination may resolve it.

I am not sure if it is important, but my objects are imported 3D Blender items.

Edit (images, as requested):

Though it may be hard to tell, the cards and rack in the perspective view are correct. And the ortho view has stretched everything in the x-direction. For what it's worth, the aspect ratio of the cards is 7/4.

enter image description here

enter image description here

enter image description here

enter image description here


Solution

  • An orthographic camera renders everything in the view without any distance scaling. For example, a unit sphere is the same size in the render whether it is 1 or 1,000 units from the camera. There can be confusion about an orthographic camera being a 2D camera, however it is not. It is still a camera that renders in 3D and so it will take into consideration its own position and angle.

    You have your camera looking down on the table. When you are using the perspective camera, everything looks normal to the eye. However, when you use the orthographic camera the perspective is taken out of the render and confuses the eye.

    Here is an example. These pictures come from a scene with three identically scaled cubes in a row and two cameras. The cubes are rotated 30, 60 and 90 degrees around the x-axis. Both cameras are in the same position. One is an orthographic camera and the other is a perspective camera.

    This image is with the perspective camera (the left half is the Scene view, the right half is the Game view camera render). The eye can interpret that the cubes could be rotated because of the perspective, even though two of the cubes are oddly stretched. enter image description here

    This image is with the orthographic camera (as before, the left half is the Scene view, the right half is the Game view camera render). The eye cannot interpret that the cubes are rotated because of the lack of perspective. The cubes look to be shortened left to right. enter image description here

    (Note: In the above images, I purposely removed lighting cues.)

    So, that is what is happening in your scene when using the orthographic camera. Your objects are not being scaled. The camera is rendering what is sees based on its own position and angle. Placing an orthographic camera is different than placing a perspective camera. I would suggest moving the camera down by reducing y-axis position and shallowing the view angle by reducing the x-axis rotation. You will need to play with the values to get right effect and view.