[vtkusers] scatter3

John Hunter jdhunter at ace.bsd.uchicago.edu
Tue Jun 1 15:49:39 EDT 2004


I need to plot a 3D scatter plot.  I have a sequence of x,y,z,
tuples.  Currently I am plotting a bunch of spheres, but seem to be
hitting the wall performance wise with 20000+ points

What is the most efficient way to do a large scatter in VTK.  I
initially thought vtkPointSource was what I was looking for but then
discovered it generates random points.

Here is what I am doing currently:

def scatter3(pnts):
    window, renwin, renderer = _get_gtkvtk_stuff()
    for x,y,z in pnts:
        pnt = vtk.vtkSphereSource()
        res = 20
        pnt.SetThetaResolution(res)
        pnt.SetPhiResolution(res)
        pnt.SetCenter(x,y,z)
        pnt.SetRadius(10)
        
        mapper = vtk.vtkPolyDataMapper()
        mapper.SetInput(pnt.GetOutput())

        actor = vtk.vtkActor()
        actor.SetMapper(mapper)
        actor.GetProperty().SetColor( 0,1,1 )
        renderer.AddActor(actor)
    window.show()

Thanks,
JDH



More information about the vtkusers mailing list