[vtkusers] vtkGlyph2D range question

Charles Boivin Charles.Boivin at rwdiwest.com
Fri Sep 3 13:19:10 EDT 2004


Hello everyone, yet another question from me... 

This one seems like it should not be too hard, but for some reason, so
far, it has eluded me. 

I have a vtkGlyph2D that I am using to display velocity vectors (using
a vtkGlyphSource2D class). It displays (and scales) them fine, except
for the color map. I am having trouble getting the range of values for
the magnitude of the vectors.

I have the following code..:

	pGlyph->SetVectorModeToUseVector();
	pGlyph->SetScaleModeToScaleByVector();
	pGlyph->SetColorModeToColorByVector();

So I would expect the vectors to be colored according to their
magnitude. They are, in a way, but the lookup does not get the full
range of values. For example, I know for a fact that magnitudes will
vary from 0.0 to about 3.8 in the example I am looking at. However, I
always get a range of [0..1] from GetRange() :

	pGlyph->Update();
	pGlyph->GetRange(dGlyphRange);

And the way that the velocity vectors are colored reflects just that. I
can access the ranges for scalars (and individual components of the
velocity vectors) just fine, but can't get the range for the magnitude
of the vectors. Am I wrong in assuming that VTK should compute this for
me? Or is this a case where I need to go through my data and compute
that myself?

Thank you in advance for your answers, I appreciate all the help. Will
try to help whenever I can, but still a relative newbie to VTK.

Charles



More information about the vtkusers mailing list