[R] How do I connect dots in the RGL package?

David Winsemius dwinsemius at comcast.net
Tue Jun 12 18:32:45 CEST 2012


On Jun 12, 2012, at 11:45 AM, Maaike_020 wrote:

> Hi all,
>
> I just started using the rgl package in R, and I need to know how I  
> connect
> the dots I created. A simple line from one coördinate (x0,y0,z0) to  
> another
> (x1,y1,z1) will do. I tried using the code rgl.lines, but it doesn't  
> accept
> lines that don't stem from O (0,0,0).  Please help!

The help page for rgl.lines makes clear that it is a low level  
function and that line3d is what regular users would be expected to use.


 > open3d()
[1] 2
 >   points3d(rnorm(10),rnorm(10),rnorm(10))
 >
 >   # First add standard axes
 >   axes3d()
 > lines3d( x=c(-1,1), y=c(-1,1), z=c(-1,1) ,col="red")



David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list