[vtkusers] Creating an animation of a sequence of Data

Moritz Bernard Fricke Moritz.Bernard.Fricke at rwth-aachen.de
Thu May 8 05:41:30 EDT 2008


Hi all!

I have created a set of iso surfaces in a vrml-room for one point in time. As the calculation is very slow, i want to do an offline-calculation for every 10ms and then create an animation for this sequence using vtkAnimationScene. As you can see below, i'm using vtkGaussianSplatter and vtkContourfilter to create iso surfaces from an UnstructuredGrid called 'intergrid' 

Can anybody help me with that?

[...]
aisoGS=vtk.vtkGaussianSplatter()
aisoGS.SetInput(intergrid)
aisoGS.ScalarWarpingOn()
aisoGS.SetAccumulationModeToSum()

iso=vtk.vtkContourFilter()
iso.SetInputConnection(aisoGS.GetOutputPort())
iso.GenerateValues(3,0.7*maxdensity,maxdensity)

isoMapper = vtk.vtkPolyDataMapper()
isoMapper.SetInput(iso.GetOutput())

isoActor=vtk.vtkActor()
isoActor.SetMapper(isoMapper)
isoActor.GetProperty().SetOpacity(0.3)
isoActor.AddPosition(0,0,0)

room.SetRenderWindow(ren.GetRenderWindow())
room.SetRenderWindow(ren.GetRenderWindow())
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren)
renWin.FullScreenOn()
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)

ren.SetBackground(.1, .2, .4)

ren.AddActor(isoparticleActor)
#ren.AddActor(particleActor)
#ren.AddActor(triangulation)
#ren.AddActor(isoActor)

# Set camera values
ren.ResetCamera()
ren.GetActiveCamera().Azimuth(0)
ren.GetActiveCamera().Elevation(0)
ren.GetActiveCamera().Dolly(10)
ren.GetActiveCamera().SetViewAngle(90)
ren.ResetCameraClippingRange()

# Render the scene and start interaction.
iren.Initialize()
renWin.Render()
iren.Start()



More information about the vtkusers mailing list