library(threejs)
library(dplyr)
library(data.table)
library(threejs)
z <- seq(-10, 10, 0.01)
x <- cos(z)
y <- sin(z)
scatterplot3js(x,y,z, color=rainbow(length(z)))
dat = expand.grid(x = 1:100 * 0.01, y = 1:100 * 0.01)
dat = dat %>%
mutate(z = (x-1/2)^2 + (y-1/2)^2) %>%
arrange(z)
scatterplot3js(dat$x,dat$y,dat$z, color = heat.colors(length(dat$z)))