On Thu, 2008-04-24 at 16:21 +0000, Andrew Lett wrote:
> Hello Donald,
> 
> I actually tried something along the lines of what you wrote:
> 
>   int my_x = (int) ( ((ea.getX() + 1.0) / 2.0) * 640.0 );
>   int my_y = 480 - (int)(((ea.getY() + 1.0) / 2.0) * 480.0);
> 
> Your lines basically do the same thing (except flip the y axis). However, my
> problem is that the mouse tracking in x is still off by a little bit, 
> especially
> near the left and right hand side of the screen. It appears that the values in
> OSG aren't exactly normalized as expected (e.g. with getXnormalized() ). I 
> even
> tried the following code, but it didn't solve my problems with the tracking 
> in x:
> 
>   int my_x = (int) ( ((ea.getXnormalized() + 1.0) / 2.0) * 640.0 );
>   int my_y = 480 - (int)(((ea.getYnormalized() + 1.0) / 2.0) * 480.0);
> 
> This is why I'm trying to get the raw pixel position. So if there are any 
> other
> suggestions, please pass them along.

Again, I never get the normalized values in osgWidget (and haven't since
I began writing it). This has to have something to do with the kind of
camera the event appears within, as looking through the code I see that
the event{X,Y} values are calculated two different ways depending on
whether a function getFocusedCamera() returns true or not...

How is your scene laid out? I've never used CEGUI with OSG, so I'm not
sure how people in the past have done it.

> Best regards,
> - Andrew
> 
> 
> _______________________________________________
> 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