[vtkusers] Polygon colouring

Bill Lorensen bill.lorensen at gmail.com
Sun Oct 19 07:39:25 EDT 2014


Gib,

Here are a couple of examples:
http://vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColorCellsWithRGB
http://vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ColorCells

Bill

On Sat, Oct 18, 2014 at 10: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);
>
>
> Thanks
> Gib
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



-- 
Unpaid intern in BillsBasement at noware dot com


More information about the vtkusers mailing list