Displacement of objects after the camera's aspect change

Hello,

I’m developing a modification for the old game. I want to enlarge the viewing area to support widescreen displays. But after the aspect change, all 3D objects on the scene began to run away from their actual location.

Look at the finger (it in the right place):

  1. Imgur: The magic of the Internet
  2. Imgur: The magic of the Internet

Tell me, please, in which direction to look for a mistake?

I add a quick switch between aspects and got this pictures:
Old aspect: Imgur: The magic of the Internet
New aspect: Imgur: The magic of the Internet
All 3D objects in the wrong places. >_>

If I change ortographicSize this will give a similar effect:


I increase m00 in the camera’s projection from 0.005022321 to 0.00622232 and stretched the image by width, but this is definitely not what I want because I need to enlarge the viewing area without stretching the image.
0.005022321: Imgur: The magic of the Internet
0.006222321: Imgur: The magic of the Internet

Rotating the camera, I can joint the model of the character with its actual location on the scene, but this is also not what I need. :slight_smile:


If I specify an aspect (without changing the rect property) I get exactly the same picture for the old 4:3

If I set a new aspect and calculate a smaller ortographicSize, the image will be scaled, and objects will start to float in the air:

I just need to enlarge the viewing area and don’t change scale and position of objects on the scene. :frowning:

Sources.

Got it. -_-

Shader.SetGlobalFloat(“_OffsetX”, this.offset.x);