Hi Martin,
I had a try at doing this through TrackBallManipulator
This seems to work, tested on Windows with viewerQT and viewer.Each mouseWheel
click zooms in/out by 10%
I'm not an expert and would welcome any suggestions about better ways to do
this.
That looks a bit like how we did it in our local codebase, except that
instead of acting directly on _distance, in our case we set dy to 0.1 or
-0.1 (depending on scroll up or down) and then let the normal mouse
zooming functionality do the zooming calculations:
if (_ga_t0->getEventType() == osgGA::GUIEventAdapter::SCROLL)
{
dy = _ga_t0->getScrollingMotion() ==
osgGA::GUIEventAdapter::SCROLL_DOWN ? 0.1 : -0.1;
}
It works well too, perhaps you can compare the two and see which one you
like best in terms of behavior. I don't know if zooming in/out by 10%
per mouse wheel click is too much or too little, I haven't tested your
code directly...
And in our case, we didn't add a completely separate case for SCROLL in
the handle() method, just piggybacked on top of the DRAG case:
case (osgGA::GUIEventAdapter::SCROLL):
case (osgGA::GUIEventAdapter::DRAG):
{
// ...
}
J-S
--
______________________________________________________
Jean-Sebastien Guay [email protected]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org