[vtkusers] rendering colored polydata

David Doria daviddoria+vtk at gmail.com
Wed Apr 28 16:42:45 EDT 2010


On Wed, Apr 28, 2010 at 4:34 PM, Anders Wallin
<anders.e.e.wallin at gmail.com> wrote:
> Hi group,
> I am trying to render colored polydata following the example here:
> http://www.vtk.org/Wiki/VTK/Examples/Python/ColoredTriangle
>
> my code looks like this:
> http://pastebin.com/8VP8ta2u
>
> all I get is a white triangle. I think there are some settings in the
> mapper I need to change so it uses the "Colors" array, but I can't
> figure out how to do that. Help!
>
> thanks,
> AW


You need to replace

polydata.GetPointData().SetVectors(Colors)

with

polydata.GetPointData().SetScalars(Colors)

Thanks,

David



More information about the vtkusers mailing list