[vtkusers] rendering colored polydata

David Doria daviddoria+vtk at gmail.com
Thu Apr 29 08:45:18 EDT 2010


> that's confusing. why are these examples using SetVectors() ?
> http://www.vtk.org/Wiki/VTK/Examples/Python/ColoredTriangle
> http://www.vtk.org/Wiki/VTK/Examples/ColoredPoints
>
> do they work with some non-default renderer settings?
>
> another thing: when setting the color of an actor like so:
> GetProperty().SetColor(color)
> the color RGB values seem to be normalized to 1, i.e. red=(1,0,0)
>
> but with polydata it appears red=(255,0,0) ?
>
> AW
>

Ok, I see what happened. You should always make colors 255, and you
should use SetScalars. The problem was that the example was not
displaying anything, it was simply writing it to a file to view with
Paraview for testing. Paraview "fixed" all of my mistakes by allowing
me to select "color by Colors" and scaling the colors.

The c++ example has been fixed to actually display the points on the
screen, and the python example has been changed from SetVectors to
SetScalars. (SetVectors just made all of the points black for me).

Thanks for pointing this out!

Thanks,

David



More information about the vtkusers mailing list