[vtkusers] Getting x,y coordinates in vtkRenderWindow

Ahmed Mahmoud ahmedmm at gega.net
Mon Jul 16 18:00:24 EDT 2001


Use

int  * pos;
vtkRenderWindowInteractor  * iren =vtkRenderWindowInteractor ::New();
pos=iren->GetEventPosition();
to get  x&y of mouse click
Ahmed
----- Original Message -----
From: Shaun Selha <busds at bu.edu>
To: <vtkusers at public.kitware.com>
Sent: 17 íæáíæ, 2001 12:33 Õ
Subject: [vtkusers] Getting x,y coordinates in vtkRenderWindow


> To all Users:
>
>     I had a posted a previous question on this matter to the group, but
> unfortuneately I don't think I was specific enough about my problem and
> the platform I am using.  I recieved some help and segments of code from
> some very nice people, but unfortuneatly it was for using vtk in a TCL
> environment and I am  using it with a C++ based GUI.  So let me rephrase
> the question.  I am doing a project in which I import some objects and
> make them actors to display in a vtkRenderWindow.  In the
> vtkRenderWindow I use a vtkRenderWindowInteractor in order to zoom, pan,
> and rotate the actors in the screen.  I wish, however, to be able to
> click on a specific actor in the render window and obtain the x,y, and z
> coordinates of that clicked point. Due to the urgency in which I need to
> solve this part of the problem any help would be great.  If anybody has
> a working sample program that does this so I can examine it and figure
> out exactly what I am doing wrong, that would be a great help.  Thank
> you for your help ahead of time.  Please email responses to busds at bu.edu
>
> Shaun Selha
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>





More information about the vtkusers mailing list