| preview_camera | R Documentation |
Previews a scene-attached camera without writing image files.
preview_camera(
scene,
camera = NULL,
width = 800,
height = 800,
fps = 24,
samples = 1,
...
)
scene |
Scene containing cameras. |
camera |
Default 'NULL'. Camera name or 'ray_camera' object to preview. |
width |
Default '800'. Preview width, in pixels. |
height |
Default '800'. Preview height, in pixels. |
fps |
Default '24'. Intended preview frame rate for animated cameras. |
samples |
Default '1'. Number of samples per pixel for the preview. |
... |
Additional arguments passed to 'render_scene()'. |
Invisibly returns the rendered preview result.
#Zooming over the R logo
motion = generate_camera_motion(
positions = list(c(0, 1, -10), c(0, 1, -2), c(0, 1, 10)),
lookats = list(c(0, 0, 0), c(0, 0.5, 0), c(0, 0, 0)),
fovs = c(60, 45, 90),
frames = 24,
type = "linear",
damp_motion = TRUE,
closed = TRUE
)
scene = generate_ground(material=diffuse(color="grey20")) |>
add_object(obj_model(r_obj())) |>
add_object(sphere(y=10,x=-10,z=-5,material=light(intensity=100))) |>
add_camera(camera(name = "flythrough", motion = motion))
preview_camera(scene, camera = "flythrough", width = 400, height = 400)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.