xyz <- cbind(c(0,1,1,0), c(0,0,1,1), c(0,0,0,0))
st <- xyz[,1:2]
open3d()
id <- quads3d(xyz, texcoords = st,
texture = as.raster(matrix(colors()[1:120], ncol = 10)),
col="white")
material3d(id = id, "texture")
textureSource(material3d(id = id, "texture"))
Run the code above in your browser using DataLab