[vtkusers] Graph vertex coloring not working

David Doria daviddoria+vtk at gmail.com
Tue Mar 30 10:30:31 EDT 2010


>> I did what you said (using a vtkViewTheme) and it still seems to have
>> the problem of 2 vertices get colored one color (red) and two another
>> (green).
>
> You are close. You only set 2 table values, so all scalars will be
> mapped to one or the other. If you add intermediate table values you
> would be ok.
>
> Jeff
>

I tried using a vtkLookupTable instead:
http://www.vtk.org/Wiki/VTK/Examples/Graphs/ColorVertices

Both of these:
http://www.vtk.org/Wiki/VTK/Examples/ColorTransferFunction
http://www.vtk.org/Wiki/VTK/Examples/ColorLookupTable

can definitely interpolate colors - why would it not work for vertex coloring?

Also, I tried setting 3 low values and 1 high value:
  vertexColors->InsertNextValue(1);
  vertexColors->InsertNextValue(3);
  vertexColors->InsertNextValue(2);
  vertexColors->InsertNextValue(10);

expecting to see 3 of one color and 1 of the other (if they are
clamping like you said), but I still see 2 blue and 2 red.

Thanks,

David



More information about the vtkusers mailing list