I have data for 3D facia surface mesh. Data are available here, where vb.xlsx contains coordinates for 7160 3D vertices and it.xlsx contains face information. The color coding.t
The tricky thing in colouring surfaces is deciding how to use the colours. You can colour by vertex, by edge, or by face. You want to do it by vertex.
As long as you are using rgl
version 0.100.2 or newer, this is relatively easy. Specify the colours one per vertex, and use argument meshColor = "vertices"
to tell rgl
that's what you did.
For example,
shade3d(try2, col=c("green", "pink")[col], meshColor = "vertices", specular = "#202020")
which gives
This version of rgl
isn't on CRAN yet, but it's available on R-forge and Github.