AnimationWithoutControlPanel

#!/usr/bin python
# example of animation without control panel
# provides clean window for animation and interactive control
import mayavi
import time

def vu(x,y,z,vv):
    vv.renwin.camera.SetPosition(x,y,z)
    vv.renwin.camera.SetViewUp(1,1,0)
    vv.renwin.ren.ResetCamera()
    vv.renwin.Render()
# use time to control animation speed
    time.sleep(.1)

v=mayavi.mayavi()
d=v.open_vtk('brain.vtk', config=0)
v.show_ctrl_panel(0)
m=v.load_module('PolyData', 0)

for i in range(0,100,1):
    vu(10,i/2.,i*2.,v)
# v.renwin.save_bmp('anix%d.bmp'%i)
v.master.wait_window() 

last edited 2004-02-29 06:02:23 by free82


SourceForge.net Logo