Description
The CameraPosition
property provides the position of the camera in the currently rendering view. This is a static property of type Vector3
and is part of the Sandbox.Graphics
class. It is used to determine the exact location of the camera in 3D space during rendering operations.
Usage
To access the camera position during rendering, you can use the CameraPosition
property directly from the Graphics
class. This property is read-only and provides the current position of the camera as a Vector3
object.
Example
// Example of accessing the CameraPosition property
Vector3 currentCameraPosition = Graphics.CameraPosition;
// Use the camera position for calculations or rendering logic
// For example, logging the camera position
Log.Info($"Current Camera Position: {currentCameraPosition}");