[vtkusers] Re: Picking points from multiple surfaces.

Bruce Lamond Bruce.Lamond at ed.ac.uk
Tue Feb 17 07:55:26 EST 2004


Hi Jiye,
i don't think there's an easy way to do this in a scripting language, but if you
know c++...
Picking points from surfaces under other surfaces is difficult. First you need
to create your own subclass of vtkInteractorStyle so you can define your own
keyboard inputs (apply the interactor style to the render window interactor).
vtkPointPicker returns the list of all actors under the mouse pointer. Create a
storage variable to hold the first object in the list and highlight the actor in
some way (render in wireframe for example). Define a particular keypress to
select the next actor in the list until the correct one is highlighted. Next you
can select the point in the current highlighted surface that is nearest to the
mouse pointer with vtkPointPicker::GetPickPosition(). Selecting points in
between the actual surface mesh is even more difficult (!) because the surface
is not usually an implicit surface (like a cone or a cube or something). 
Hope this helps
Bruce

-- 

             ################################################
             # Bruce Lamond                                 #
             # Edinburgh Virtual Environment Centre (EdVEC) #
             # University of Edinburgh                      #
             # JCMB room 2403                               #
             # The Kings Buildings                          #
             # West Mains Road                              #
             # Edinburgh EH9 3JZ                            # 
             # UK                                           #
             # www.edvec.ed.ac.uk                           #
             # Tel. (00 44 )/(0) 131 650 4981               #
             ################################################



More information about the vtkusers mailing list