svg.mesh | R Documentation |
Draws mesh in Viewer.
svg.mesh(file=NULL, name=NULL, col='#F5F5F5', emissive='black',
material = c('auto', 'lambert', 'phong')[1],
opacity=1, ontop=FALSE, get.lim=TRUE,
scaling = 1, debug = FALSE, vertex.normals = NULL,
face.normals = NULL, vertex.labels = NULL,
vertex.spheres = NULL, dbl.side = c('auto', TRUE, FALSE)[1])
file |
A mesh file in the .obj or .json. |
name |
The name of the mesh. By default, name is |
col |
The mesh color. |
emissive |
The mesh emissive color. |
material |
The mesh material. This affects how light reflects off of the mesh surface. |
opacity |
The mesh opacity. A value of 1 (default) is fully opaque. |
ontop |
Whether the mesh should appear on top of all other objects in the viewer (to manually set order in cases of incorrect ordering due to partial opacities). |
get.lim |
A logical indicating whether the limits of the mesh should be found and returned. This can be used to position other objects relative to the mesh bounds. This will be done at a later point (if not done when |
scaling |
A scaling factor for the mesh, default is 1. |
debug |
A logical indicating whether to draw the mesh in debug mode. Debug mode will label the vertices. This is useful if you create your own mesh. |
vertex.normals |
A logical indicating whether to draw vertex normals. If |
face.normals |
A logical indicating whether to draw face normals. If |
vertex.labels |
A logical indicating whether to draw vertex labels. If |
vertex.spheres |
Whether to draw the vertices as spheres. If |
dbl.side |
Whether mesh faces are double sided. |
This function only works in the webgl plotting mode (i.e. when the mode
parameter of svg.new
is 'webgl'). This function adds a mesh to the Viewer. See readOBJ
for more details and limitations on what meshes can be plotted.
If get.lim
is TRUE
, a list with the following elements:
lim |
The minimum and maximum values of each dimension of the mesh vertices. |
corners |
The eight corners of the bounding box surrounding the mesh. |
Aaron Olsen
readOBJ
,
objToJSON
## Not run:
# Create new viewer
svg.new(mode='webgl')
# Add mesh
svg.mesh(file='mesh.obj')
# Close connection
svg.close()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.