这是问题的可重现示例。我想用共享鼠标在
rgl中并排创建
plot3d
。
#use an example from rgl's manual
set.seed(1234)
x <- sort(rnorm(100))
y <- rnorm(100)
z <- rnorm(100) + atan2(x, y)
#create side by side plot
open3d()
mfrow3d(1, 2, sharedMouse=TRUE)
plot3d(x, y, z, col=rainbow(100))
arrow3d(c(0, 0, 0), c(2, 2, 2), type="lines")
next3d()
plot3d(x, y, z, col=rainbow(100))
到目前为止一切都很好。
现在将 arrow3d 叠加到右侧的绘图上
arrow3d(c(0, 0, 0), c(2, 2, 2), type="lines")
并且轴随箭头的变化而变化
无法弄清楚发生了什么。如果我在单独的
arrow3d()
调用中用 open3d()
绘制这两个图,它们看起来是相同的。我尝试了其他方法,例如 manipulateWidget包中的
combineWidgets
,它工作正常,但我无法弄清楚如何跨子场景共享鼠标。 plotly 会太棘手,因为我的应用程序需要沿着路径创建轨迹的许多 3d 箭头,而 3d 箭头显然不容易在注释之外的 plotly 中实现。
在 mac (x86_64-apple-darwin17.0) 上的 R 4.2.2 上运行 rgl 1.1.3。