[vtkusers] vtkGlyph - how to apply color

Barbara Okupna barbaraokupna at yahoo.com
Sat Nov 4 20:50:37 EST 2006


  I create a sphere, and then pass the sphere to the glyph object as a source, 
  the Input of the Glyph is array of x,y, z coordinates for the sphere. 
   
  How would I apply color to the sphere. 
  Sphere at each location (x,y,z) has different color.  
   
  points = vtkPoints::New();
  for(int i=0;i<1097;i++)
  {
  double x1 = map[i].x;
  double y1 = map[i].y;
  points->InsertPoint(i,x1,y1,0);
   
  double color = map[i].col;   -   How would I specify the color of sphere at x,y,z point
   
  }
  data = vtkPolyData::New();
  data->SetPoints(points);
   
  sphere = vtkSphereSource::New();
  
   
  
  sphereGlyph = vtkGlyph3D::New();
  sphereGlyph->SetInput(data);
  sphereGlyph->SetSource(sphere->GetOutput());
   
  Thank you,

 
---------------------------------
 Check out the New Yahoo! Mail - Fire up a more powerful email and get things done faster. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061104/bf9c8def/attachment.htm>


More information about the vtkusers mailing list