Last month, the Philae lander touched down on comet Churyumov–Gerasimenko. In the process, the lander and the orbiting Rosetta probe captured detailed data on the geometry of the comet, which the ESA published as a shape file. You can use the rgl package to visualize and explore such shape files quite simply as follows:
Then you can manipulate the comet in 3-D with a mouse in an X11 window. (Note, if you're on a Mac you will need to install XQuartz.) Also try running play3d(spin3d()) to see it rotate automatically.
Package maintainer Duncan Murdoch has made things even easier if you have the very latest version of rgl (currently only available in source form), where you can simply run:
example(readOBJ)
Thanks to Duncan for this very cool example!
R says
Error: could not find function "readOBJ"
Posted by: Dr.Duleep Kumar Samuel | December 25, 2014 at 21:06
Thanks Duncan is working in Mac, after rebuilding RGL from source
install.packages("RGL",type=source) and typing the code but failing in a xterm on Mac with "readOBJ object not found".
example(readOBJ)
works in Rgui in Mac
open3d()
comet <- readOBJ(url("http://sci.esa.int/science-e/www/object/doc.cfm?fobjectid=54726"))
shade3d(comet, col="gray")
Posted by: Agustín | December 26, 2014 at 04:23
Hi, it seem not not to work even after having reinstalled the package from source...the error message is the same
Posted by: Stefano Schiaparelli | December 28, 2014 at 10:02
For MAC OS X users who install XCode for the first time, before installing 'rgl' package, open the XCode application in Finder. Accept the XCode license agreement.
After accepting the XCode license agreement, then return to RStudio and install the package using the above install.package() command.
Posted by: Phillip Burger | January 15, 2015 at 13:48