Preventing reflective surface in rasterVis

I did some tests and came up finding the ?rgl.material argument specular, which helped with the task.

See the example below:

library(raster)
library(rasterVis)

r = raster(volcano)

plot3D(r,lit=TRUE,specular="white") #white is default
plot3D(r,lit=TRUE,specular="black") #change specular to black

enter image description here


You will need to pass arguments to plot3D that modify rgl display characteristics using arguments available in "rgl.material". I would start with "shininess" or "luminance". You would just specify the associated rgl.material arguments directly in plot3D.

plot3D(foo, zfac=2, shininess=10) 

I'm pretty new with r and the rasterVis package as well. One thing that I've found helpful is exploring different color palettes to see if you can find one that better fits what you're looking for (without having to go in and try to modify the colors to fit exactly what I want). For example I've tried:

plot3D(foo, col=terrain.colors(6))

With pretty decent results. You can also experiment with palettes from the RColorBrewer package some of which seem to be less shiny. e.g:

plot3D(foo, col=brewer.pal(9, 'YlOrRd'))