Google News
logo
Unity - Interview Questions
What is the difference between orthographic and perspective cameras in Unity?
In Unity, there are two types of cameras you can use to view your scene: orthographic and perspective cameras.

The main difference between these two camera types is the way they project the 3D world onto a 2D screen.

An orthographic camera projects the 3D world onto a 2D plane in a way that preserves the relative size of objects, regardless of their distance from the camera. This means that objects appear the same size on the screen, regardless of how far away they are from the camera. This makes it useful for 2D games, as well as for certain types of UI elements and architectural visualizations.

A perspective camera, on the other hand, uses a more realistic projection method that takes into account the distance between objects and the camera. This creates the illusion of depth, making objects appear smaller as they move further away from the camera. This is more similar to how the human eye perceives the world, and is commonly used in 3D games and applications.

In terms of setup, the main difference between the two camera types is the way you set their projection settings. Orthographic cameras have an "Orthographic Size" property that determines the height of the camera's view frustum, while perspective cameras have a "Field of View" property that determines the width of the camera's view frustum.
Advertisement