Learn R Programming

rayvertex (version 0.12.0)

translate_mesh: Translate Mesh

Description

Translate Mesh

Usage

translate_mesh(mesh, position = c(0, 0, 0))

Value

Translated mesh

Arguments

mesh

The mesh.

position

Default c(0,0,0). The translation vector.

Examples

Run this code
if(run_documentation()) {
#Translate a mesh in the Cornell box
robj = obj_mesh(r_obj(), scale=150,angle=c(0,180,0))
generate_cornell_mesh() |>
 add_shape(translate_mesh(robj,c(400,100,155))) |>
 add_shape(translate_mesh(robj,c(555/2,200,555/2))) |>
 add_shape(translate_mesh(robj,c(155,300,400))) |>
 rasterize_scene(light_info=directional_light(direction=c(0.1,0.6,-1)))
}

Run the code above in your browser using DataLab