[vtkusers] Visualizing multiple isosurfaces using vtkContourFilter

JeffreyRForsyth jeffrey.forsyth10 at gmail.com
Sun Feb 27 22:47:11 EST 2011


Each component is drawn in the same color. How can I now set each component
to a different/random color?

Now you probably have to go with the more complex method suggested earlier:


  mapper1->SetInput(cf1->GetOutput()); 
  mapper1->ScalarVisibilityOff(); 
  actor1->SetMapper(mapper1); 
  actor1->GetProperty()->SetDiffuseColor(r,g,b); 

  mapper2->SetInput(cf2->GetOutput()); 
  mapper2->ScalarVisibilityOff(); 
  actor2->SetMapper(mapper2); 
  actor2->GetProperty()->SetDiffuseColor(r,g,b); 

//You can also set the color with 
  actor2->GetProperty()->SetColor(r,g,b);
//and set the opacity with 
  actor2->GetProperty()->SetOpacity(op);  // 0 < op < 1
// so that the outer contours are transparent 
// another option is to intersect your polygon set so that you see a
crossection of all contours
// for this check out vtkClipPolyData


-----
- Jeff

My Open Source C++ Toolbox for VTK meshing:
http://engineering.dartmouth.edu/~jeffrey_r_forsyth/VTK_functions.html
-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Visualizing-multiple-isosurfaces-using-vtkContourFilter-tp3396620p3402758.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list