[R] RGL 3D curvilinear shapes

PatGauthier pgauthi1 at lakeheadu.ca
Tue Jul 10 18:01:57 CEST 2012


Dear useRs, 

I'm trying to simply fill in the area under a curve using RGL. Here' the set
up:

x <- c(0.75,75.75,150.75,225.75,300.75,375.75,450.75,525.75,600.75,675.75,
       0.5,50.5,100.5,150.5,200.5,250.5,300.5,350.5,400.5,450.5,
       0.25,25.25,50.25,75.25,100.25,125.25,150.25,175.25,200.25,225.25)
y <- c(0.05,4.91,9.78,14.64,19.51,24.38,29.24,34.11,38.97,43.84,
       0.1,9.83,19.56,29.29,39.02,48.75,58.48,68.21,77.94,87.67,
       0.15,14.74,29.34,43.93,58.53,73.13,87.72,102.32,116.91,131.51)
z <- c(0.05,0.55,0.7,0.78,0.83,0.87,0.9,0.92,0.93,0.94,
       0,0.32,0.59,0.77,0.87,0.93,0.96,0.98,0.99,1,
       0,0.39,0.66,0.82,0.9,0.95,0.97,0.99,0.99,1)

dat <- data.frame(x = x, y = y, z = z, ID = c(rep(c(1,2,3),each=10)))

plot3d(dat, type = "n", ylab = "", xlab = "", zlab = "", axes = F, ylim =
c(0,200))
lines3d(dat[1:10,])
lines3d(dat[11:20,])
lines3d(dat[21:30,])

axes3d(edge = c("x--", "y-+", "z--"), nticks = 5, ylim = c(0,200))
bbox3d(color = c("black", "white"), lit = F, back = "line")

Any ideas/tips on how to do this?

thanks in advance, 

Patrick

--
View this message in context: http://r.789695.n4.nabble.com/RGL-3D-curvilinear-shapes-tp4636011.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list