The writeWebGL function from the {rgl} package can be used to export interactive 3D plots to HTML (see example below).
require(rgl)
jet.colors <-colorRampPalette(c("#00007F", "blue", "#007FFF", "cyan",
"#7FFF7F", "yellow", "#FF7F00", "red", "#7F0000"))
colorzjet <- jet.colors(100)
data(volcano)
z <- 5 * volcano # Exaggerate the relief
x <- 10 * (1:nrow(z)) # 10 meter spacing (S to N)
y <- 10 * (1:ncol(z))
open3d()
bg3d("white")
material3d(col="black")
persp3d(x, y, z, col = colorzjet[ findInterval(z, seq(min(z), max(z), length=100))], aspect="iso",axes = TRUE, box = FALSE, smooth=FALSE,lit=FALSE,front="fill")
surface3d(x, y, z, front = "lines",col="black", lit=FALSE)
browseURL(paste("file://", writeWebGL(dir=file.path("C:/", "webGL"), width=700), sep=""))
It does not, however, currently support wireframe or point rendering, meaning that 3D surfaces will be exported as polygons without visible edges.
Does anyone know a way around that? I'd like my HTML file to show the edges of each facet on the 3D surface.