[vtkusers] Picker

seaer wuweitianye at yahoo.com.cn
Sat Aug 20 09:34:47 EDT 2011


Hello everyone
       I am trying to do the following things.  when I click the Interactor
Window,  I need get  (x,y,z) of a vertex  which is closet  cliked-place in a
cell which has lots of vertexs. so I used  vtkCellPicker to pick the cell
,how can i do next step? 

     int *Pos = this->GetInteractor()->GetEventPosition();
     vtkRenderer *ren = iren->FindPokedRenderer(Pos[0],Pos[1]);

     vtkCellPicker *picker =
vtkCellPicker::SafeDownCast((iren->GetPicker()));
     picker->SetTolerance(0.0001);
     picker->Pick(Pos[0],Pos[1],0.0,ren);

     double *worldPostion = picker->GetPickPosition();
     int cellId = picker->GetCellId();
    
thanks a lot !!!!

--
View this message in context: http://vtk.1045678.n5.nabble.com/Picker-tp4718448p4718448.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list