在 rgl 中填充轮廓
以下代码绘制一些点并用线连接它们。我要填写 由选择颜色和 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)))
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)))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
怎么样:
?
How about:
?