On 8/23/2006 4:13 PM, Gaspard Lequeux wrote:> Hej,
>
> When plotting triangles with rgl.triangles and setting the axes afterwards
> with decorate3d(aspect=TRUE), the axes get the color used for the last
> triangle plotted.
>
> Example:
>
> rgl.triangles(c(1,2,3),c(1,2,5),c(1,3,2),col="#55FF55")
> decorate3d(aspect=TRUE)
>
> Using
>
> decorate3d(aspect=TRUE,col="#000000")
>
> or
>
> decorate3d(aspect=TRUE,color="#000000")
>
> does not help, the axes still have the last color used for plotting an
> object.
You should use triangles3d if you don't want the material changes to
carry over to the next call. Generally speaking it's hard to get things
right when you mix the rgl.* calls (which assume changes are persistent)
with the *3d calls (which assume they're not).>
> In the help page of decorate3d on can find the following line:
>
> ...: additional parameters which will be passed to 'par3d',
> 'material3d' or 'decorate3d'.
>
> So the 'color' argument should have an effect.
Yes, that's a bug, which has been fixed (but not released yet). There
should be a release pretty soon now. Daniel Adler and I are hoping to
have a version 1.0 in the next couple of months; I expect one or two
more 0.x releases before that.
>
> The workaround is simple. Set the color with rgl.material before calling
> decorate3d:
>
> rgl.material(color="#000000")
>
> Maybe this should be done directly in the decorate3d function, as written
> in the help?
>
> Version of rgl used: 0.67-2 (2006-07-11)
> Version of R used: R 2.3.1; i486-pc-linux-gnu; 2006-07-13 01:31:16;
>
> Anyway, rgl is an excellent package.
Thanks. It's still getting better.
Duncan Murdoch
>
> /Gaspard
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.