[vtkusers] Scalar color / LookupTable / Interpolation problem...

de Boer Ingo I.deBoer at polytec.de
Thu Apr 29 12:27:26 EDT 2004


Hi all,

I have a problem regarding of the interpolation
of the elements and lookup tables...

I have a lookup table from -10 to 10
whereas -10 is red and 10 is green, 0 is black

Now I have a triangle like this:

red                              green
  x (-10)   ----------------      x (10)

           \                /
            \              /
                  x (0)
                  black

>From red to black it is okay. From black
to green it is also okay.
Now, the interpolation from the red edge
to the green egde does not include any 
black...It seems that VTK does some RGB 
interpolation instead of using my lookup
table...

What do I do wrong ?
I set my scalar value -10,10,0 to each point, than

// create color lookup table
m_pvtkLookupTable->SetNumberOfColors(m_lPaletteEntries);

// build palette
m_pvtkLookupTable->Build();
long lCounter = 0;
for (int i = 0; i < m_lPaletteEntries; i++)
{
  float fRed   = (float) r[lCounter] / 255.0f;
  float fGreen = (float) g[lCounter] / 255.0f;
  float fBlue  = (float) g[lCounter] / 255.0f;
  m_pvtkLookupTable->SetTableValue(i, fRed, fGreen, fBlue, 1.0);
}

// set to mapper
pvtkPolyDataMapper->SetLookupTable(pvtkLookupTable);
pvtkPolyDataMapper->SetScalarRange(0, lPaletteEntries-1);

The color of each edge point is correct...

Do I need more ?
Do I need a special interpolation method ?

greets
  Ingo

---
Dr.-Ing. Ingo H. de Boer

Polytec GmbH
Polytec-Platz 1-7, 76337 Waldbronn, Germany
phone: ++49 7243 604 106
fax  : ++49 7243 604 255
 



More information about the vtkusers mailing list