使用BGPLOT3D时RGL椭圆3D透明度问题

发布于 2025-02-09 19:53:55 字数 750 浏览 0 评论 0原文

我的目标是使用RGL在透明球上显示点。通过使用

open3d(windowRect=c(0,0,512,512))
plot3d(c(x,-x),c(y,-y),c(z,z),aspect=F)
shade3d(ellipse3d(diag(3), c(0,0,0),t=1),
        color='lightgray',alpha=0.8,lit=FALSE, add=TRUE)
rglwidget()

“正确具有点的球”

但是,当在函数中调用函数bgplot3d()时,将球形以某种方式推入前景并淹没了所有点和所有点周围的盒子:

“带有点溺水的球”

以与以前相同的方式拥有球体也很棒,即使在情况bgplot3d()中也被调用。我已经尝试了depth_mask,但是到目前为止什么都没有。

My goal is to display points on a transparent sphere using RGL. This works fine by using

open3d(windowRect=c(0,0,512,512))
plot3d(c(x,-x),c(y,-y),c(z,z),aspect=F)
shade3d(ellipse3d(diag(3), c(0,0,0),t=1),
        color='lightgray',alpha=0.8,lit=FALSE, add=TRUE)
rglwidget()

sphere with points correctly

However, when in the same plot the function bgplot3d() is called, the sphere is somehow pushed into the foreground and drowns out all the points and the box around it:

sphere with points drowned

It would be great to have the sphere in the same way as before, even in the case bgplot3d() has been called. I already experimented with depth_mask, but nothing worked so far.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

唯憾梦倾城 2025-02-16 19:53:55

调用plot3d shade3d之后:

library(rgl)

set.seed(666)
pts <- uniformly::runif_on_sphere(25, d = 3)
x <- rnorm(100)
y <- rnorm(100)

open3d(windowRect = c(50, 50, 562, 562))
shade3d(ellipse3d(diag(3), t = 1),
        color = 'lightgray', alpha = 0.8, lit = FALSE)
plot3d(pts, aspect = FALSE, add = TRUE, col = "red", size = 4)
bgplot3d(plot(x, y))

Call plot3d after shade3d:

library(rgl)

set.seed(666)
pts <- uniformly::runif_on_sphere(25, d = 3)
x <- rnorm(100)
y <- rnorm(100)

open3d(windowRect = c(50, 50, 562, 562))
shade3d(ellipse3d(diag(3), t = 1),
        color = 'lightgray', alpha = 0.8, lit = FALSE)
plot3d(pts, aspect = FALSE, add = TRUE, col = "red", size = 4)
bgplot3d(plot(x, y))
执笔绘流年 2025-02-16 19:53:55

安装最新的RGL更新(版本0.109.2)后,问题已经消失。

The problem has vanished after installing the most recent rgl update (version 0.109.2).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文