I think you can at least get the starting position by using the picker.GetPickPosition() although this is not your center of the vertex but the coordinates on the glyph. It is at least in 3D coordinates. To get the real starting point you should indeed get the Actor that is picked upon and use it's GetCenter() to retrieve the center of the glyph.
<br><br>I haven't been able to pull this off though. When i try to get the Actor i'm picking on i seem to pick the picker's actor for my GetCenter() always returns the middle of the data instead of the middle of the vertex.
<br><br>In any case I'm quite curious how you can go from a cellId to the approperiate vertex... Do you just integer divide by the number of cells per glyph?<br><br>Perhaps Henrik can shed some more light on how you can actually get the actor of the glyph when picking?
<br><br>Regards - Geofram<br><br><div><span class="gmail_quote">On 6/13/07, <b class="gmail_sendername">Meisam Aliroteh</b> <<a href="mailto:meisam.aliroteh@gmail.com">meisam.aliroteh@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>Hi,</div>
<div> </div>
<div>I have a polydata and used a sphere source to render the polydata in point-cloud mode (i.e only vertices are rendered, and I use spheres to show these vertices). I want the user to be able to click on any vertex (shpere) and move it in the 3D space (well actually it would be a motion restricted to the current view plane). I used vtkCellPicker and know how to figure out which vertex is picked when the user clicks on it. What I don't know is how to figure out the motion vector when the user clicks and drags a sphere ? I can get the old and new mouse positions from the interactor but these are 2D coordinates.
</div>
<div> </div>
<div>I guess what I need is the 3D coordinates of the previous and current mouse positions, so that when I subtract these 3D coordiantes I get a motion vector and then I can move the picked vertex by adding this motion vector to it. The problem is I don't know how to get the 3D coordinate of the mouse pointer using VTK !!!
</div>
<div> </div>
<div>Any ideas?</div>
<br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers
</a><br><br></blockquote></div><br>