Another use for a 3d view


One element of the local climate that we are interested in is the effect of dry season insolation on vegetation patterns. This might be particularly important in areas of dry forest. Slopes that face south receive much more direct beam radiation during the dry winter months under clear skies than north facing slopes. This can be quantified using r.sun in GRASS. The following R code uses layers moved from GRASS to produce an animation in R. The previous function 3dview is needed to run the code that is available in one file here beam.doc




view.3d(grid=d,dem=1,drape=1,pal=terrain.colors(100),exag=1) #Get the viewpoint right

#Now run the loop

for (i in 2:13){

j<-as.character(sprintf(“%03.0f”, i))

#With image magick in Linux this then makes the animated gif

system(“convert -geometry 500 -delay 200 -loop 0 *.png beam.gif”)

The results can also be exported to Google Earth as an overlay using the function in maptools, or a version of it that I will include in another post. The kml overlay can be obtained here. Extract the contents of the zipped file to a single directory.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s