#Render a pig
if(run_documentation()) {
generate_studio() %>%
add_object(pig(y=-1.2,scale=0.5,angle=c(0,-70,0)))%>%
add_object(sphere(y=5,x=5,z=5,radius=2,material=light())) %>%
render_scene(samples=16,sample_method = "sobol_blue")
}
if(run_documentation()) {
#Render a moving pig
generate_studio() %>%
add_object(
animate_objects(
pig(y=-1.2,scale=0.5,angle=c(0,-70,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)
}
if(run_documentation()) {
#Render a shrinking pig
generate_studio() %>%
add_object(
animate_objects(
pig(y=-1.2,scale=0.5,angle=c(0,-70,0)),
start_scale = c(1,1,1), end_scale = c(0.5,0.5,0.5))
) %>%
add_object(sphere(y=5,x=5,z=5,radius=2,material=light())) %>%
render_scene(samples=16,sample_method = "sobol_blue",clamp_value = 10)
}
if(run_documentation()) {
#Render a spinning pig
generate_studio() %>%
add_object(
animate_objects(
pig(y=-1.2,scale=0.5,angle=c(0,-70,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)
}
if(run_documentation()) {
#Shorten the open shutter time frame
generate_studio() %>%
add_object(
animate_objects(
pig(y=-1.2,scale=0.5,angle=c(0,-70,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,
shutteropen=0.4, shutterclose = 0.6)
}
if(run_documentation()) {
#Change the time frame when the shutter is open
generate_studio() %>%
add_object(
animate_objects(
pig(y=-1.2,scale=0.5,angle=c(0,-70,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,
shutteropen=0, shutterclose = 0.1)
}
if(run_documentation()) {
#Shorten the time span in which the movement occurs (which, in effect,
#increases the speed of the transition).
generate_studio() %>%
add_object(
animate_objects(start_time = 0, end_time=0.1,
pig(y=-1.2,scale=0.5,angle=c(0,-70,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,
shutteropen=0, shutterclose = 0.1)
}
Run the code above in your browser using DataLab