convert_rgl_to_raymesh: Convert rayshader RGL scene to ray_mesh object

View source: R/convert_rgl_to_raymesh.R

convert_rgl_to_raymeshR Documentation

Convert rayshader RGL scene to ray_mesh object

Description

Converts the current RGL rayshader scene to a 'ray_mesh' object (see 'rayvertex' package for more information)

Usage

convert_rgl_to_raymesh(
  save_shadow = TRUE,
  water_attenuation = 0,
  water_surface_color = TRUE,
  water_ior = 1
)

Arguments

save_shadow

Default 'FALSE'. If 'TRUE', this saves a plane with the shadow texture below the model.

water_attenuation

Default '0', no attenuation. Amount that light should be attenuated when traveling through water.

water_surface_color

Default 'TRUE'. Whether the water should have a colored surface or not. This is in contrast to setting a non-zero water attenuation, where the color comes from the attenuation of light in the water itself.

water_ior

Default '1'. Water index of refraction.

Value

A 'ray_mesh' object

Examples

filename_obj = tempfile(fileext = ".obj")
#Save model of volcano
if(run_documentation()) {
volcano %>%
 sphere_shade() %>%
 plot_3d(volcano, zscale = 2)

rm_obj = convert_rgl_to_raymesh()
}

tylermorganwall/rayshader documentation built on Dec. 21, 2024, 4:29 p.m.