threejsで遊ぶ

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)))