[vtkusers] Appearing/Disappearing point id labels - vtkSelectVisiblePoints (vtk 4.2)

Clinton Stimpson clinton at elemtech.com
Tue Dec 9 00:29:10 EST 2003


I had a few problem with vtkSelectVisiblePoints as well.
SetTolerance wasn't the greatest of my problems.

My problem was this

      diff = fabs(z-dx[2]);
      if ( diff <= this->Tolerance )
        {
        visible = 1;
        }

What that means is that your point has to be within tolerance of something 
that is visible (in front of or in back of).  That wasn't right for what I 
needed, and may also not be the intended behavior of this filter.  Another 
problem I had with this is if there was nothing drawn at that location, my 
point would not be considered visible (even though if it were really drawn, 
it would be).

The following code made a significant improvement for me and prevent all or 
most of the flickering on/off from happening.

       if( dx[2] <= (z + this->Tolerance) )
         {
         visible = 1;
         }

What that means is that a point has to be in front of something visible or 
in back of something visible within tolerance to be considered visible.  
This also fixed the problem of not having anything drawn at that location 
and the point was considered invisible.

I found that the default tolerance that the filter sets is quite reasonable.

If this really is a bug in that filter, can someone put it in the VTK 
source?  My latest update from CVS shows what I consider the incorrect 
behavior (for what I need).

Clint



> --__--__--
> 
> Message: 9
> From: "John Platt" <jcplatt at lineone.net>
> To: <vtkusers at vtk.org>
> Date: Mon, 8 Dec 2003 23:47:05 -0000
> Subject: [vtkusers] Appearing/Disappearing point id labels -
> vtkSelectVisiblePoints (vtk 4.2)
> 
> This is a multi-part message in MIME format.
> 
> ------=_NextPart_000_0001_01C3BDE5.995D12C0
> Content-Type: text/plain;
> 	charset="us-ascii"
> Content-Transfer-Encoding: 7bit
> 
> Hi vtkusers,
> 
>  
> 
> I am displaying point id labels on a single hexahedron using the
> pipeline vtkIdFilter > vtkSelectVisiblePoints > vtkLabeledDataMapper.
> When I zoom in/out (mouse right-click) the point id labels on the
> BOUNDARY in the view plane randomly appear & disappear.
> 
>  
> 
> Point id's that are not labelled always have a z-buffer value of 1
> suggesting that this is due to rounding when the view coordinates are
> cast to integers. I am not sure how
> vtkSelectVisiblePoints::SetTolerance() can be used to get around the
> problem.
> 
>  
> 
> Any suggestions?
> 
>  
> 
> Thanks in advance.
> 
>  
> 
> John Platt
> 




More information about the vtkusers mailing list