[vtkusers] Polygon colouring

David Gobbi david.gobbi at gmail.com
Sat Oct 18 22:27:29 EDT 2014


polyData->GetCellData()->SetScalars(array);

On Sat, Oct 18, 2014 at 8:18 PM, Gib Bogle <g.bogle at auckland.ac.nz> wrote:

>  I'm rendering a shape using vtkPolyData, i.e. as a collection of
> polygons.  Is there a way to colour each polygon separately?
>
> polygonPolyData = vtkSmartPointer<vtkPolyData>::New();
> polygonPolyData->SetPoints(points);
> polygonPolyData->SetPolys(polygons);
> hexmapper = vtkSmartPointer<vtkPolyDataMapper>::New();
> hexmapper->SetInput(polygonPolyData);
> hexactor = vtkSmartPointer<vtkActor>::New();
> hexactor->SetMapper(hexmapper);
>
> ren->AddActor(hexactor);
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20141018/fb173acb/attachment.html>


More information about the vtkusers mailing list