【问题标题】:Fill an outline in rgl用rgl填充轮廓
【发布时间】:2012-01-26 17:50:36
【问题描述】:

以下代码绘制了一些点并用线将它们连接起来。我要填写 由选择颜色和 alpha 的线包围的区域。我似乎看不到如何使用 rgl 来做到这一点

# Open plot and add axes
open3d()
decorate3d(xlim=c(0,4), ylim=c(0,4), zlim=c(0,4), 
       xlab = NULL, ylab = NULL, zlab = NULL,
       box = FALSE, axes = FALSE, 
       main = "", sub = NULL,
       top = TRUE, aspect = FALSE)
axis3d(edge="z", col="blue")
axis3d(edge="x", col="green")
axis3d(edge="y", col="green")
# Draw some points and connect by lines
#             x y z 
vs = matrix(c(1,1,1, 1,2,1, 2,3,1, 2,3,2, 1,2,2, 1,2,2, 1,1,2), byrow=TRUE, ncol=3)
points3d(vs, size=4, col="red")
lines3d(rbind(vs, c(1,1,1)))

【问题讨论】:

    标签: r plot 3d rgl


    【解决方案1】:

    怎么样:

    quads3d(vs[c(1:2,5,7),],col="purple",alpha=0.5)
    quads3d(vs[c(2:5),],col="cyan",alpha=0.5)
    

    ?

    【讨论】:

    • 谢谢。 rgl 很棒,但文档很简洁
    猜你喜欢
    • 2013-10-13
    • 2021-03-17
    • 2013-01-01
    • 1970-01-01
    • 2014-11-26
    • 1970-01-01
    • 2022-01-24
    • 1970-01-01
    相关资源
    最近更新 更多