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->Interactor->GetEventPosition()[0];<br>int y = this->Interactor->GetEventPosition()[1];<br>this->FindPokedRenderer(x, y);<br>
<br>if (this->CurrentRenderer == NULL)<br> return;<br><br> vtkWorldPointPicker * picker = vtkWorldPointPicker::New();<br> int picked = picker->Pick(x, y, 0, this->CurrentRenderer);<br> if (picked != -1)<br>
{<br> std::cout << picker->GetPickPosition()[0] << ": " << picker->GetPickPosition()[1] << std::endl;<br> // The values returned are: -0.00106603 and -0.00149245...
. Does this make any sense? How do we interpret these values...??<br><br> vtkCoordinate* c = vtkCoordinate::New();<br> c->SetViewport(this->CurrentRenderer);<br> c->SetCoordinateSystemToWorld();
<br> c->SetValue(picker->GetPickPosition()[0], picker->GetPickPosition()[1]);<br> int *p = c->GetComputedDisplayValue(this->CurrentRenderer);<br> std::cout << p[0] << ": " << p[1] << std::endl;
<br> // These converted values are not correct.<br>}<br> <br>Cheers and thanks,<br><br>Anja<br><br>