在 rgl 中填充轮廓 [英] Fill an outline in rgl

查看:26
本文介绍了在 rgl 中填充轮廓的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

The following code draws some points and connects them with lines. I want to to fill in the area enclosed by the lines choosing color and alpha. I can't seem to see how to do that using 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)))

推荐答案

怎么样:

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

?

这篇关于在 rgl 中填充轮廓的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆