[vtkusers] lookupTable

Stefan Ulbrich stevie157 at gmx.net
Sun Oct 27 18:39:59 EST 2002


hello,

i want to create a polydata object with several different colors. i've 
associated a vtkUnsignedCharArray (i also tried float and int) with it 
using

scalar-->InsertNextValue(0);
scalar-->InsertNextValue(1);
scalar ->InsertNextValue(4);
pd->GetPointData()->SetScalars(scalar);

i created a lookuptable

lup->->SetNumberOfTableValues  (n);

        lut->SetTableValue(0,1,1,1,1);
        lut->SetTableValue(1,1,1,1,.5);
        lut->SetTableValue(2,1,0,0,.75);
        lut->SetTableValue(3,0,0,1,.25);
        .....

 scalars->SetLookupTable (lut);

but only the points with the scalar value 0 get the right color. the 
others get the color defined in the last entry of the lookuptable.
i wrote the object to disk and the values became between 0 and 1.

what do i have to do, to connect a point to a specific color??

thank you very much

stefan




More information about the vtkusers mailing list