[R] Exporting an rgl graph

Duncan Murdoch murdoch.duncan at gmail.com
Tue Apr 20 17:24:27 CEST 2010


On 20/04/2010 10:43 AM, luke at stat.uiowa.edu wrote:
> On Fri, 16 Apr 2010, Michael Friendly wrote:
>
> > luke at stat.uiowa.edu wrote:
> >> The current issue of JCGS (Vol 18 No 1,
> >> http://pubs.amstat.org/toc/jcgs/19/1) has an editorial on including
> >> animations, 3D visualizations, and movies in on-line PDF files
> >> supporting JCGS articles. The online supplements to the editorial
> >> include examples.  The 3D examples related to the misc3d packages are
> >> also available in
> >> http://www.stat.uiowa.edu/~luke/R/misc3d/misc3d-pdf/.  At some point
> >> the code there will be added to misc3d.  It should be possible to
> >> adapt these ideas to other objects rendered with rgl.
> >> 
> >> luke
> >
> > Luke,
> > Your misc3d-pdf example is very instructive and the .tex file shows how
> > to embed in LaTeX.  Thanks! (JCGS 19(1) is actually one of the nicest
> > issues in a long time.)
> > Of the two approaches you
> > describe, the Asymptote route seems easier and more capable than the
> > MeshLab one.
>
> The Asymptote/PRC route was the only one I could find (with a limited
> amoutn of time and effort I could put in) that would support both
> color and transparency.  The downside is that PRC suport requires very
> new Adobe readers and seems to result in huge files. I know the U3D
> format support color but MeshLab doesn't seem to put color into its
> U3D exports.  I forget whether U3D supports transparency. Someone with
> the energy and motivation to do so can read the binary file format
> specs and write these file formats directly usign alltheir
> cababilities, but I wasn't up to doing that at the time.
>
> > It would be particularly useful to have this capability available for rgl. 
> > Any plans for this?
>
> Not on my part.  misc3d scenes are very simple -- just triangular mesh
> objects with optional color or transparency. rgl handles much richer
> scenes so figuring out how to translate such scenes to one of the
> binary formats would be a lot more work. On the other hand it may
> already have been done in the OpenGL community.
>   

It's on my wish list, but I'm spending too much time fighting to get my 
email working to actually work on anything.

The way the rgl.postcript conversion works (using the gl2ps library) is 
to redirect OpenGL calls into calls to generate Postscript.  Working at 
this level seems like the right approach, but I don't know if anyone has 
done it for these newer formats.

Duncan
> >
> > One note:  With Adobe Acrobat Pro 9.3.1, the U3D and PRC images display
> > on screen, but do not print (replaced by the filename).  Is this your
> > experience too?
>
> I believe so.  There may well be a way of including a static image in
> the LaTeX that would be used by printing and readers that don't
> understand the embedded formats, but I haven't had the chance to check
> the movie15 documentation for that.
>
> luke
>
> >
> > -Michael
> >
> >
> >
>
>



More information about the R-help mailing list