if(interactive()) {
filename_obj = tempfile(fileext = ".obj")
#Save model of volcano
if(rayshader:::run_documentation()) {
volcano %>%
sphere_shade() %>%
plot_3d(volcano, zscale = 2)
save_obj(filename_obj)
}
#Save model of volcano without texture
if(rayshader:::run_documentation()) {
save_obj(filename_obj, save_texture = FALSE)
}
#Make water have realistic index of refraction
if(rayshader:::run_documentation()) {
montereybay %>%
sphere_shade() %>%
plot_3d(montereybay, zscale = 50)
save_obj(filename_obj, water_index_refraction = 1.5)
}
}
Run the code above in your browser using DataLab