[vtkusers] Visualizing Points

Christian Pfaffel flash at itp.tu-graz.ac.at
Fri Jun 7 04:04:27 EDT 2002


Hello,

I have a rather simple problem, I think at least. I have a dataset 
consisting of x,y,z coordinates (forming a torus) with a scalar value
(Magnetic Field) assigned.
I want to show the surface(and cuts), mapped to 
colors according to its magnetic value. I do not know though which filters 
to use. I have tried to use something like this:

-----------
bfield = vtkFloatArray()
points = vtkPoints()

#filling up bfield and points with values
[...]

bfield.CreateDefaultLookupTable()
grid = vtkPolyData()
grid.SetPoints(points)
grid.GetPointData().SetScalars(bfield)

mapper = vtkDataSetMapper()
mapper.SetInput(grid)
mapper.SetLookupTable(bfield.GetLookupTable())
mapper.SetScalarRange(0,2)

actor = vtkActor()
actor.SetMapper(mapper)

renderer = vtkRenderer()
renderer.AddActor(actor)
renderer.SetBackground(1,1,1)
renwin = vtkRenderWindow()
renwin.AddRenderer(renderer)
iren = vtkRenderWindowInteractor()
iren.SetRenderWindow(renwin)
iren.Initialize()
iren.Start()

----------

The problem is, I have browsed the example source codes, looked in the 
"VTK Users's Guide", but there never is an example given that shows how to 
make a "surfaceplot".

Any help will be appreciated

regards,
Christian Pfaffel

-- 
PGP-Key: http://fubphpc.tu-graz.ac.at/~flash/pubkey.gpg




More information about the vtkusers mailing list