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

Jesús Spí­nola jspinola at gmail.com
Wed Dec 20 07:25:29 EST 2006


The fact is I tried before the vtkCellPicker but it gives me different
coordinates than vtkPropPicker. Also vtkCellPicker is giving me wrong
coordinates and for example, when I'm on the bottom slices the cell picker
tells me I'm out of the image. I've set a very precise tolerance, the code
looks like the one in vtkImagePlaneWidget so I don't know what could be the
real problem to get wrong coords with cell picker

2006/12/13, Obada Mahdi <omahdi at gmx.de>:
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20061220/8ff26b32/attachment.htm>


More information about the vtkusers mailing list