Last active
August 29, 2015 14:27
-
-
Save pepijn-devries/e2bbbab82e3a40d0d0f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simply plot the atoms as coloured spheres. | |
# multiply the Van der Waals radii with 0.75 | |
# to reduce overlap of atoms. | |
mapply(function(x, y, z, vdw, col){ | |
spheres3d(x, y, z, + vdw*0.75, col = col, add = T) | |
}, atom_dat$x, atom_dat$y, atom_dat$z, | |
atom_dat$vanderwaals, atom_dat$colour) | |
# Save as an interactive model on web page | |
writeWebGL() | |
# Open in default browser: | |
browseURL(paste("file://", file.path(getwd(), "webGL/index.html"), sep = "")) | |
# Tested in Chrome on Windows 7 machine with success | |
# Tested in IE on Windows 7 machine with limited success | |
# Tested in Chrome on Android device without success |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment