[R] question on rgl.surface

From: Mark Kimpel <mwkimpel_at_gmail.com>
Date: Sat, 21 Jun 2008 14:48:54 -0400


I'd like to use rgl.surface (or some other function if more appropriate) to create a horizontal and vertical transparent grey slice (plane) running through both the x and y origins and extending across the z axis, i.e. the 3-d equivalent of the normal 2-d coordinate axes we are all familiar with. The examples for rgl.surface are a bit more complex than what I need and I am having trouble understanding them.

Here is the code if I come up with, but which obviously doesn't work.

require(rgl)
set.seed(123)
d3.mat <- matrix(runif(30, min = -5, max = 5), ncol = 3, nrow = 10) open3d()
plot3d(x = d3.mat, type = "s", col = "blue", size = 0.33, xlab ="x", ylab = "y", zlab = "z")

x <- 0
y <- 0
z <- matrix(c(floor(min(d3.mat[,1])),ceiling(max(d3.mat[,1])),floor(min(d3.mat[,3])),ceiling(max(d3.mat[,3]))),nrow
= 2, ncol =2)
rgl.surface(x, z, y, color="grey", back="lines")

What am I doing wrong?

And, while I'm at it, there is another minor question I have, which is "how can I exaggerate the size difference in the spheres between front and back?"

Thanks,
Mark

-- 
Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
Indiana University School of Medicine

15032 Hunter Court, Westfield, IN 46074


(317) 490-5129 Work, & Mobile & VoiceMail
(317) 663-0513 Home (no voice mail please)
______________________________________________ R-help_at_r-project.org 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.
Received on Sat 21 Jun 2008 - 18:51:03 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 22 Jun 2008 - 02:30:50 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive