#Add contours to the montereybay dataset
if(run_documentation()) {
montereybay |>
height_shade() |>
add_shadow(ray_shade(montereybay,zscale=50),0.3) |>
plot_3d(montereybay, theta = -45, zscale=50, zoom=0.9, windowsize=800)
render_contours(montereybay, zscale = 50, offset = 100)
render_snapshot()
}
if(run_documentation()) {
#Specify the number of levels
render_contours(montereybay, zscale = 50, offset = 100, nlevels = 30,
clear_previous = TRUE)
render_snapshot()
}
if(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(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(run_documentation()) {
#Render using `render_highquality()` for a neon light effect
render_highquality(light = FALSE, samples = 16,
line_radius = 0.1,
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