Hi Kony,

On Thu, 2005-01-27 at 14:38, Kornelia Ganglbauer wrote:
> Hallo!
> 
> In my application a MouseButtonPress event reacts on a click with a mouse.
> Because of the combination of QT and OpenSG I get a QMouseEvent as
> parameter. Out of this I can get the x and y coordinates relative to the
> widget. My aim is to create an object (for example a torus) at this point.
> That means, I know how far away from the camera (in z direction) it should
> be. But I do not know, how I can convert the mouse coordinates to the
> corresponding coordinates in my scene.
> 
> Can anybody help me?

The SimpleScreenManager has a method calcViewRay() that returns a line
that starts at the viewer and goes through the given point on the
screen. If you know how far away you want the object that will be all
you need.

Hope it helps

        Dirk




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to