Skip to content

Instantly share code, notes, and snippets.

@pepijn-devries
Last active August 29, 2015 14:27
Show Gist options
  • Save pepijn-devries/e2bbbab82e3a40d0d0f7 to your computer and use it in GitHub Desktop.
Save pepijn-devries/e2bbbab82e3a40d0d0f7 to your computer and use it in GitHub Desktop.
# 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