Scale Mesh

scale_mesh(mesh, scale = 1, center = c(0, 0, 0))

Arguments

mesh

The mesh.

scale

Default `c(1,1,1)`. The scale amount, per axis.

center

Default `c(0,0,0)`. The center of the scale.

Value

Scaled mesh

Examples

# \dontshow{
options("cores"=1)
# }
#Scale a mesh in the Cornell box
robj = obj_mesh(r_obj(), scale=80,angle=c(0,180,0))
# \donttest{

generate_cornell_mesh() %>% 
add_shape(scale_mesh(translate_mesh(robj,c(400,0,155)),0.5, center=c(400,0,155))) %>% 
add_shape(scale_mesh(translate_mesh(robj,c(555/2,100,555/2)),1.5, center=c(555/2,100,555/2))) %>% 
add_shape(scale_mesh(translate_mesh(robj,c(155,200,400)),c(0.5,2,0.5), center=c(155,200,400))) %>% 
rasterize_scene(light_info=directional_light(direction=c(0.1,0.6,-1)))
#> Setting default values for Cornell box: lookfrom `c(278,278,-800)` lookat `c(278,278,0)` fov `40` .
#> Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘terra’
# }