Description Usage Arguments Value Examples
Add custom shape component from user supplied function
1 | m_add_custom(id, spec)
|
id |
R3dmol |
spec |
Style specification (see: http://3dmol.csb.pitt.edu/doc/types.html#CustomShapeSpec). |
R3dmol id
or a r3dmol
object (the output from
r3dmol()
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | library(r3dmol)
r <- 20
vertices <- list(
m_vector3(0, 0, 0),
m_vector3(r, 0, 0),
m_vector3(0, r, 0)
)
normals <- list(
m_vector3(0, 0, 1),
m_vector3(0, 0, 1),
m_vector3(0, 0, 1)
)
colors <- list(
list(r = 1, g = 0, b = 0),
list(r = 0, g = 1, b = 0),
list(r = 0, g = 0, b = 1)
)
faces <- 0:2
r3dmol() %>%
m_add_custom(spec = list(
vertexArr = vertices,
normalArr = normals,
faceArr = faces,
color = colors
))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.