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 property is useful when you need a consistent scale for objects, such as in 2D games or certain types of 3D visualizations.
Example
// Create a new CameraComponent
CameraComponent camera = new CameraComponent();
// Set the camera to use orthographic projection
camera.Orthographic = true;
// Set the orthographic height if needed
camera.OrthographicHeight = 10.0f;
// Alternatively, set the camera to use perspective projection
camera.Orthographic = false;