Computes a camera that frames the contents of a scene (see
scene), i.e. its meshes together with the line layers that
contribute to the scene bounds (see line_layer, parameter
affects_bounds). Use this instead of camera_auto when
the camera has to consider something else than a mesh: a scene that contains
only line layers (e.g. a tractogram or a connectome without a brain surface)
is framed by those lines, and decorational layers
(affects_bounds = FALSE) are ignored.
Arguments
- scene
A scene descriptor list, see
scene().- direction
Length-3 view direction, from the camera towards the scene (default
c(0, 0, -1), i.e. looking along -Z).- up
Length-3 up vector (default
c(0, 1, 0)).- fov
Vertical field of view in degrees (default 45).
- margin
Scale factor applied to the fitted distance; values above 1 leave a margin around the content (default 1.1).
- projection
Projection type,
"perspective"(default) or"orthographic".
Value
A camera list (see camera()) with class
"scimesh_camera".
Details
The camera is placed on the line from the center of the bounding box along
direction, at a distance that makes the content fit into the field of
view, exactly like camera_auto does it for a mesh.
See also
camera_auto for meshes, scene,
scene_set_line_affects_bounds