Skip to content
Prev 311072 / 398506 Next

Question about contour3d and writeWebGL: rgl and misc3d package

On 12-11-16 7:09 PM, John Muschelli wrote:
Sounds like a bug in the browser.  When I try it in Firefox 16.0.2 it 
doesn't display properly; the error log (found via Tools | Web developer 
| Error console has several errors in it, the first of which is:

Error: array initialiser too large

That's clearly a limitation of the browser.  You might be able to work 
around it by plotting one layer at a time; writeWebGL will write each 
rgl object in separate arrays of data.  If the layers are separate, the 
browser might be able to handle them.  I just tried this, and it works 
on my system, using this code:

contour3d(a, 1:64, 1:64, 1.5*(1:21), lev=c(3000),
  alpha = c(0.2), color = c("white"))

  contour3d(a, 1:64, 1:64, 1.5*(1:21), lev=c(8000),
  alpha = c(0.5), color = c("red"), add=TRUE)

  contour3d(a, 1:64, 1:64, 1.5*(1:21), lev=c(10000),
  alpha = c(1), color = c("green"), add=TRUE)

followed by the browseURL call you already had.

Duncan Murdoch