Vector2 ToScreen( Vector3 world )
bool ToScreen( Vector3 world, Vector2& screen )

robot_2Generated
code_blocksInput

Description

The ToScreen method of the SceneCamera class converts a 3D world position into a 2D screen position. This is useful for determining where a point in the 3D world will appear on the screen, which can be used for UI elements, targeting systems, or other visual indicators.

Usage

To use the ToScreen method, you need to have an instance of SceneCamera. Call the method with a Vector3 representing the world position you want to convert. The method will return a Vector2 representing the screen position.

Example

// Assume 'camera' is an instance of SceneCamera
Vector3 worldPosition = new Vector3(10, 20, 30);
Vector2 screenPosition = camera.ToScreen(worldPosition);

// screenPosition now contains the 2D screen coordinates of the world position