# NOT RUN {
#Generate a sphere in the cornell box.
# }
# NOT RUN {
generate_cornell() %>%
add_object(sphere(x = 555/2, y = 555/2, z = 555/2, radius = 100)) %>%
render_scene(lookfrom = c(278, 278, -800) ,lookat = c(278, 278, 0), fov = 40,
ambient_light = FALSE, samples = 400, parallel = TRUE, clamp_value = 5)
# }
# NOT RUN {
#Generate a gold sphere in the cornell box
# }
# NOT RUN {
generate_cornell() %>%
add_object(sphere(x = 555/2, y = 100, z = 555/2, radius = 100,
material = metal(color = "gold", fuzz = 0.2))) %>%
render_scene(lookfrom = c(278, 278, -800) ,lookat = c(278, 278, 0), fov = 40,
ambient_light = FALSE, samples = 400, parallel = TRUE, clamp_value = 5)
# }
# NOT RUN {
#Add motion blur and show the sphere moving
# }
# NOT RUN {
generate_cornell() %>%
add_object(sphere(x = 555/2, y = 100, z = 555/2, radius = 100,
material = metal(color = "gold", fuzz = 0.2), velocity = c(50, 0, 0))) %>%
render_scene(lookfrom = c(278, 278, -800) ,lookat = c(278, 278, 0), fov = 40,
ambient_light = FALSE, samples = 400, parallel = TRUE, clamp_value = 5)
# }
Run the code above in your browser using DataLab