[英]How to close rgl X11 windows?
我想用rgl
包創建一個3D動畫。 我的代碼是這樣的:
for (frame in 1:100) {
open3d()
... # run some commands here for plotting, like points3d() or spheres3d()
# Now, save the frame to a png file
rgl.snapshot(paste0("Frame",sprintf("%04d",frame),".png"))
}
它工作正常,並在每個幀的PNG文件中創建一個快照。 但在那之后,將有100個開放的X11窗口。 另一個問題是,我想打開許多窗戶的運行時間會太高。
我嘗試使用rgl.close()
和clear3d()
,它們都沒有正常工作(它們使輸出png文件為黑色)。
反正呢?
我意識到這是一個老問題,但這是我提出的關閉所有rgl windows
的簡單解決方案。
while (rgl.cur() > 0) { rgl.close() }
#rgl.close() ...工作正常,並且是自我解釋的
3D visualization device system
Description
3D real-time rendering system.
Usage
# Low level rgl.* interface
rgl.open(useNULL = rgl.useNULL()) # open new device
rgl.close() # close current device
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.