This function animates an object between two states. This animates objects separately from the transformations set in `group_objects()` and in the object transformations themselves. This creates motion blur, controlled by the shutter open/close options in `render_scene()`.
animate_objects(
scene,
start_time = 0,
end_time = 1,
start_pivot_point = c(0, 0, 0),
start_position = c(0, 0, 0),
start_angle = c(0, 0, 0),
start_order_rotation = c(1, 2, 3),
start_scale = c(1, 1, 1),
start_axis_rotation = NA,
end_pivot_point = c(0, 0, 0),
end_position = c(0, 0, 0),
end_angle = c(0, 0, 0),
end_order_rotation = c(1, 2, 3),
end_scale = c(1, 1, 1),
end_axis_rotation = NA
)Tibble of pre-existing object locations.
Default `0`. Start time of movement.
Default `1`. End time of movement.
Default `c(0,0,0)`. The point about which to pivot, scale, and move the objects.
Default `c(0,0,0)`. Vector indicating where to offset the objects.
Default `c(0,0,0)`. Angle of rotation around the x, y, and z axes, applied in the order specified in `order_rotation`.
Default `c(1,2,3)`. The order to apply the rotations, referring to "x", "y", and "z".
Default `c(1,1,1)`. Scaling factor for x, y, and z directions for all objects.
Default `NA`. Provide an axis of rotation and a single angle (via `angle`) of rotation
Default `c(0,0,0)`. The point about which to pivot, scale, and move the group.
Default `c(0,0,0)`. Vector indicating where to offset the objects.
Default `c(0,0,0)`. Angle of rotation around the x, y, and z axes, applied in the order specified in `order_rotation`.
Default `c(1,2,3)`. The order to apply the rotations, referring to "x", "y", and "z".
Default `c(1,1,1)`. Scaling factor for x, y, and z directions for all objects.
Default `NA`. Provide an axis of rotation and a single angle (via `angle`) of rotation around that axis.
Tibble of animated object.
#Render a pig
generate_studio() |>
add_object(pig(y=-1.2,scale=0.5,angle=c(0,110,0)))|>
add_object(sphere(y=5,x=5,z=-5,radius=2,material=light())) |>
render_scene(samples=16,sample_method = "sobol_blue")
#Render a moving pig
generate_studio() |>
add_object(
animate_objects(
pig(y=-1.2,scale=0.5,angle=c(0,110,0)),
start_position = c(-0.1,0,0), end_position = c(0.1,0.2,0))
) |>
add_object(sphere(y=5,x=5,z=-5,radius=2,material=light())) |>
render_scene(samples=16,sample_method = "sobol_blue",clamp_value = 10)
#Render a shrinking pig
generate_studio() |>
add_object(
animate_objects(
pig(y=-1.2,scale=0.5,angle=c(0,110,0)),
start_scale = c(1,1,1), end_scale = c(0.5,0.5,0.5)/4)
) |>
add_object(sphere(y=5,x=5,z=-5,radius=2,material=light())) |>
render_scene(samples=16,sample_method = "sobol_blue",clamp_value = 10)
#Render a spinning pig
generate_studio() |>
add_object(
animate_objects(
pig(y=-1.2,scale=0.5,angle=c(0,110,0)),
start_angle = c(0,-60,0), end_angle = c(0,60,0))
) |>
add_object(sphere(y=5,x=5,z=-5,radius=2,material=light())) |>
render_scene(samples=16,sample_method = "sobol_blue",clamp_value = 10)
#The default shutter_speed = 2 exposes [0, 0.5].
generate_studio() |>
add_object(
animate_objects(
pig(y=-1.2,scale=0.5,angle=c(0,110,0)),
start_angle = c(0,-60,0), end_angle = c(0,60,0))
) |>
add_object(sphere(y=5,x=5,z=-5,radius=2,material=light())) |>
render_scene(samples=16,sample_method = "sobol_blue",clamp_value = 10)
#Shorten the exposure to [0, 0.25] with shutter_speed = 4.
generate_studio() |>
add_object(
animate_objects(
pig(y=-1.2,scale=0.5,angle=c(0,110,0)),
start_angle = c(0,-60,0), end_angle = c(0,60,0))
) |>
add_object(sphere(y=5,x=5,z=-5,radius=2,material=light())) |>
render_scene(samples=16,sample_method = "sobol_blue",clamp_value = 10,
shutter_speed=4)
#Complete the rotation in 0.2 time units. shutter_speed = 4 exposes [0, 0.25],
#so the final pose is held for 20% of the exposure and appears more distinct.
#Use shutter_speed = 5 to expose only [0, 0.2], ending with the motion.
generate_studio() |>
add_object(
animate_objects(start_time = 0, end_time=0.2,
pig(y=-1.2,scale=0.5,angle=c(0,110,0)),
start_angle = c(0,-30,0), end_angle = c(0,30,0))
) |>
add_object(sphere(y=5,x=5,z=-5,radius=2,material=light())) |>
render_scene(samples=16,sample_method = "sobol_blue",clamp_value = 10,
shutter_speed = 4)
#Compare with an exposure that ends exactly when the rotation finishes.
generate_studio() |>
add_object(animate_objects(
pig(y = -1.2, scale = 0.5, angle = c(0, 110, 0)),
start_time = 0, end_time = 0.2,
start_angle = c(0, -30, 0), end_angle = c(0, 30, 0)
)) |>
add_object(sphere(y = 5, x = 5, z = -5, radius = 2, material = light())) |>
render_scene(samples = 64, sample_method = "sobol_blue",
clamp_value = 10, shutter_speed = 5)