[vtkusers] all my streamlines are in white :(
Yifei Li
yifli82 at gmail.com
Wed Nov 9 10:07:05 EST 2011
Marcelino,
Thank you. I'll try you suggestion.
But at the same time, if you take a look at the example that comes with VTK
Examples/GUI/Python/StreamlinesWithLineWidget.py, no lookup table is set
for the streamMapper. Why?
Yifei
On Wed, Nov 9, 2011 at 8:16 AM, Marcelino Rodriguez Cancio <
marcelinorc at uclv.edu.cu> wrote:
> Yifei:****
>
> ** **
>
> I think you need to add a vtkLookUpTable:****
>
> ** **
>
> lut = vtkLookupTable()****
>
> lut.SetHueRange(667, 0.0)****
>
> lut.Build()****
>
> ** **
>
> streamMapper.SetLookupTable(lut)****
>
> ** **
>
> Greetings****
>
> Marcelino****
>
> ** **
>
> ** **
>
> *De:* vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] *En
> nombre de *Yifei Li
> *Enviado el:* martes, 08 de noviembre de 2011 08:24 p.m.
> *Para:* vtkusers at vtk.org
> *Asunto:* [vtkusers] all my streamlines are in white :(****
>
> ** **
>
> 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())****
>
> ** **
> ------------------------------
>
> -Universidad Central "Marta Abreu" de Las Villas. http://www.uclv.edu.cu
> -Participe en Universidad 2012, del 13 al 17 de febrero de 2012.
> Habana.Cuba. http://www.congresouniversidad.cu
> -Consulte la enciclopedia colaborativa cubana. http://www.ecured.cu/
>
> ****
>
> ------------------------------
> -Universidad Central "Marta Abreu" de Las Villas. http://www.uclv.edu.cu
> -Participe en Universidad 2012, del 13 al 17 de febrero de 2012.
> Habana.Cuba. http://www.congresouniversidad.cu
> -Consulte la enciclopedia colaborativa cubana. http://www.ecured.cu/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111109/ddff5770/attachment.htm>
More information about the vtkusers
mailing list