| mesh_to_rgl | R Documentation |
Builds an rgl-compatible triangular mesh from a scimesh mesh
descriptor so that the result can be used with
rgl::shade3d() or other rgl functions.
mesh_to_rgl(mesh, color = NULL, face_color = NULL)
mesh |
A scimesh mesh descriptor list with |
color |
Optional per-vertex colour, either a single length-4 RGBA vector (applied to all vertices) or an Nx4 matrix. |
face_color |
Optional per-face colour (Mx4 matrix). |
A list with components vb (4xN homogeneous
coordinates), it (3xM 1-based index matrix), and
optionally normals and mat (material), suitable
for use with rgl's tmesh3d() and shade3d().
mesh <- generate_cuboid(c(0, 0, 0), c(1, 1, 1))
rgl_mesh <- mesh_to_rgl(mesh)
str(rgl_mesh)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.