[vtkusers] Re: vtkusers digest, Vol 1 #1338 - 4 msgs

Phil Cook p.cook at cs.ucl.ac.uk
Mon Oct 14 12:54:24 EDT 2002


> Message: 3
> From: "Berenschot, G." <G.Berenschot at student.tue.nl>
> To: "'vtkusers at public.kitware.com'" <vtkusers at public.kitware.com>
> Date: Mon, 14 Oct 2002 15:14:44 +0200
> Subject: [vtkusers] color vtkTensorGlyph
> 
> Dear vtkUsers,
> 
> I have a problem with coloring vtkTensorGlyphs. The glyphs are created
> correctly, but the color of the glyps is always red. I create a structured
> point dataset with as attributes tensors and scalars(color). The attribute
> scalar data is an vtkUnsignedChar array which is the color that I want to
> give the glyphs. 
> 
> tensorPlane->GetPointData()->SetTensors(tensors);
> tensorPlane->GetPointData()->SetScalars(scalars);
> 
> With this dataset I create the tensorglyphs. 
> 
> tensorGlyph->ColorGlyphsOn();
> tensorGlyph->SetInput(tensorPlane);
> tensorGlyph->SetSource(cube->GetOutput());
> tensorGlyph->SetScaleFactor(0.0015);

Did you tell the mapper the scalar range?

vtkPolyDataMapper mapper = vtkPolyDataMapper::New();
mapper->SetInput(tensorGlyph->GetOutput());
mapper->SetScalarRange(minScalar, maxScalar);



Phil




More information about the vtkusers mailing list