Gets a camera from a `ray_scene`.
get_camera(scene, camera = NULL)A `ray_camera` object.
scene = generate_ground(material=diffuse(color="grey20")) |>
add_camera(camera(name = "wide", fov = 55), active = FALSE) |>
add_camera(camera(name = "main", fov = 35), active = TRUE)
# Returns the active camera.
get_camera(scene)
#> ray_camera <main>
#> type: perspective static
#> frames: 1
#> lookfrom: c(0, 1, -10)
#> lookat: c(0, 0, 0)
#> fov: 35
#> aperture: 0.1
#> focal distance: 10.04988
#> camera motion blur: off
#> shutter speed: 2
#> output: not set
# Returns a named camera.
get_camera(scene, "wide")
#> ray_camera <wide>
#> type: perspective static
#> frames: 1
#> lookfrom: c(0, 1, -10)
#> lookat: c(0, 0, 0)
#> fov: 55
#> aperture: 0.1
#> focal distance: 10.04988
#> camera motion blur: off
#> shutter speed: 2
#> output: not set