<br>It should set the colors.. Tell me what type of grid are you using..?? And what is the vector array that you are setting to this Grid??<br><blockquote><br>---------- Original message ----------<br>From:Sebastian Gatzka< sebastian.gatzka@stud.tu-darmstadt.de ><br>Date: 26 Feb 10 15:23:25<br>Subject: [vtkusers] Fwd: Re:Glyph coloring by vector magnitud<br>To: vtkusers@vtk.org<br><br>
<br>
<br>
<font size="-1"><font face="Helvetica, Arial, sans-serif">Unfortunately
this does not work for me.<br>
Despite turning off the data scaling I can scale the glyphs from their
magnitude, but not color them by their magnitude.<br>
<br>
vtkArrowSource *arrow = vtkArrowSource::New();<br>
<br>
vtkGlyph3D *glyph = vtkGlyph3D::New();<br>
glyph->SetInput(gridCellCenters->GetOutput()); <br>
glyph->SetSourceConnection(arrow->GetOutputPort());<br>
glyph->SetScaleMode(VTK_SCALE_BY_VECTOR);<br>
glyph->SetColorMode(VTK_COLOR_BY_VECTOR);<br>
glyph->SetScaleFactor(0.1);<br>
<br>
This code generates <b>scaled but uniform colored</b> vectors.<br>
<br>
</font></font><br>
Am 22.02.2010 16:33, schrieb Rakesh Patil:
<font color="#000000"></font><blockquote cite="mid:1266852829.211ed78fe91938b90f84a51944b08d5a@mail.in.com" type="cite"><font color="#000000"> Its because you have turned of the scaling mode. When you
say, SetScaleModeToDataScalingOff(), all glyphs are rendered of equal
length.<br>
<br>
In the next step, you are saying,<br>
<br>
SetColorModeToColorByScale();<br>
<br>
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 <br>
<br>
SetScaleModeToDataScalingOff()<br>
<br>
then, it should work fine..<br>
<br>
Seniors please correct me if i'm wrong..<br>
<br>
Good luck<br>
<br>
Regards<br>
Rakesh Patil<br>
<font size="-1"><font face="Helvetica, Arial, sans-serif"><font face="Courier New, Courier, monospace"><br>
<br>
</font></font></font><br>
<font color="#000000"></font></font><blockquote><font color="#000000"><font color="#000000"><br>
---------- Original message ----------<br>
From:Sebastian Gatzka< <a target=\"_blank\" target="\"_blank\"" moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:sebastian.gatzka@stud.tu-darmstadt.de">sebastian.gatzka@stud.tu-darmstadt.de</a>
><br>
Date: 22 Feb 10 19:37:52<br>
Subject: [vtkusers] Glyph coloring by vector magnitud<br>
To: <a target=\"_blank\" target="\"_blank\"" moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
<br>
<font size="-1"><font face="Helvetica, Arial, sans-serif">Hello
World.<br>
<br>
Meanwhile I made some nice glyphs, but am stuck with the coloring.<br>
I switched on SetColorModeToColorByVector() which may be the coloring
by vector magnitude?<br>
<br>
<font face="Courier New, Courier, monospace">vtkGlyph3D *glyph
vtkGlyph3D::New();<br>
glyph->SetInput(gridCellCenters->GetOutput()); <br>
glyph->SetSourceConnection(arrow->GetOutputPort());<br>
glyph->SetScaleModeToDataScalingOff();<br>
glyph->SetColorModeToColorByScale();<br>
glyph->SetScaleFactor(0.3);</font><br>
<br>
Unfortunately all glyphs are colored the same (blue).<br>
Do I have to do anything further to get propper coloring? Maybe with
the mapper?<br>
<br>
See you. Sebastian<br>
</font></font> </font></font></blockquote>
<font color="#000000"></font></blockquote>
</blockquote>