Some cool tricks can be achieved in R using the rgl package. I will add code later to produce 3d trees and also to look at the results of multivariate analysis in three dimensions.
Here is a very simple function for making a 3d surface from a digital elevation model held as a SpatialGridDataFrame. The first lines will download an object from an Ecosur ftp site, so the code should produce the results shown above, a 3d map of the state of Chiapas.
x <- grid@grid@cellsize*(1:grid@firstname.lastname@example.org)
ylim <- range(y2)
ylen <- ylim – ylim + 1
col <- pal[ y2-ylim+1 ] # assign colors to heights for each point
rgl.surface(x, z, y, color=col)
Important note. On testing this I have just found that there seems to be an encoding problem when using WordPress. The site should be using UTM-8 but quotation marks don’t appear to be recognised by R. If this throws an error then copy the code to a text editor and replace the offending quotation marks. I am trying to solve the issue Try this source code view3d.doc.