[vtkusers] pointpicker

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Fri May 24 08:09:14 EDT 2002


>>>>> "GG" == Gowri Gopalakrishnan <Gopalakrishnan> writes:

    GG> Hi I use the following code to set the pipe line

    GG> 	vtkPoints *points = vtkPoints::New(VTK_DOUBLE);
    GG> vtkCellArray *lines = vtkCellArray::New();

    GG> 	vtkpolydata takes the above two as the input.  I do
    GG> the plot with 42 points and it is alright.  But when I use
    GG> point picker no matter where I pick on the screen the point
    GG> picker always returns 239306080.  Do I have to set the point
    GG> Id somewhere. The result is the same if I use cellpicker
    GG> instead of point picker.

That sounds very wierd.  Using the pickers is pretty easy.  You simply
need to call picker.Pick(x, y, 0, renderer) where x and y are
co-ordinates on the screen that you determine from your GUI.  Then you
say picker.GetPointId() etc.  If no point was picked you should get an
id of -1.  Look at the value of picker.GetPickPosition().  It might
help you debug whats happening.

prabhu




More information about the vtkusers mailing list