| add_camera | R Documentation |
Adds a camera to a 'ray_scene'.
add_camera(scene, camera, name = NULL, active = TRUE, replace = FALSE)
scene |
Scene to modify. |
camera |
Camera created with 'camera()'. |
name |
Default 'NULL'. Optional name that overrides 'camera$name'. |
active |
Default 'TRUE'. Whether to set this camera as the active scene camera. |
replace |
Default 'FALSE'. Whether to replace an existing camera with the same name. |
A modified 'ray_scene'.
scene = generate_ground(material=diffuse(color="grey20")) |>
add_object(sphere()) |>
add_camera(camera(
name = "main",
lookfrom = c(0, 1, -10),
lookat = c(0, 0, 0),
fov = 35
))
render_scene(scene, samples = 16)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.