[vtkusers] vtk Coloring

Kevin Wright krw at viz-solutions.com
Mon Apr 29 18:02:53 EDT 2002


>I created an iso-surface, and I was trying to color that iso-surface, but I
>can't change the default color. I tried to set the actor's color, as well as
>changing the light's color, nothing changed. The code used is attached
>below. I keep getting BLUE color, no matter what I do.

By default, VTK colors objects by their scalar values.  If you want to set 
the color by hand, you have to call ScalarVisibilityOff in the 
mapper.  This will tell it to ignore the scalar values for the object, and 
draw the color you've specified in the actor.

In C++, the line:

mapper->ScalarVisibilityOff()

Any time after you create the mapper should do it.

Kevin.





More information about the vtkusers mailing list