[vtkusers] all my streamlines are in white :(

Yifei Li yifli82 at gmail.com
Tue Nov 8 20:24:20 EST 2011


Hi all,

I want streamlines to be colored according to scalar values, but they are
all white. Can someone help me figure out what's wrong with my code? Thanks
 -Yifei

# vector field data
grid = vtkStructuredGrid()
grid.SetPoints(points)
grid.GetPointData().SetVectors(vectors)

....
streamer = vtkStreamTracer()
...
# show streamlines using ribbon
rf = vtkRibbonFilter()
rf.SetInputConnection(streamer.GetOutputPort())

streamMapper = vtkPolyDataMapper()
streamMapper.SetInputConnection(rf.GetOutputPort())

# I thought the following lines should make it
streamMapper.ScalarVisibilityOn()
streamMapper.SetScalarRange(0.0,
grid.GetPointData().GetVectors().GetMaxNorm())
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111108/13b62624/attachment.htm>


More information about the vtkusers mailing list