add_cubes_to_scene.Rd
Add cubes to an existing scene
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
# 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) # }