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

dean.inglis at camris.ca dean.inglis at camris.ca
Wed Dec 20 07:55:52 EST 2006


Jesús,

can you write & post a simple tcl
or c++ example that includes the
essentials of your pipeline using vtk
data (e.g., headsq) that shows the problem?

Dean

> 
> 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
> >
> 
> 



More information about the vtkusers mailing list