I&#39;d like to render a point cloud with points individually colored, so I combined the example <a href="http://www.vtk.org/Wiki/VTK/Examples/Python/TriangleColoredPoints">http://www.vtk.org/Wiki/VTK/Examples/Python/TriangleColoredPoints</a> with others that sets up the interactive render window.  But the points are all white, unless I call SetColor which gives them all the same color.  What am I missing?<br>
<br><span style="font-family: courier new,monospace;">import vtk</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"># create a rendering window and renderer</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">ren = vtk.vtkRenderer()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">renWin = vtk.vtkRenderWindow()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">renWin.AddRenderer(ren)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">renWin.SetSize(400,400)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"># create a renderwindowinteractor</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">iren = vtk.vtkRenderWindowInteractor()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">iren.SetRenderWindow(renWin)</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">#setup points and vertices</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Points = vtk.vtkPoints()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Vertices = vtk.vtkCellArray()</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">for i in range(255):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  for j in range(255):</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    id = Points.InsertNextPoint(i, j, 1)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    Vertices.InsertNextCell(1)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    Vertices.InsertCellPoint(id)</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    #setup colors</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    Colors = vtk.vtkUnsignedCharArray()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    Colors.SetNumberOfComponents(3)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    Colors.SetName(&quot;Colors&quot;)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    Colors.InsertNextTuple3(255,i,j)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">polydata = vtk.vtkPolyData()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">polydata.SetPoints(Points)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">polydata.SetVerts(Vertices)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">polydata.GetPointData().SetVectors(Colors)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">polydata.Modified()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">polydata.Update()</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">######</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">mapper = vtk.vtkPolyDataMapper()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">mapper.SetInput(polydata)</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">actor = vtk.vtkActor()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">actor.SetMapper(mapper)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">ren.AddActor(actor)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"># enable user interface interactor</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">renWin.Render()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">iren.Initialize()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">iren.Start()</span><br>               <br><br>Replacing SetVectors() with SetScalars produces some point coloring, but the colors seem random.<br>
<br>I&#39;m using vtk 5.4.2 and Python 2.6.6 on Ubuntu.<br><br>Thanks,<br><br>Lucas<br>