Hi all,<br><br>Well, still struggling with point picking in 2D actors. I am trying to use the vtkWorldPointPicker and then converting it to display coordinates later.<br><br>However, does vtkWorldPointPicker work with renderers that are essentially rendering 2D actors. I am getting some values that make no sense to me (well, that is not new) and when I convert them back to screen coordinates, the values are just wrong.
<br><br>Here is the code and the output that t returns at various stages. I would really appreciate it if someone cana ctually provide some help or an indication to a direction worth pursuing...<br><br>I will just give some information about the scene. So, the input to the viewer is the output from a vtkImageReslice that just returns one slice. So, it is basically a 2D image. However, the reslicer has other parameters that might zoom and rotate the image. So, I wanted to find out the position in the image when I click my mouse somewhere on the screen. No luck, so far... Is it even possible? Any ideas on how we can implement that?
<br><br>// This code is in my interactor.<br><br> int x = this-&gt;Interactor-&gt;GetEventPosition()[0];<br>int y = this-&gt;Interactor-&gt;GetEventPosition()[1];<br>this-&gt;FindPokedRenderer(x, y);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
<br>if (this-&gt;CurrentRenderer == NULL)<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return;<br><br>&nbsp;vtkWorldPointPicker * picker = vtkWorldPointPicker::New();<br>&nbsp;int picked = picker-&gt;Pick(x, y, 0, this-&gt;CurrentRenderer);<br>&nbsp;if (picked != -1)<br>
&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; std::cout &lt;&lt; picker-&gt;GetPickPosition()[0] &lt;&lt; &quot;: &quot; &lt;&lt; picker-&gt;GetPickPosition()[1] &lt;&lt; std::endl;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // The values returned are: -0.00106603 and -0.00149245...
. Does this make any sense? How do we interpret these values...??<br><br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; vtkCoordinate* c = vtkCoordinate::New();<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; c-&gt;SetViewport(this-&gt;CurrentRenderer);<br>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; c-&gt;SetCoordinateSystemToWorld();
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; c-&gt;SetValue(picker-&gt;GetPickPosition()[0], picker-&gt;GetPickPosition()[1]);<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; int *p = c-&gt;GetComputedDisplayValue(this-&gt;CurrentRenderer);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; p[0] &lt;&lt; &quot;: &quot; &lt;&lt; p[1] &lt;&lt; std::endl;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // These converted values are not correct.<br>}<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>Cheers and thanks,<br><br>Anja<br><br>