obj_mesh: OBJ Mesh 3D Model

Description Usage Arguments Value Examples

View source: R/objects.R

Description

OBJ Mesh 3D Model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
obj_mesh(
  filename,
  center = FALSE,
  position = c(0, 0, 0),
  scale = c(1, 1, 1),
  angle = c(0, 0, 0),
  pivot_point = c(0, 0, 0),
  order_rotation = c(1, 2, 3),
  materialspath = NULL,
  material = NULL
)

Arguments

filename

OBJ filename.

center

Default 'FALSE'. Whether to center the mesh.

position

Default 'c(0,0,0)'. Position of the mesh.

scale

Default 'c(1,1,1)'. Scale of the mesh. Can also be a single numeric value scaling all axes uniformly.

angle

Default 'c(0,0,0)'. Angle to rotate the mesh.

pivot_point

Default 'c(0,0,0)'. Point around which to rotate the mesh.

order_rotation

Default 'c(1,2,3)'. Order to rotate the axes.

materialspath

Default 'NULL'. Path to the MTL file, if different from the OBJ file.

material

Default 'NULL', read from the MTL file. If not 'NULL', this accepts the output from the 'material_list()' function to specify the material.

Value

List describing the mesh.

Examples

1
2
3
4
5
6
#Read in the provided 3D R mesh

generate_cornell_mesh(ceiling=FALSE) %>% 
  add_shape(obj_mesh(r_obj(),position=c(555/2,0,555/2),scale=150,angle=c(0,180,0))) %>% 
  rasterize_scene(light_info = directional_light(direction=c(0.2,0.5,-1)))
  

rayvertex documentation built on Oct. 10, 2021, 9:06 a.m.