[vtkusers] How to display colors?

Sean McInerney seanm at nmr.mgh.harvard.edu
Wed Aug 18 06:51:30 EDT 2004


Hi Bernhard,

   To be used as RGB colors by a Mapper, they'll have to be stored as 
unsigned chars (as in a vtkUnsignedCharArray). Next, on the Mapper, call 
ScalarVisibilityOn() and SetColorModeToDefault(). These colors can be 
associated with the PolyData as either PointData or CellData. PointData 
is the default, so you will have to call SetScalarModeToUseCellData() 
otherwise.

   That said, vtkLookupTable is a much more efficient way of coloring 
your PolyData with scalars being used to determine point or cell coloring.

-Sean

Bernhard Mayrhofer wrote:
> Hello,
> I have a 3 dim. polydata. I´m using 3 dim. vectors to store RGB color information in a polydata object. I have done this, because Ii did not know an other way and it is easy to acces them. But I don´t know how to visualize the color. That is my problem now. Is there a way to display the color or is there an other way to store the color to display the color?
> 
> 
> Thanks
> Bernhard
> 




More information about the vtkusers mailing list