[vtkusers] Unable to use vtk's glphy filter properly (Please help)
Raashid Baig
raashid.b at rediffmail.com
Wed Feb 27 07:05:59 EST 2008
I have a vtk_XML Unstructured file, with 6 scalars and 1 Vector value
associated with each node point.
After reading the file, I create glyphs as follows :
double range[2];
vtkXMLUnstructuredGridReader *data_reader = vtkXMLUnstructuredGridReader::New();
data_reader->SetFileName("fire_ug.vtu");
data_reader->Update();
data_reader->GetOutput()->GetScalarRange(range);
vtkArrowSource *arrow = vtkArrowSource::New();
vtkGlyph3D *glyph = vtkGlyph3D::New();
glyph->SetInputConnection(data_reader->GetOutputPort());
glyph->SetSource(arrow->GetOutput());
glyph->SetVectorModeToUseVector();
glyph->SetScaleModeToScaleByVector();
glyph->SetColorModeToColorByScalar();
glyph->SetScaleFactor(0.1);
vtkPolyDataMapper *spikeMapper = vtkPolyDataMapper::New();
spikeMapper->SetInput(glyph->GetOutput());
spikeMapper->SetScalarRange(range);
...............
The Usual pipeline.
I observer that the glpyhs are colored according to the first scalar
associated with the points. Also the range is determined for the
first scalar value associated with the points.
How can I select a particular scalar value for coloring the data or
to obtain it's range ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080227/d0b97a8e/attachment.htm>
More information about the vtkusers
mailing list