add_cubes_to_scene: Add cubes to an existing scene

Description Usage Arguments Value Examples

View source: R/mesh_to_cubes.R

Description

Add cubes to an existing scene

Usage

1
add_cubes_to_scene(scene, cubes, material = lambertian(color = "ivory"))

Arguments

scene

scene

cubes

cubes calculated with mesh_to_cubes

material

1 material or a tibble of materials (1 row for each cube) from rayrender. lambertian, dielectric

Value

rayrender scene with cubes

Examples

 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)

statnmap/mesh2ray documentation built on Nov. 5, 2019, 9:20 a.m.