如何在mayavi动画中捕捉键盘事件

2024-09-30 02:31:26 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在寻找一种捕捉键盘事件的方法,以便在玛雅维动画中循环使用不同的数据集。在

我的基本循环是:

while 1:
    time = TIME() - zero
    wx.Yield()
    atomsanim[:,:3] = atoms[:,3:]*cos(speed*time) + atoms[:,:3]
    f.scene.disable_render = True
    atom_index = 0
    for t, p in zip(types, plots):
        ms = p.mlab_source
        start = atom_index
        stop = atom_index+t
        ms.set(x=atomsanim[start:stop,0],y=atomsanim[start:stop,1],z=atomsanim[start:stop,2])
        atom_index += t
    f.scene.disable_render = False

mlab.show()

Tags: 方法indextime事件键盘renderscenestart

热门问题