#First we plot the sphere_shade() hillshade of `montereybay` with no shadows
if(run_documentation()) {
montereybay %>%
sphere_shade(colorintensity=0.5) %>%
plot_map()
}
#Raytrace the `montereybay` elevation map and add that shadow to the output of sphere_shade()
if(run_documentation()) {
montereybay %>%
sphere_shade(colorintensity=0.5) %>%
add_shadow(ray_shade(montereybay,sunaltitude=20,zscale=50),max_darken=0.3) %>%
plot_map()
}
#Increase the intensity of the shadow map with the max_darken argument.
if(run_documentation()) {
montereybay %>%
sphere_shade(colorintensity=0.5) %>%
add_shadow(ray_shade(montereybay,sunaltitude=20,zscale=50),max_darken=0.1) %>%
plot_map()
}
#Decrease the intensity of the shadow map.
if(run_documentation()) {
montereybay %>%
sphere_shade(colorintensity=0.5) %>%
add_shadow(ray_shade(montereybay,sunaltitude=20,zscale=50),max_darken=0.7) %>%
plot_map()
}
Run the code above in your browser using DataLab