[vtkusers] Using ContourFilter, see nothing

Hackbard_C Hackbard_C at gmx.de
Fri Jun 26 06:37:29 EDT 2009



Hackbard_C wrote:
> 
> Now i want to create a 3D-hull that visualize the path of my moving
> ellipse (with linear interpolation). Every point which was inside my
> ellipse at any time (and only these points) should be inside the hull.
> So from EllipseT will be a kind of tube to EllipseTPlusOne, from
> EllipseTPlusOne to EllipseTPlusTwo and so on... Unfortunalety I have no
> idea how to realize this.
> Is it possible to draw all ellipses and use some ContourFilter or
> something else?
> 


I tried to use ContourFilter (for testing only with spheres)...

vtkRenderer *ren1 = vtkRenderer::New();
vtkRenderWindow *renWin = vtkRenderWindow::New();
renWin->AddRenderer(ren1);

vtkSphereSource *sphere1 = vtkSphereSource::New();
sphere1->SetCenter(5.0,0.0,0.0);
vtkSphereSource *sphere2 = vtkSphereSource::New();
sphere2->SetCenter(5.8,0.0,0.0);

vtkAppendPolyData* append = vtkAppendPolyData::New();
append->AddInput(sphere1->GetOutput());
append->AddInput(sphere2->GetOutput());

vtkContourFilter *contour = vtkContourFilter::New();
contour->SetInput(append->GetOutput());
contour->GenerateValues(100,0.0,10.0);

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

vtkActor *act = vtkActor::New(); 
act->SetMapper(pDataMapper); 
act->GetProperty()->SetColor(1.0,0.0,0.0);

ren1->AddActor(act);
renWin->Render();

vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
iren->SetRenderWindow(renWin);
iren->Initialize();
iren->Start();


...but I see.... nothing :( What is wrong with my code? Where is my mistake?

Regards,
  Kim

-- 
View this message in context: http://www.nabble.com/Creating-3D-Hull-of-moving-Ellipse-tp24183623p24218117.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list