[vtkusers] Cell Picking in Java

ALIZIER Julien AUSY julien.alizier-ausy at irsn.fr
Tue May 24 08:37:16 EDT 2005


Hi Alban,

I am using C++, so I can't help you with Java. 
But I noticed that vtkCellPicker and vtkPointPicker are very sensitive to
the tolerance parameter. 
I am now using SetTolerance(0.0001) with no more strange effects.

HTH
-- Julien
 

-----Message d'origine-----
De : alban desbos [mailto:desbos.alban at caramail.com]
Envoyé : mardi 24 mai 2005 14:24
À : vtkusers at vtk.org
Objet : [vtkusers] Cell Picking in Java


Hi,

I have a problem with the cell picking in Java.
When I click with the mouse, I want to know the cell Id, but I often get a
wrong result.
I tried with different tolerance values but it's still the same thing.
If someone know how to use vtkPicker with Java. Thank you in advance.
Alban

//renWin is a vtkPanel
iren = new vtkRenderWindowInteractor();
iren.SetRenderWindow(renWin.GetRenderWindow());
...
public void mouseClicked(MouseEvent e) {
   picker = new vtkCellPicker();
   iren.SetPicker(picker); //iren
   picker.SetTolerance(0.01);
   picker.Pick(e.getX(), e.getY(), 0, renWin.GetRenderer());
   System.out.println(picker.GetCellId());
 }


La puissance n’est pas innée : elle se construit. Cliquez ici pour découvrir
Nike Free !



More information about the vtkusers mailing list