Description Usage Arguments Value Examples
View source: R/mesh_to_cubes.R
Add cubes to an existing scene
1 | add_cubes_to_scene(scene, cubes, material = lambertian(color = "ivory"))
|
scene |
scene |
cubes |
cubes calculated with |
material |
1 material or a tibble of materials (1 row for each cube) from rayrender. lambertian, dielectric |
rayrender scene with cubes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
library(Rvcg)
simple_mesh <- Rvcg::vcgIcosahedron()
cubes <- mesh_to_cubes(simple_mesh, voxelSize = 0.5, scene_dim = c(80, 475))
library(rayrender)
scene <- generate_cornell(lightintensity = 10)
# _add cubes on scene
scene <- mesh2ray::add_cubes_to_scene(scene, cubes = cubes,
material = lambertian(color = "ivory"))
render_scene(scene, lookfrom = c(278, 278, -800) ,
lookat = c(278, 278, 0), fov = 40, ambient_light = FALSE,
samples = 500, parallel = TRUE, clamp_value = 5)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.