[vtkusers] Lookup table

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Sat Mar 30 07:12:02 EST 2002


>>>>> "NK" == Nikita Kojekine <AKA Kitya Karlson <karlson at stu.mech.titech.ac.jp>> writes:

    NK> So i wish to map white for 0 scalar value, red - for 1, green
    NK> - for 2 and blue - for 3. But when I load this file to
    NK> vtkPolyDataMapper I actully see that 0 is mapped to white, but
    NK> all above it 1,2,3 are mapped to blue.  That means that
    NK> vtkPolyDataMapper is not getting correct ScalarRange.  if I
    NK> set it manualy like this:
    m_ModelMapper-> SetScalarRange(0.,3.);
    NK> it works and uses all my colors, but how can I set it using

That is the correct way to do it.  The mapper has to know what range
of data it is mapping.  You should really find the scalar range of
your data and set the scalar range via that.  Something like so:

 m_ModelMapper->SetScalarRange(DataReader->GetOutput()->GetCellData()->GetScalars()->GetRange())

prabhu




More information about the vtkusers mailing list