Description
The Orthographic
property of the CameraComponent
class determines whether the camera uses orthographic projection instead of perspective projection. Orthographic projection is a method of projection in which objects are represented without perspective, meaning that objects appear the same size regardless of their distance from the camera.
Usage
To use the Orthographic
property, simply set it to true
if you want the camera to use orthographic projection, or false
if you prefer perspective projection. This can be useful in scenarios such as 2D games or architectural visualization where maintaining the same scale for objects regardless of their distance is important.
Example
// Example of setting the Orthographic property
CameraComponent camera = new CameraComponent();
camera.Orthographic = true; // Set the camera to use orthographic projection
// To switch back to perspective projection
camera.Orthographic = false;