我一直在尝试绘制一个带有颜色的 3d 网格,plotly
但面部颜色一直被错误地分配。
library(plotly)
library(Rvcg)
# example mesh
plyFile <-
"https://www.dropbox.com/sh/c3bcbr6y9lidggg/AAD2cWFZEZczBIMXT0vdyGoia?dl=0?
raw=1"
download.file(plyFile, "Ellipsoid_colour.ply")
# plot 3d mesh
mesh <-vcgImport("Ellipsoid_colour.ply", readcolor = TRUE)
facecolor <- mesh$material
plot_ly(
x = mesh$vb[1, ], y = mesh$vb[2, ], z = mesh$vb[3, ],
i = mesh$it[1, ] - 1, j = mesh$it[2, ] - 1, k = mesh$it[3, ] - 1,
facecolor = toRGB(facecolor$color),
type = "mesh3d"
)