[vtkusers] Mixing vtkImageActors and geometry ( vtkActor2D ), picking x, y, z coordinate from image actor correctly

Obada Mahdi omahdi at gmx.de
Wed Dec 13 06:48:21 EST 2006


Hi Jesús and Dean,

On 12/13/06, Jesús Spí­nola <jspinola at gmail.com> wrote:
[vtkPropPicker does not pick as expected]
> > have you tried setting PickableOff and DragableOff on
> > all the actors that you do not want to pick?
>
> Yes, and I also tell to the picker to pick only from the list (
> PickFromListOn() ) and I add the image actor to the picker ( AddPickList() )
> but it still continues giving me the z coordinate from actors I've set
> PickableOff and DragableOff.
>
> Any suggestion about this problem?

the problem might be the fact that vtkPropPicker uses the hardware
Z-buffer, and that overlaying text actors modify that, regardless of
whether they are supposed to be pickable or not--I am not sure whether
or not there is code anywhere at all that controls the depth mask bit
based on VTK's idea of pickability.

Shooting blindly, you could try to set the text actors to some opacity
marginally less than 1.0 and see if that will change things, although
I doubt it.  There is a comment in

[Rendering/vtkOpenGLPolyDataMapper2D.cxx, lines 205ff]
| 205  // Assume we want to do Zbuffering for now.
| 206  // we may turn this off later
| 207  glDepthMask(GL_TRUE);

but at the first glimpse I cannot see where writing into the depth
buffer would be disabled again (anyone?)

Maybe you could use vtkCellPicker instead to avoid these problems?  If
I'm not mistaken, it should work with picking an vtkImageActor and
cannot handle 2D actors anyway.


HTH,

Obada



More information about the vtkusers mailing list