<div dir="ltr"><div>polyData->GetCellData()->SetScalars(array);</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 18, 2014 at 8:18 PM, Gib Bogle <span dir="ltr"><<a href="mailto:g.bogle@auckland.ac.nz" target="_blank">g.bogle@auckland.ac.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><font color="000000">I'm rendering a shape using
</font><span style="color:#800080"><font color="000000">vtkPolyData, i.e. as a collection of polygons. Is there a way to colour each polygon separately?</font><br>
</span><span style="color:#c0c0c0"></span><br>
<font color="000000">polygonPolyData = vtkSmartPointer<vtkPolyData>::New();<br>
polygonPolyData-><span style="font-style:italic">SetPoints</span>(points);<br>
polygonPolyData->SetPolys(polygons);<br>
<font>hexmapper = vtkSmartPointer<vtkPolyDataMapper>::New();<br>
hexmapper->SetInput(polygonPolyData);<br>
hexactor = vtkSmartPointer<vtkActor>::New(); <br>
hexactor-><span style="font-style:italic">SetMapper</span>(hexmapper); </font></font>
<pre style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><font color="000000" face="Tahoma">ren->AddActor(hexactor);</font></pre>
<font color="000000"></font></div></div></blockquote></div><br></div></div>