rgl.postscript              package:rgl              R Documentation

_e_x_p_o_r_t _s_c_r_e_e_n_s_h_o_t

_D_e_s_c_r_i_p_t_i_o_n:

     Saves the screenshot to a file in PostScript or other vector
     graphics format.

_U_s_a_g_e:

     rgl.postscript( filename, fmt="eps", drawText=TRUE )

_A_r_g_u_m_e_n_t_s:

filename: full path to filename.

     fmt: export format, currently supported: ps, eps, tex, pdf, svg,
          pgf 

drawText: logical, whether to draw text

_D_e_t_a_i_l_s:

     Animations can be created in a loop modifying the scene and saving
      a screenshot to a file. (See example below)

     This function is a wrapper for the GL2PS library by Christophe
     Geuzaine, and has the same limitations as that library:  not all
     OpenGL features are supported, and some are only supported in some
     formats. See the reference for full details.

_A_u_t_h_o_r(_s):

     Christophe Geuzaine / Albrecht Gebhardt

_R_e_f_e_r_e_n_c_e_s:

     GL2PS: an OpenGL to PostScript printing library by Christophe
     Geuzaine, <URL: http://www.geuz.org/gl2ps/>, version 1.3.2.

_S_e_e _A_l_s_o:

     'rgl.viewpoint', 'rgl.snapshot'

_E_x_a_m_p_l_e_s:

     x <- y <- seq(-10,10,length=20)
     z <- outer(x,y,function(x,y) x^2 + y^2)
     persp3d(x,y,z, col='lightblue')

     title3d("Using LaTeX text", col='red', line=3)
     rgl.postscript("persp3da.ps","ps",drawText=FALSE)
     rgl.postscript("persp3da.pdf","pdf",drawText=FALSE)
     rgl.postscript("persp3da.tex","tex")
     rgl.pop()
     title3d("Using ps/pdf text", col='red', line=3)
     rgl.postscript("persp3db.ps","ps")
     rgl.postscript("persp3db.pdf","pdf")
     rgl.postscript("persp3db.tex","tex",drawText=FALSE)

     ## Not run: 

     #
     # create a series of frames for an animation
     #

     rgl.open()
     shade3d(oh3d(), color="red")
     rgl.viewpoint(0,20)

     for (i in 1:45) {
       rgl.viewpoint(i,20)
       filename <- paste("pic",formatC(i,digits=1,flag="0"),".eps",sep="") 
       rgl.postscript(filename, fmt="eps")
     }

     ## End(Not run)

