Torus 3D Model
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 0.5
. The radius of the torus.
Default 0.2
. The radius of the ring.
Default 36
. The number of faces around the ring when triangulating the torus.
Default 36
. The number of faces around the torus.
Default material_list()
(default values). Specify the material of the object.
List describing the mesh.
if(run_documentation()) {
#Plot a group of tori in the cornell box
generate_cornell_mesh(ceiling = FALSE) |>
add_shape(torus_mesh(position=c(555/2,555/3,555/2), angle=c(20,0,45),
radius=120, ring_radius = 40,
material = material_list(diffuse="dodgerblue4",type="phong",
ambient="dodgerblue4",ambient_intensity=0.2))) |>
add_shape(torus_mesh(position=c(400,400,555/2), angle=c(20,200,45),radius=80, ring_radius = 30,
material=material_list(diffuse="orange",type="phong",
ambient="orange",ambient_intensity=0.2))) |>
add_shape(torus_mesh(position=c(150,450,555/2), angle=c(60,180,0),radius=40, ring_radius = 20,
material=material_list(diffuse="red",type="phong"))) |>
rasterize_scene(light_info = directional_light(c(0,1,-2)))
}
#> Setting default values for Cornell box: lookfrom `c(278,278,-800)` lookat `c(278,278,0)` fov `40` .