#Add contours to the montereybay dataset
if(rayshader:::run_documentation()) {
montereybay %>%
height_shade() %>%
add_shadow(ray_shade(montereybay,zscale=50),0.3) %>%
plot_3d(montereybay, theta = -45, zscale=50)
render_contours(montereybay, zscale = 50, offset = 100)
render_snapshot()
}
if(rayshader:::run_documentation()) {
#Specify the number of levels
render_contours(montereybay, zscale = 50, offset = 100, nlevels = 30,
clear_previous = TRUE)
render_snapshot()
}
if(rayshader:::run_documentation()) {
#Manually specify the breaks with levels
render_contours(montereybay, linewidth = 2, offset = 100, zscale = 50,
levels = seq(-2000, 0, 100), clear_previous = TRUE)
render_snapshot()
}
if(rayshader:::run_documentation()) {
#Use a color palette for the contours
volcano |>
constant_shade() |>
plot_3d(volcano, zscale = 2, solid = FALSE, zoom = 0.8)
palette = grDevices::colorRampPalette(c("red", "purple", "pink"))
render_contours(volcano, offset = 1, palette = palette, zscale = 2, nlevels = 20)
render_snapshot()
}
if(rayshader:::run_documentation()) {
#Render using `render_highquality()` for a neon light effect
render_highquality(light = FALSE, smooth_line = TRUE,
line_radius = 0.1, sample_method="sobol_blue",
path_material = rayrender::light, ground_size = 0,
path_material_args = list(importance_sample = FALSE,
color = "purple", intensity = 2))
}
Run the code above in your browser using DataLab