Description Usage Arguments Examples
mol_view_cpk
1 | mol_view_cpk(mol, reset=TRUE, alpha=1, rfactor=0)
|
mol |
|
reset |
TRUE |
alpha |
1 |
rfactor |
0 |
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 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
mol_view_cpk <- function(mol, reset=TRUE, alpha=1, rfactor=0) {
natoms <- length(mol$atoms)
x <- double(natoms)
y <- double(natoms)
z <- double(natoms)
colors <- double(natoms)
radius <- double(natoms)
for (i in 1:natoms) {
atom <- mol$atoms[[i]]
x[i] <- atom$x
y[i] <- atom$y
z[i] <- atom$z
colors[i] <- PT.Color[[atom$el]]
radius[i] <- PT.AtRad[[atom$el]] * rfactor
}
if (reset) {
open3d()
bg3d("white")
}
spheres3d(x, y, z, color=colors, radius=radius, alpha=alpha)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.