This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
source('D:/twotera/GIT/gris/inst/rglnavigation/mouseCallbacks.R')
library(rgl)
library(rglwidget)
# Synchronize mouse control of two windows for stereo view
example(surface3d, echo = FALSE)
par3d(windowRect= c(0,32,512,544), userMatrix = rotationMatrix(5*pi/180, 0,1,0) %*% par3d("userMatrix") )
w1 <- rgl.cur()
example(surface3d, echo = FALSE)
subid <- currentSubscene3d()
rglwidget(elementId="rgl0")
par3d(windowRect = c(512,32,1024,544))
w2 <- rgl.cur()
mouseTrackball(dev=c(w1,w2))
mouseZoom(2,dev=c(w1,w2))
mouseFOV(3,dev=c(w1,w2))
subid <- currentSubscene3d()
rglwidget(elementId="rgl1")
rgl.close()