[vtkusers] Moving Actor2d

Beau Sapach beau.sapach at ualberta.ca
Wed Oct 27 16:42:35 EDT 2004


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




More information about the vtkusers mailing list