From murdoch.duncan at gmail.com  Mon Mar 31 19:49:18 2014
From: murdoch.duncan at gmail.com (Duncan Murdoch)
Date: Mon, 31 Mar 2014 13:49:18 -0400
Subject: [Rd] rgl question
In-Reply-To: <CADUbQ5juFZ0R2O-93kEFPfGF2U8O4n+YRZMeCs2z4i0j8JVA3g@mail.gmail.com>
References: <CADUbQ5iKuXw_A7R2-6JZk0GK99jEOr2eRBBy2_CdfmKAX2Aj7A@mail.gmail.com>	<533938EA.30304@gmail.com>
	<CADUbQ5juFZ0R2O-93kEFPfGF2U8O4n+YRZMeCs2z4i0j8JVA3g@mail.gmail.com>
Message-ID: <5339AA9E.7090409@gmail.com>

On 31/03/2014 12:56 PM, Dominick Samperi wrote:
> Thanks for the comment. No, there were no such prior calls,
> unless rgl.lines() itself sets lty to dashed?
>
> Here is a simple session run under Windows:
> library(rgl)
> x <- 1:20
> y <- 1:20
> z <- 1:20
> rgl.lines(x,y,z) # displays dashed line
> lines3d(x,y,z)  # displays solid line

Sorry, what I said was true, but wasn't helpful.  The real explanation 
is that rgl.lines corresponds to segments3d, not to lines3d.  It pairs 
up the points and draws line segments, it doesn't join the points.  Use 
rgl.linestrips (the OpenGL terminology) if you want the equivalent of 
lines3d but with the persistant material properties.

I had forgotten that, because I never use the rgl.* functions.  I would 
say "neither should you", but there might be some good reason to do so.

Duncan Murdoch
>
> I'm using R 3.1.0 alpha
>
> On Mon, Mar 31, 2014 at 5:44 AM, Duncan Murdoch
> <murdoch.duncan at gmail.com> wrote:
> > On 30/03/2014, 9:20 PM, Dominick Samperi wrote:
> >>
> >> Hello,
> >>
> >> If I call lines3d(x,y,z) I get lines connecting each point, but
> >> when I call rgl.lines(x,y,z) I get dashed lines, and adding
> >> something like type='l' leads to an error message. The
> >> docs seem to suggest that rgl.lines() calls lines3d(), so
> >> I would expect the result to be the same.
> >>
> >> Any tips would be appreciated.
> >
> >
> > The difference is in how they use the material properties:  rgl.lines sets
> > them permanently, lines3d restores the original value after the call.  So
> > I'd guess your call to rgl.lines followed a call to another rgl.* function
> > that set the lty property to dashed.
> >
> > Duncan Murdoch



[Rd] rgl question
Duncan Murdoch