[vtkusers] RE : Newbie question: unstructuredGrid with voxels of different colours

Mark Jefferson mark.jefferson at qq.com
Tue Jul 8 21:33:10 EDT 2008


Hi, Teresa,
   you can try class vtkColorTransferFunction. for example:
 // Create a transfer function mapping scalar value to color (color)
  vtkColorTransferFunction *cTFun = vtkColorTransferFunction::New();
  cTFun->AddRGBPoint(   0, 1.0, 0.0, 0.0 );
  cTFun->AddRGBPoint(  64, 1.0, 1.0, 0.0 );
  cTFun->AddRGBPoint( 128, 0.0, 1.0, 0.0 );
  cTFun->AddRGBPoint( 192, 0.0, 1.0, 1.0 );
  cTFun->AddRGBPoint( 255, 0.0, 0.0, 1.0 );
  hope this could help you.
   M. J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080709/d56defc7/attachment.htm>


More information about the vtkusers mailing list