[vtkusers] vtkTransformFilter

Giancarlo Amati ilferraresebono at hotmail.it
Tue Mar 31 07:53:53 EDT 2009


Hi, thanks for the reply.
Actually the setUsermatrix is what I have done...but still no results in my screen. This is my code:

    vtkActor *tmpAct; 
        
        _pickedActors = _picker->GetActors();
        _pickedActors->InitTraversal();
        tmpAct = _pickedActors->GetNextItem();

while (tmpAct != 0){

            tmpAct->SetUserMatrix(m);
            tmpAct = _pickedActors->GetNextItem();    
        }

where _pickedActors is a vtkActorCollections and _picker is a vtkPicker. m is a vtkMatrix4x4 that I initialised as
1 0 0 0
0 1 0 0 
0 0 1 55
0 0 0 1

so I would see a translation of 55 in the Z.

GC.

Date: Tue, 31 Mar 2009 12:30:14 +0200
From: J.S.Wijnhout at lumc.nl
To: vtkusers at vtk.org
Subject: Re: [vtkusers] vtkTransformFilter





Hi,



You solution doesn't work because do you not connect the output of trF to the mapper of the actor.
Btw, if you want to apply a user defined transformation matrix to your actor, simply use:
vtkActor::SetUserMatrix.



best,

Jeroen

 
   From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On Behalf Of  Giancarlo Amati
 Sent: Monday, March 30, 2009 7:03 PM
 To: vtkusers at vtk.org
  Subject: [vtkusers] vtkTransformFilter
   

Hi everybody,

I
have an object picked usint VTkpicker....and I can recover its actor. now, I also define a
vtkMatrix4x4 which is a rigid transformation matrix.
I want to apply that transformation to the object and I wrote this:

vtkTransform *tr = vtkTransform::New();
        tr->SetMatrix(m);
        tr->Update();

        vtkTransformFilter *trF = vtkTransformFilter::New();
        trF->SetInput(tmpAct->GetMapper()->GetInput());
        trF->SetTransform(tr);
        trF->Update();

where tmpAct is the actor picked by the picker.
So I thought that after refreshing the visualization I should see the object modified, but it doesn't....so where's the trick?

Kind Regards.
Giancarlo

La tua immagine personale dinamica per Messenger? Creala gratis con Avatar Studio!
_________________________________________________________________
Portati avanti: scarica Messenger 2009!
http://clk.atdmt.com/GBL/go/136430507/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090331/8c8eb55d/attachment.htm>


More information about the vtkusers mailing list