URL: https://graphicscomputing.fr/cgp/reference/camera_projection_perspective/
Description: Perspective projection parameters (field of view, aspect ratio, near/far planes).

# camera_projection_perspective

Perspective projection parameters (field of view, aspect ratio, near/far planes).

Fields:

- `float field_of_view` - Vertical field of view in radians, 50 degrees by default.
- `float aspect_ratio` - Width/height ratio of the viewport, 1 by default (usually set from window_structure::aspect_ratio()).
- `float depth_min` - Distance of the near clipping plane, 0.01 by default.
- `float depth_max` - Distance of the far clipping plane, 1000 by default.

Functions taking it:

- `intersection_structure picking_plane_orthogonal_to_camera(vec2 const& screen_position, vec3 const& plane_position, camera_generic_base const& camera, camera_projection_perspective const& projection)` - Intersects the camera ray through the screen position (relative coordinates) with the plane through plane_position orthogonal to the front direction of the camera.
- `picking_structure picking_spheres(vec2 const& screen_click, numarray<vec3> const& spheres_centers, float spheres_radius, camera_generic_base const& camera, camera_projection_perspective const& projection)` - Cast a ray through a screen position (normalized device coordinates) and return the closest hit among spheres of common radius, with its index, position and normal.
- `picking_structure picking_mesh_vertex_as_sphere(vec2 const& screen_click, numarray<vec3> const& vertex_position, numarray<vec3> const& vertex_normal, float picking_distance, camera_generic_base const& camera, camera_projection_perspective const& projection)` - Casts the camera ray through the screen position and returns the closest vertex whose sphere of radius picking_distance it hits, with the hit point, the vertex normal and the vertex index (active is false if none).
