[vtkusers] Polygon colouring
david.thompson at kitware.com
Sun Oct 19 20:40:39 EDT 2014
VTK's mappers treat unsigned char scalars as a special case because long ago colors had to be sent to the rendering API as 3-tuples of red, green, and blue unsigned char values. The VTK mappers are hardwired to deal with this case.
On Oct 19, 2014, at 20:27, Gib Bogle <g.bogle at auckland.ac.nz> wrote:
> Thanks Bill. Following David Gobbi's suggestion, I got something working in a similar way to the ColorCellsWithRGB example. But I can't say I fully understand it. Specifically, I don't see why this statement
> or in my code
> sets the colours. How is it that the vtkUnsignedCharArray is interpreted as providing colours?
> From: Bill Lorensen [bill.lorensen at gmail.com]
> Sent: Monday, 20 October 2014 12:39 a.m.
> To: Gib Bogle
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] Polygon colouring
> Here are a couple of examples:
> 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();
>> hexmapper = vtkSmartPointer<vtkPolyDataMapper>::New();
>> hexactor = vtkSmartPointer<vtkActor>::New();
>> Powered by www.kitware.com
>> Visit other Kitware open-source projects at
>> Please keep messages on-topic and check the VTK FAQ at:
>> Follow this link to subscribe/unsubscribe:
> Unpaid intern in BillsBasement at noware dot com
> 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:
More information about the vtkusers