Hello,
I try to check if an Actor can be seen by a user or if it is hidden behind another object. Currently I try doing this with a picker, since I thought it would only select the topmost Actor. But it selects all actors in its path, and I’ve run out of ideas.
Also adding only the desired Actors to the pick list does not work, because they will be picked any time
What I do currently (pseudocode)
point = [actor.x, actor.y, 0]
picker = vtkPointPicker.newInstance()
picker.pick(point, renderer)
Now picker.getActors() will return all actors in the pickers ray cast, and they always have the same order to, so I can not decide if the actor can be seen by the user or is hidden behind one of the other actors.
Have you trief Worldpointpicker instead of Pointpicker? According to documentation: vtkWorldPointPicker is the fastest picker, returning an x-y-z coordinate value using the hardware z-buffer.
Ok the efficiency issue was mostly on my part. For a group of actors I did one selection for each everytime the view was moved. Now I optimised it by doing on large selection where all actors could be included (if they are visible) and I only do this, once moving the view has ended.
The selection still takes 50 - 150ms, but its definitely smooth enough for my interaction.