Last active
August 29, 2015 14:27
-
-
Save pepijn-devries/8830c1012f227c06a02a 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
# Rotate the model with the north pole up | |
rgl.viewpoint(zoom = .60, theta = 180, phi = 90) | |
# Tilt the rotational axis with 23.5 degrees | |
# with a slighlty better view of the Northern hemisphere | |
U <- par3d("userMatrix") | |
par3d(userMatrix = rotate3d(U, pi*23.5/180, -0.7,-0.3,0)) | |
# Spin the model and save movie frames | |
movie3d(spin3d(axis = c(0, 0, 1), rpm = 15), duration = 4, | |
convert = F, dir = getwd()) | |
# Convert movie frames to animated GIF | |
shell("convert movie*.png -delay 20 -dither FloydSteinberg -colors 128 globe.gif") | |
# remove individual animation frames after creating GIF | |
file.remove(list.files()[grepl("^movie.*png$", list.files())]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment