在图形网格中混合颜色

时间:2018-02-01 23:39:56

标签: r plotly r-plotly

我一直试图用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"
)

应该是这样的 - enter image description here 但显示为 - enter image description here 有谁知道如何解决这个问题?

0 个答案:

没有答案