# NOT RUN {
#Generate a cylinder in the cornell box. Add a cap to both ends.
# }
# NOT RUN {
generate_cornell() %>%
add_object(cylinder(x = 555/2, y = 250, z = 555/2,
length = 300, radius = 100, material = metal())) %>%
add_object(disk(x = 555/2, y = 400, z = 555/2,
radius = 100, material = metal())) %>%
add_object(disk(x = 555/2, y = 100, z = 555/2,
radius = 100, material = metal(), flipped = TRUE)) %>%
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 {
#Rotate the cylinder
# }
# NOT RUN {
generate_cornell() %>%
add_object(cylinder(x = 555/2, y = 250, z = 555/2,
length = 300, radius = 100, angle = c(0, 0, 45),
material = diffuse())) %>%
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 {
# Only render a subtended arc of the cylinder,
# }
# NOT RUN {
generate_cornell(lightintensity=3) %>%
add_object(cylinder(x = 555/2, y = 250, z = 555/2,
length = 300, radius = 100, angle = c(45, 0, 0), phi_min = 0, phi_max = 180,
material = diffuse())) %>%
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