Mesh3d 3D Model
Mesh3d object.
Default FALSE
. Whether to center the mesh.
Default c(0,0,0)
. Position of the mesh.
Default c(1,1,1)
. Scale of the mesh. Can also be a single numeric value scaling all axes uniformly.
Default c(0,0,0)
. Angle to rotate the mesh.
Default c(0,0,0)
. Point around which to rotate the mesh.
Default c(1,2,3)
. Order to rotate the axes.
Default NULL
. Path to the MTL file, if different from the OBJ file.
Default NULL
, read from the MTL file. If not NULL
, this accepts the output
from the material_list()
function to specify the material.
List describing the mesh.
if(run_documentation()) {
# Read in a mesh3d object and rasterize it
library(Rvcg)
data(humface)
mesh3d_mesh(humface,position = c(0,-0.3,0),scale = 1/70,
material=material_list(diffuse="dodgerblue4", type="phong", shininess=20,
ambient = "dodgerblue4", ambient_intensity=0.3)) |>
rasterize_scene(lookat = c(0,0.5,1), light_info = directional_light(c(1,0.5,1)))
}
if(run_documentation()) {
# Subdivide the mesh for a smoother appearance
mesh3d_mesh(humface,position = c(0,-0.3,0),scale = 1/70,
material=material_list(diffuse="dodgerblue4", type="phong", shininess=20,
ambient = "dodgerblue4", ambient_intensity=0.3)) |>
subdivide_mesh() |>
rasterize_scene(lookat = c(0,0.5,1), light_info = directional_light(c(1,0.5,1)))
}