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 "pick point" 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->renderWindowInteractor->GetEventPosition();<br> picker->Pick(pos1[0], pos1[1], 0, this->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->SetInteractor(this->iren);<br>
<br> sphereCallbackReam = SphereCallback::New();<br> sphereCallbackReam->SetRenderer(this->aRenderer);<br><br> sphereCallbackReam->SetInteractor(this->iren);<br> sphereWidgetReam->AddObserver(vtkCommand::EndInteractionEvent,sphereCallbackReam);<br>
sphereWidgetReam->GetSphereProperty()->SetColor(0,1,0);<br> sphereWidgetReam->GetSphereProperty()->SetOpacity(1);<br> sphereWidgetReam->SetRadius(3);<br> sphereWidgetReam->TranslationOn();<br>
sphereWidgetReam->ScaleOff();<br><br><br>Thanks,<br>Somi<br>