# NOT RUN {
#Generate the ground and add some objects
scene = generate_cornell() %>%
add_object(cube(x=555/2,y=555/8,z=555/2,width=555/4)) %>%
add_object(cube(x=555/2,y=555/4+555/16,z=555/2,width=555/8))
# }
# NOT RUN {
render_scene(scene,lookfrom=c(278,278,-800),lookat = c(278,278,0), aperture=0,
samples=500, fov=50, parallel=TRUE, clamp_value=5)
# }
# NOT RUN {
#Group the entire room and rotate around its center, but keep the cubes in the same place.
scene2 = group_objects(generate_cornell(),
pivot_point=c(555/2,555/2,555/2),
group_angle=c(0,30,0)) %>%
add_object(cube(x=555/2,y=555/8,z=555/2,width=555/4)) %>%
add_object(cube(x=555/2,y=555/4+555/16,z=555/2,width=555/8))
# }
# NOT RUN {
render_scene(scene2,lookfrom=c(278,278,-800),lookat = c(278,278,0), aperture=0,
samples=500, fov=50, parallel=TRUE, clamp_value=5)
# }
# NOT RUN {
#Now group the cubes instead of the Cornell box, and rotate/translate them together
twocubes = cube(x=555/2,y=555/8,z=555/2,width=555/4) %>%
add_object(cube(x=555/2, y=555/4 + 555/16, z=555/2, width=555/8))
scene3 = generate_cornell() %>%
add_object(group_objects(twocubes, group_translate = c(0,50,0),group_angle = c(0,45,0)))
# }
# NOT RUN {
render_scene(scene3,lookfrom=c(278,278,-800),lookat = c(278,278,0), aperture=0,
samples=500, fov=50, parallel=TRUE, clamp_value=5)
# }
# NOT RUN {
#Flatten and stretch the cubes together on two axes
scene4 = generate_cornell() %>%
add_object(group_objects(twocubes, group_translate = c(0,-40,0),
group_angle = c(0,45,0), group_scale = c(2,0.5,1)))
# }
# NOT RUN {
render_scene(scene4,lookfrom=c(278,278,-800),lookat = c(278,278,0), aperture=0,
samples=500, fov=50, parallel=TRUE, clamp_value=5)
# }
Run the code above in your browser using DataLab