# Draw some random triangles
M <- matrix(
data = rnorm(36),
ncol = 3,
nrow = 12
)
p <- plot3js(
xlim = range(M[,1]),
ylim = range(M[,2]),
zlim = range(M[,3]),
label_axes = FALSE
)
p <- triangle3js(
p,
vertices = M,
col = rainbow(nrow(M))
)
r3js(p, zoom = 2)
Run the code above in your browser using DataLab