[vtkusers] retrieving mouse position in a vtkRenderWindow

Jeremy Winston winston at cat.rpi.edu
Fri Oct 4 11:42:59 EDT 2002


Steffen Oeltze wrote:
> 
> Hi,
> 
> I would like to output the mouse position (x,y) in a vtkRenderWindow each
> time the user presses a mouse button. Can anybody help me ?

See the examples at
http://public.kitware.com/VTK/doc/release/4.0/html/c2_vtk_e_2.html#c2_vtk_e_vtkTextMapper

annotatePick.tcl does what you want, except it does so when
the user presses 'p' instead of mouse-clicking.  You should
be able to bind your callback to the mouse-click, but how
depends on your language (Tcl/Tk, C++, Python).

HTH,
-Jeremy



More information about the vtkusers mailing list