Skip to content

transparent surface in rgl

7 messages · Prof. Paul R. Fisher, John Fox, vincent@7d4.com +2 more

#
Hi all
I am a complete newbie to this list (just subscribed) and a newcomer to 
R (an S user from olden times). I have been using scatter3d to create a 
3d scatter plot with surface. The graphic is created within the rgl 
package and I have used rgl.postscript to export it so I can generate a 
publication quality image. My problem is that the plotted surface is no 
longer transparent in the postscript output ie. the rgl.spheres that are 
behind the surface disappear in the postscript image. Can't seem to find 
any info on this anywhere. Am I doing something wrong? Is there an easy fix?

Anyway, thanks.
Hope I've not broken some netiquette rule sending this.

Cheers,
Paul Fisher.
#
Dear Paul,

I don't have experience with rgl.postscript(), which is relatively new, but
find that the png graphs produced by rgl.snapshot() are of reasonably good
quality and preserve transparency. Perhaps the developers of the rgl package
can shed more light on the matter.

I hope this helps,
 John

--------------------------------
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
--------------------------------
#
On 10/5/2005 9:31 AM, Prof. Paul R. Fisher wrote:
I think Postscript doesn't support transparency (or at least the version 
of Postscript that the rgl.postcript function targets doesn't support 
it).  You may have to export a bitmapped format using the rgl.snapshot() 
function.  If your original window is very large this may give you good 
enough quality.

Duncan Murdoch
#
Prof. Paul R. Fisher a ??crit :
Hi,
for many graphical function, eg bmp()
there is a bg argument (background)
which you can set to "transparent".
Or you can directly use:
par(bg="transparent")
Have a look if this doesn't work.
hih
Vincent
#
On Wed, 5 Oct 2005, Duncan Murdoch wrote:

            
Common PostScript (level 2) does not support either full or partial 
transparency (and I guess partial transparency is meant here or the 
surface could just not be plotted).  It would be good to have a rgl.pdf 
which did.  These days PDF is the `portable PostScript' and since version 
1.4 has had alpha-channel supoort.

Ref:

http://en.wikipedia.org/wiki/Transparent_pixels#Transparency_in_PostScript
#
On 10/5/2005 11:10 AM, Prof Brian Ripley wrote:
The library we use (GL2PS) apparently supports PDF output, and that's 
one of the format options for rgl.postscript(), so maybe we already do 
support that.  I haven't tried it.

Duncan Murdoch
#
On 10/5/2005 11:33 AM, Duncan Murdoch wrote:
I've just checked, and currently transparency isn't supported even with 
PDF output.  I tried updating the version of GL2PS and turning on 
transparency support, but so far no luck at all.

If anyone wants to follow up on this I think it would be a nice 
addition, but otherwise, I think the PNG output is the best we can do.

Duncan Murdoch