# NOT RUN {
#Render the volcano dataset using pathtracing
# }
# NOT RUN {
volcano %>%
sphere_shade() %>%
plot_3d(volcano,zscale = 2)
render_highquality()
# }
# NOT RUN {
#Change position of light
# }
# NOT RUN {
render_highquality(lightdirection = 45)
# }
# NOT RUN {
#Change vertical position of light
# }
# NOT RUN {
render_highquality(lightdirection = 45, lightaltitude=10)
# }
# NOT RUN {
#Change the ground material
# }
# NOT RUN {
render_highquality(lightdirection = 45, lightaltitude=60,
ground_material = rayrender::diffuse(checkerperiod = 30, checkercolor="grey50"))
# }
# NOT RUN {
#Add three different color lights and a title
# }
# NOT RUN {
render_highquality(lightdirection = c(0,120,240), lightaltitude=45,
lightcolor=c("red","green","blue"), title_text = "Red, Green, Blue",
title_bar_color="white", title_bar_alpha=0.8)
# }
# NOT RUN {
#Change the camera:
# }
# NOT RUN {
render_camera(theta=-45,phi=60,fov=60,zoom=0.8)
render_highquality(lightdirection = c(0),
title_bar_color="white", title_bar_alpha=0.8)
# }
# NOT RUN {
#Add a shiny metal sphere
# }
# NOT RUN {
render_camera(theta=-45,phi=60,fov=60,zoom=0.8)
render_highquality(lightdirection = c(0,120,240), lightaltitude=45,
lightcolor=c("red","green","blue"),
scene_elements = rayrender::sphere(z=-60,y=0,
radius=20,material=rayrender::metal()))
# }
# NOT RUN {
#Add a red light to the volcano and change the ambient light to dusk
# }
# NOT RUN {
render_camera(theta=45,phi=45)
render_highquality(lightdirection = c(240), lightaltitude=30,
lightcolor=c("#5555ff"),
scene_elements = rayrender::sphere(z=0,y=15, x=-18, radius=5,
material=rayrender::light(color="red",intensity=10)))
# }
# NOT RUN {
#Manually change the camera location and direction
# }
# NOT RUN {
render_camera(theta=45,phi=45,fov=90)
render_highquality(lightdirection = c(240), lightaltitude=30, lightcolor=c("#5555ff"),
camera_location = c(50,10,10), camera_lookat = c(0,15,0),
scene_elements = rayrender::sphere(z=0,y=15, x=-18, radius=5,
material=rayrender::light(color="red",intensity=10)))
rgl::rgl.close()
# }
Run the code above in your browser using DataLab