# NOT RUN {
#Load the included example R object file, by calling the r_obj() function. This
#returns the local file path to the `r.txt` obj file. The file extension is "txt"
#due to package constraints, but the file contents are identical and it does not
#affect the function.
# }
# NOT RUN {
generate_ground(material = diffuse(checkercolor = "grey50")) %>%
add_object(obj_model(y = -0.8, filename = r_obj(),
material = metal(color = "gold", fuzz = 0.025))) %>%
add_object(obj_model(x = 1.8, y = -0.8, filename = r_obj(),
material = diffuse(color = "lightblue"))) %>%
add_object(obj_model(x = -1.8, y = -0.8, filename = r_obj() ,
material = dielectric(color = "pink"))) %>%
add_object(sphere(z = 20, x = 20, y = 20, radius = 10,
material = light(intensity = 20))) %>%
render_scene(parallel = TRUE, samples = 500,
tonemap = "reinhold", aperture = 0.05, fov = 32, lookfrom = c(0, 2, 10))
# }
# NOT RUN {
#Use scale_obj to make objects bigger--this is more robust than the generic scale argument.
# }
# NOT RUN {
generate_ground(material = diffuse(checkercolor = "grey50")) %>%
add_object(obj_model(y = -0.8, filename = r_obj(), scale_obj = 2,
material = diffuse(noise = TRUE, noiseintensity = 10,noisephase=45))) %>%
add_object(sphere(z = 20, x = 20, y = 20, radius = 10,
material = light(intensity = 10))) %>%
render_scene(parallel = TRUE, samples = 500, ambient = TRUE,
backgroundhigh="blue", backgroundlow="red",
aperture = 0.05, fov = 32, lookfrom = c(0, 2, 10),
lookat = c(0,1,0))
# }
Run the code above in your browser using DataLab