[vtkusers] Fwd: Re: Glyph coloring by vector magnitud

Sebastian Gatzka sebastian.gatzka at stud.tu-darmstadt.de
Fri Feb 26 04:53:25 EST 2010



Unfortunately this does not work for me.
Despite turning off the data scaling I can scale the glyphs from their 
magnitude, but not color them by their magnitude.

     vtkArrowSource *arrow = vtkArrowSource::New();

     vtkGlyph3D *glyph = vtkGlyph3D::New();
     glyph->SetInput(gridCellCenters->GetOutput());
     glyph->SetSourceConnection(arrow->GetOutputPort());
     glyph->SetScaleMode(VTK_SCALE_BY_VECTOR);
     glyph->SetColorMode(VTK_COLOR_BY_VECTOR);
     glyph->SetScaleFactor(0.1);

This code generates *scaled but uniform colored* vectors.


Am 22.02.2010 16:33, schrieb Rakesh Patil:
> Its because you have turned of the scaling mode. When you say, 
> SetScaleModeToDataScalingOff(), all glyphs are rendered of equal length.
>
> In the next step, you are saying,
>
> SetColorModeToColorByScale();
>
> you'll see that all the glyphs are of same scale. Thus, all glyphs are 
> rendered with same color. I think, Once you comment or remove
>
> SetScaleModeToDataScalingOff()
>
> then, it should work fine..
>
> Seniors please correct me if i'm wrong..
>
> Good luck
>
> Regards
> Rakesh Patil
>
>
>
>
>     ---------- Original message ----------
>     From:Sebastian Gatzka< sebastian.gatzka at stud.tu-darmstadt.de >
>     Date: 22 Feb 10 19:37:52
>     Subject: [vtkusers] Glyph coloring by vector magnitud
>     To: vtkusers at vtk.org
>
>     Hello World.
>
>     Meanwhile I made some nice glyphs, but am stuck with the coloring.
>     I switched on SetColorModeToColorByVector() which may be the
>     coloring by vector magnitude?
>
>     vtkGlyph3D *glyph vtkGlyph3D::New();
>     glyph->SetInput(gridCellCenters->GetOutput());
>     glyph->SetSourceConnection(arrow->GetOutputPort());
>     glyph->SetScaleModeToDataScalingOff();
>     glyph->SetColorModeToColorByScale();
>     glyph->SetScaleFactor(0.3);
>
>     Unfortunately all glyphs are colored the same (blue).
>     Do I have to do anything further to get propper coloring? Maybe
>     with the mapper?
>
>     See you. Sebastian
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100226/d15105da/attachment.htm>


More information about the vtkusers mailing list