[vtkusers] How to draw contourlines on a Cone?

beth at portugalmail.pt beth at portugalmail.pt
Mon Nov 27 07:21:11 EST 2006


Hi,

I would like to draw a cone, and according Y coordinate values, paint it 
differently. On other words, I want to create contour lines/surfaces on the 
cone. My idea is to use a cone to map distribution values of my data (lower to 
higher values, accumulative distribution). So it should be made of several 
slices with different colors and thickness.

My piece of code that is not working:

 vtkConeSource *cone = vtkConeSource::New();
  cone->SetHeight( 3.0 ); // I suppose it y value goes from 0 to 3.0...
  cone->SetRadius( 1.0 );
  cone->SetResolution( 10 );
  
  vtkContourFilter* contour = vtkContourFilter::New();
  contour->SetInputConnection(cone->GetOutputPort());
  contour->SetValue  ( 1, 0.1); // try to create 2 contours, on position y=0.1 
and 0.2
  contour->SetValue  ( 2, 0.2);

  vtkPolyDataMapper *contourMapper = vtkPolyDataMapper::New();
  contourMapper->SetInputConnection( contour->GetOutputPort() );

  vtkActor *contourActor = vtkActor::New();
  contourActor->SetMapper( contourMapper );

// usual rendering stuff...

My goal is to control the contour generation according to y coordinate value 
on the cone, but it's not working at all!

Thanks for any help/tip!

Best regards,

Elizabeth



__________________________________________________________
Continua a preferir gastar mais?
Compare o preço da sua ligação à Internet
http://acesso.portugalmail.pt/compare



More information about the vtkusers mailing list