[vtkusers] vtkPicker..
Jeff Lee
jeff at cdnorthamerica.com
Sun May 13 14:05:12 EDT 2001
K.R.,
I have had success sublcassing vtkActor, letting it hold user data, and attaching a
pickMethod to the actor. In the pickMethod, you can do pretty much anything you want.
Alternatively you could write your own interactor that knows how to deal with the subclassed
vtkActor when picked. I use both approaches. On the picker side of things, if you look up
the inheritance tree for vtkPicker you will see the methods GetProp(), GetActor(), etc.. which
return the picked object. I know that vtkPropPicker uses hardware picking instead of the
ray-casting method of vtkPicker. I use the vtkPropPicker because it seems more reliable (plus
I don't care to know the list of objects intersected by the ray). Hope this helps,
-Jeff
"K.R.Subramanian" wrote:
> The documentation for vtkPicker says that the the actor or prop closest
> to the camera that was intersected is returned. But I only see methods
> that return the list of Actors (and another method to return the list of
> Prop3Ds - what is
> the difference?), which are not in sorted order.
>
> I am implementing picking and need to get the closest object hit.
>
> I also agree with an earlier post on picking actors; it would be very
> convenient
> to have a way of attaching user data with an actor. For instance, in
> my
> application, only some of the actors are pickable and I would like to
> attach
> some user data that would be useful in identifying the actor that was
> picked.
>
> -- krs
>
> --
> K.R.Subramanian Phone: (704) 687-4872
> Department of Computer Science FAX: (704) 687-4893
> UNC Charlotte, CARC 311 Email: krs at cs.uncc.edu
> Charlotte, NC 28223-0001 Web: http://www.cs.uncc.edu/~krs
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
--
J.A. Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20010513/5d005dea/attachment.htm>
More information about the vtkusers
mailing list