shapes <- list(Tetrahedron=tetrahedron3d(), Cube=cube3d(), Octahedron=octahedron3d(),
Icosahedron=icosahedron3d(), Dodecahedron=dodecahedron3d(),
Cuboctahedron=cuboctahedron3d())
col <- rainbow(6)
open3d()
mfrow3d(3,2)
for (i in 1:6) {
next3d() # won't advance the first time, since it is empty
shade3d(shapes[[i]], col=col[i])
}
open3d()
mat <- matrix(1:4, 2,2)
mat <- rbind(mat, mat+4, mat+8)
layout3d(mat, height = rep(c(3,1), 3), model = "inherit")
for (i in 1:6) {
next3d()
shade3d(shapes[[i]], col=col[i])
next3d()
text3d(0,0,0, names(shapes)[i])
}Run the code above in your browser using DataLab