Я ищу способ перехватывать события клавиатуры, чтобы перебирать разные наборы данных в анимации Mayavi.
Мой основной цикл:
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()
UserInteractorStyle
. Исходный код для этого находится вtvtk/tvtk_classes.zip/interactor_style_user.py
. - person aestrivex   schedule 25.02.2014