Skip to content

Instantly share code, notes, and snippets.

@tylermorganwall
Created February 24, 2023 02:29
Show Gist options
  • Save tylermorganwall/5744011336c59136d26f39703dcc7896 to your computer and use it in GitHub Desktop.
Save tylermorganwall/5744011336c59136d26f39703dcc7896 to your computer and use it in GitHub Desktop.
Glowing Contours in R
library(rayshader)
volcano |>
height_shade() |>
plot_3d(volcano,zscale=3)
render_contours(volcano, clear_previous = T, offset=1,color="purple",
zscale=3, nlevels = 20)
for(i in 1:360) {
render_camera(theta=135-i,phi=35,zoom=0.818731)
render_highquality(light=F, lightaltitude = 0, lightintensity = 0,
lightcolor ="red",samples=128,
smooth_line = T,line_radius = 0.1,
path_material = rayrender::light, ground_size = 0,
path_material_args = list(importance_sample=FALSE,
color="purple",intensity=5),
width=800,height=800, sample_method="sobol_blue",
filename=sprintf("neoncontours%i.png",i),verbose=T)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment