Hi,<br> I use a sphere widget in my application, where a user can drag the sphere around and at the end I do a &quot;pick point&quot; on the surface based on the end location of the sphere.<br>On end interaction event, I get the mouse location and use that to pick point. <br>
For example this is what I do in my callback function:<br><br> int* pos1 = this-&gt;renderWindowInteractor-&gt;GetEventPosition();<br> picker-&gt;Pick(pos1[0], pos1[1], 0, this-&gt;renderer);<br><br><br>The problem is that the location of the sphere is not exactly under the mouse while dragging but offset by some variable amount.<br>
Is there any way where the sphere always is under the mouse while dragging it ?<br><br><br>The is my code where I call the callback:<br><br>   sphereWidgetReam = vtkSphereWidget::New();<br>   sphereWidgetReam-&gt;SetInteractor(this-&gt;iren);<br>
<br>    sphereCallbackReam = SphereCallback::New();<br>    sphereCallbackReam-&gt;SetRenderer(this-&gt;aRenderer);<br><br>    sphereCallbackReam-&gt;SetInteractor(this-&gt;iren);<br>    sphereWidgetReam-&gt;AddObserver(vtkCommand::EndInteractionEvent,sphereCallbackReam);<br>
    sphereWidgetReam-&gt;GetSphereProperty()-&gt;SetColor(0,1,0);<br>    sphereWidgetReam-&gt;GetSphereProperty()-&gt;SetOpacity(1);<br>    sphereWidgetReam-&gt;SetRadius(3);<br>    sphereWidgetReam-&gt;TranslationOn();<br>
    sphereWidgetReam-&gt;ScaleOff();<br><br><br>Thanks,<br>Somi<br>