How to calculate orthogonal camera to view a plane perfectly

Hi unity community!

I’m having a confusing time setting up an orthogonal camera. I have a single plane (with a texture) in my game. The scale of the plan is 1024*768. I’m trying to display this plane full screen (perfect fit, without clipping).

Can anyone explain why an orthogonal camera with its size set to 1024 is still way too small. :?

It seems I need to set it bigger, but would rather calculate it correctly and accurately than do it by eye.

Can anyone offer any pointers :?:

By ‘way to small’, do you mean that it makes the plane appear too small?

The ‘orthographic size’ parameter is half of the vertical size of the projection bounds, so if you want the plane to fix exactly, you’ll probably want to set the orthographic size to 768/2, not 1024. (There’s still aspect ratio to contend with, but that should at least fit your plane correctly in the vertical direction.)

hi, thanks for the response…

Sorry, to clarify, the viewable area (indicating by the wireframe box on the camera) is too small.
When the game runs, the camera only views a very small center portion of the plane.

I’ve tried setting the orthogonal size of the camera, and it requires a very larger value to view the entirety of the plane (much larger than 768/2).

Is my problem with the scaling of the plane…I created the plane from the “GameObject/Create” other menu, and have set the scale to 1024 by 768…it seems that the scale unit size differs from the orthagonol size units for a camera…perhaps this is the problem?!?

The problem is probably with the scaling of the plane. I don’t remember exactly, but I think the built-in plane object generated by Unity is tessellated and is 10x10 (or something like that). I may not have the math exactly right, but you’ll probably need to scale the plane by 1024*.1 and 768*.1 to get the desired effect. (Or something like that.)

Yes, that’s the thought I had. I’ve played with multiples of 1024 and 768 and I still can’t for the figure the relationship between the camera orthogonol size in relation to game-object sizes.

ok, i solved my problem.

I have created a plane procedurally with size 1024*768.
I created a camera, set it to orthogonol and its orthogonol size to 384 (vertical width / 2 as per unity docs).

I had a combination of problems. My plane wasnt being created the correct size, the rotation of the camera wasnt correct (y flipped with x) and an i’m quite sure the wireframe camera box, which indicates its view area isnt at all accurate.

I think lesson learnt is to check the game window constantly for camera views.

thanks for your help jesse.