x <- seq(-10, 10, length= 30) y <- x f <- function(x,y) { r <- sqrt(x^2+y^2); 10 * sin(r)/r } z <- outer(x, y, f) z[is.na(z)] <- 1 op <- par(bg = "white") persp(x, y, z, theta = 30, phi = 30, expand = 1, col = "lightblue", ltheta = 120, shade = 0.75, ticktype = "detailed", xlab = "X", ylab = "Y", zlab = "Z",main="Dziwna figura 3d, co teraz?" ) -> res round(res, 3) source<-c(); for(i in 1:1000) { a<-20*runif(2)-10; b<-10*runif(1); t=0; Sys.sleep(0.1); source<-c(source,t); lines(trans3d(x=a[1],y=a[2],z=b,pmat=res),type="p",lwd=1,col="green"); }