<html><head><style type="text/css">body{font:12px Arial;margin:3px;overflow-y:auto;overflow-x:auto}p{margin:0px;}blockquote, ol, ul{margin-top:0px;margin-bottom:0px;}</style></head>

<body><div style="DISPLAY: block; FONT-SIZE: 12px; FONT-FAMILY: Arial"><P>Hi,</P>
<P>&nbsp;</P>
<P>I have a problem with the picking. When I click on my window where there is only a triangle, I get the CellId. But I get sometime wrong values (ie 0 instead of -1 and -1 instead of 0). And if I begin to tyranslate, zoom or rotate, it's worth.</P>
<P>If someone finds where is the problem ?</P>
<P>Thank you in advance.</P>
<P>&nbsp;</P>
<P>Alban</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>A part of my code :</P>
<P>&nbsp;</P>
<P>private vtkCellPicker picker;</P>
<P>private vtkRenderWindowInteractor iren;</P>
<P>...</P>
<P>public MyClass() {</P>
<P>&nbsp;&nbsp;&nbsp;...</P>
<P>&nbsp;&nbsp; //Add the MouseListener</P>
<P>&nbsp;&nbsp; renWin.addMouseListener(this);</P>
<P>&nbsp;&nbsp; ...</P>
<P>&nbsp;&nbsp; //Build the triangle</P>
<P>&nbsp;&nbsp; aTriangleGrid = new vtkUnstructuredGrid();<BR>&nbsp;&nbsp; vtkTriangle aTriangle = new vtkTriangle();<BR>&nbsp;&nbsp;&nbsp;points = new vtkPoints();<BR>&nbsp;&nbsp; points.InsertNextPoint(0,0,0);<BR>&nbsp;&nbsp; points.InsertNextPoint(2,0,0);<BR>&nbsp;&nbsp; points.InsertNextPoint(1,2,0);<BR>&nbsp;&nbsp; aTriangle.GetPointIds().SetId(0,0);<BR>&nbsp;&nbsp; aTriangle.GetPointIds().SetId(1,1);<BR>&nbsp;&nbsp; aTriangle.GetPointIds().SetId(2,2);<BR>&nbsp;&nbsp; aTriangleGrid .InsertNextCell(aTriangle.GetCellType(), aTriangle.GetPointIds());<BR>&nbsp;&nbsp; aTriangleGrid .SetPoints(points);</P>
<P>&nbsp;&nbsp; ...</P>
<P>&nbsp;&nbsp; iren = new vtkRenderWindowInteractor();</P>
<P>&nbsp;&nbsp; renWin.GetRenderWindow().SetInteractor(iren);</P>
<P>}</P>
<P>...</P>
<P>public void mouseClicked(MouseEvent e) {<BR>&nbsp;&nbsp;picker = new vtkCellPicker();<BR>&nbsp;&nbsp;picker.AddObserver("EndPickEvent", myClass.this, "annotatePick");<BR>&nbsp;&nbsp;renWin.GetRenderWindow().GetInteractor().SetPicker(picker);<BR>&nbsp;&nbsp;picker.SetTolerance(0.01);<BR>&nbsp;&nbsp;picker.Pick(e.getX(), e.getY(), 0, renWin.GetRenderer());<BR>&nbsp;}</P>
<P>public void annotatePick() {&nbsp;&nbsp;System.out.println(picker.GetCellId());&nbsp;}</P>
<P>&nbsp;</P></br><p style="margin-top:11px;padding-top:3px;background-image: url(http://mail.lycos.co.uk/Images/Mail/_content/dot.gif);background-repeat: repeat-x;background-position: 0px 0px;"><b>La puissance n&rsquo;est pas inn&eacute;e : elle se construit.</b> <a href="http://ads.lycos-europe.com/event.ng/Type=click&FlightID=190429&AdID=411354&TargetID=null&Segments=19885,2789&Targets=null&Values=243,292,24179,24195,24736,229&RawValues=&Redirect=http://www.nike.com/freeeurope/?l=fr_fr&cid=902" target="_blank">Cliquez ici pour d&eacute;couvrir Nike Free !</a></div></body></html>