title: How to export an interactive rgl 3D Plot to share or publish?
body: <p>I have made an interactive 3D plot in R using the rgl package. I would like to be able to send it (and keep it interactive) to a colleague so she can present it (rotate it) in a meeting on her laptop. Is there a way to do this?</p>
  
  <p>Here is the code I used to generate the plot:</p>
  
  <p>And this is the plot:</p>
  
  <pre><code>library(rgl)
  plot3d(pcaGB$x[,1:3], col=gbMeta2.5K$gbColor, type='s', size=1)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/sruhb.png" alt="enter image description here"></p>
  
  <p>I am then using this code to export it to HTML using writeWebGL, but without any luck so far:</p>
  
  <pre><code>browseURL(paste("file://", writeWebGL(dir=file.path("~/Documents/", "webGL"), width=700), sep=""))
  </code></pre>
  
  <p>This is what I get back in a browser window:</p>
  
  <p><img src="https://i.stack.imgur.com/0wb6o.png" alt="enter image description here"></p>
  
  <p>I've also tried using just writeWebGL but that creates a folder in the directory with an index.html file that opens the same image as above in the browser.</p>