On Tue, 2008-01-22 at 12:00 -0500, Brian wrote:
> Hi,
> 
> I am in the process of trying to create an interactive Macromedia Flash 
> drawable.  I am now at the point where the Flash movie is rendering, but it 
> has no available mouse input.  My problem is how to determine what the 
> coordinates of my mouse cursor are (in 2D space) when the mouse is over the 
> drawable.  Preferably, I'd like to know the 2D coordinate of the mouse 
> position in terms of (0..1, 0..1).  The drawable itself is in 3D space.
> 
> I know that the IntersectVistor allows me to do certain things, but I have 
> never really used it before.  I've taken a look at the osgPick example and 
> see that I can get the local and world coordinates of an intersection, but I 
> am unclear as to whether there are any helper OSG classes/functions that will 
> allow me to map that intersection point to the correct 2D coordinate to pass 
> to the Flash player.  Also, is it possible to restrict the intersection tests 
>  for my Flash drawables only?

osgGA::GUIEventAdapter::{getX, getY} is what I believe you want here,
but you'll need to know how to tie it all in together with your app,
which is a somewhat non-trivial thing (imo).

Of course, I'd encourage you to just use osgHUD--since it never hurts to
have more eyeballs looking at my code--but it may not be ready for your
use yet. :) However, nothing about what you've described here wouldn't
fit into osgHUD currently, though you'd need to inhert from
osgHUD::Window or osgHUD::Widget somehow. I'd be willing to help with
this if your code is public...

Also, osgHUD handles the picking exclusivity issues by requiring the
user provide a unique NodeMask when creating an osgHUD::WindowManager
object. I asked a few months back and was told this was the best way, so
I'd say the same would apply here as well.

(If you want to see how osgHUD does all this, check out SVN and look at
the osgHUD/ViewerEventHandlers file)

> Thanks,
> Brian
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to