Hi Michael,

I'm rather cold on this topic as I'm no Qt expert but from a general
perspective of how osgGA::EventQueue::mouseScroll() and
osgGA::GUIEventAdapter work together one should expect the X,Y values
return for a scroll event to be of the previous mouse x,y position and
the mouse coordinates previous set up in EventQueue.  The X,Y values
won't be directly related to the mouse scroll event itself, the values
for the scroll event are encoded in the
GUIEventAdaopter::ScrollingMotion value.

Robert.

On 19 August 2012 20:46, Michael Schanne <michael.scha...@gmail.com> wrote:
> Hi,
>
> I'm seeing something strange with mouse wheel (SCROLL) events in 
> GUIEventAdapter.  My app is a Qt app set up following the osgviewerQt 
> example.  I am trying to implement zooming with the mouse where the zoom 
> follows the mouse cursor.  In some cases I want to zoom with mouse clicks, 
> and in other cases I want to use the mouse wheel.  Zooming was not working 
> correctly when I used the mouse wheel.  I noticed that for SCROLL events, the 
> x and y min/max were always -1 / +1, which caused 
> GUIEventAdapter::getX/Ynormalized() to return the wrong values.  So, I 
> figured I would just use getX/Y() instead and use inverse viewport matrix to 
> get the normalized device coordinates.  But, then I noticed I was still 
> getting inconsistent values for the Y coordinate.  For a RELEASE event, the 
> GUIEventAdapter has Y_INCREASING_DOWNWARDS for the y orientation, and getY() 
> returns 0 in the top left corner of the window.  For a SCROLL event, it has 
> Y_INCREASING_UPWARDS and getY() returns 0 in the bott
 om
>   left corner.  Why are the two event types inconsistent?  Is there some 
> attribute I am forgetting to set somewhere?
>
> I am using OSG 3.0.0 and Qt 4.7.
>
> ...
>
> Thank you!
>
> Cheers,
> Michael
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=49332#49332
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to