[vtkusers] Moving Actor2d

Emiliano Beronich emiliano at veccsa.com
Wed Oct 27 17:42:38 EDT 2004


Hi Beau,

Sometime ago I worked with moving Actor2D, but now I don't remember 
every detail. I have sent a previous message on this issue. Maybe this 
could be of help. In this message, there is a class with some working 
code for moving actor2d.

http://public.kitware.com/pipermail/vtkusers/2004-September/076278.html

Try to set the actor2d's position with
Actor2D->SetPosition() instead of Actor2D->GetPositionCoordinate()...

Maybe this could produces better results.

Regards,
Emiliano



Beau Sapach wrote:

> Hello everyone,
> 
> I'm trying to "pick" an actor2d like this:
> 
> vtkRenderWindowInteractor * iact = vtkRenderWindowInteractor::New();
> int x = iact->GetEventPosition()[0];
> int y = iact->GetEventPosition()[1];
> 
> vtkPropPicker * picker = vtkPropPicker::New();
> picker->PickProp(x,y,0,renderer);
> 
> Is this the right way to do it?  If my actor2D is an image that's 10x10 my
> xy coordinates passed to pickprop must be within that square, but starting
> at the lower left corner of the renderwindow.  If I explicitly set the
> position of the actor like this:
> 
> actor->GetPositionCoordinate()->SetValue(100,100);
> 
> then pass 101,101 to PickProp() the pick fails.... what's wrong here?
> 
> I am setting the actor's coordinate system:
> 
> actor->GetPositionCoordinate()->SetCoordinateSystemToDisplay();
> 
> I suspect it's a coordinate system problem, but I can't seem to figure it
> out..... Anyone out there have any ideas?
> 
> Beau
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 
> 



More information about the vtkusers mailing list