[vtkusers] vtkPolyData

michał strzelecki nexgen at poczta.onet.pl
Wed Jul 30 18:14:44 EDT 2003


>Hi all

>I am trying to manipulate a 3D object that has been created by reading
>multiple 2D slices.

>The object can be retrieved as a vtkPolyData object. Can someone explain
>to me how this object can be manipulated? Is there anyway to retrieve
>the 3-dimensional matrix with the points of the object and their values?

>i would be greatful for any help
>thanks
>christos

To manipulate vtkPolyData, I mean (rotate, translate, scale) you shoud use
vtkTransform and vtkTransformPolyDataFilter
if you want to do this without rendering (i mean showing in renderwindow);
If  you want manipulate object on visible scene you should use method of
vtkActor, because it works faster,
the whole work in this case is done by a graphic card.

example 1:

vtkPolyData *p = vtkPolyData::New()

vtkTransform *t = vtkTransform::New();
t->PostMultiply();
t->RotateX(90);
t->Translate(1,100,-50);

vtkTransformPolyDataFilter *tf = vtkTransformPolyDataFilter::New();
tf->SetTransform(t);
tf->SetInput(p);

output vtkPolyData is: tf->GetOutput();

example 2:

vtkActor *a = vtkActor::New();
a->RotateX(90);
a>Translate(1,100,-50);


michal




More information about the vtkusers mailing list