[vtkusers] Re: Picking points from multiple surfaces.

安 继业 an_jiye at hotmail.com
Tue Feb 17 08:19:55 EST 2004


Hi, Bruce,

Thanks for your kindly help.

Recently I have met another question related to picking. Say there is an 
cuboid in the rendering window. When I use vtkPointPicker to pick points, 
it seems I can get one point at a time. But the point may come from either 
of the two parallel surfaces, not necessarily the front one.

Do you know why this happen?

Best Regards,
Jiye An


>From: Bruce Lamond <Bruce.Lamond at ed.ac.uk>
>To: an_jiye at hotmail.com
>CC: vtkusers at vtk.org
>Subject: Re: Picking points from multiple surfaces.
>Date: Tue, 17 Feb 2004 12:55:26 +0000
>
>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               #
>              ################################################

_________________________________________________________________
免费下载 MSN Explorer:   http://explorer.msn.com/lccn/  




More information about the vtkusers mailing list