david.gobbi at gmail.com
Sat Aug 20 09:50:01 EDT 2011
What version of VTK are you using? In VTK 5.6, you can do this:
vtkIdType pointId = picker->GetPointId();
The returned pointId will be in the cell returned by GetCellId().
On Sat, Aug 20, 2011 at 7:34 AM, seaer <wuweitianye at yahoo.com.cn> wrote:
> 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,Pos);
> vtkCellPicker *picker =
> double *worldPostion = picker->GetPickPosition();
> int cellId = picker->GetCellId();
> thanks a lot !!!!
More information about the vtkusers