[vtkusers] vtkSplineFilter??

Beau Sapach beau.sapach at ualberta.ca
Sat Feb 19 02:59:06 EST 2005


Hello everyone,

I'm trying to draw a curved line in 2D using the vtkSplineFilter, but it 
doesn't seem to be working, the output line is always straight.  Here is my 
code can anyone point out what I'm doing wrong? --Beau

vtkRenderer * renderer = vtkRenderer::New();
vtkRenderWindow * renwin = vtkRenderWindow::New();
vtkPolyDataMapper * mapper = vtkPolyDataMapper::New();
vtkLineSource * Line = vtkLineSource::New();
vtkSplineFilter * Spline = vtkSplineFilter::New();
vtkActor * LineActor = vtkActor::New();

Spline->SetSubdivideToSpecified();
Spline->SetNumberOfSubdivisions(10);

Line->SetPoint1(10,10,0);
Line->SetPoint2(200,200,0);

Spline->SetInput(Line->GetOutput());

mapper->SetInput(Spline->GetOutput());
renwin->AddRenderer(renderer);
LineActor->SetMapper(mapper);
renderer->AddActor(LineActor);
renwin->Render();



More information about the vtkusers mailing list