[osg-users] Arcball Camera without unexpecting 'roll' of the camera

Jan Ciger jan.ciger at gmail.com
Tue May 17 06:26:14 PDT 2016


On Tue, May 17, 2016 at 2:35 PM, Daniel Neos <daniel.rd at hotmail.de> wrote:

> Unfortunalety there is no feature "throw" feature. My class inherits from
> osgGA::GUIEventHandler and there is no setAllowThrow implemented, as far as
> I know.
>
>
And if I am zooming in, sometimes the effect gets worse and the camera is
> hardly to control. Maybe there is an error in my rotation setup?
>


That sounds like a classic case of gimbal lock to me. You are rotating
using 2 Euler angles rotations, so it is easy to align the axes in exactly
"the wrong way" and trigger the singularity when approaching +- 90 degrees.

You may want to look at this code:
https://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Arcball

J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160517/11fbea5c/attachment-0003.htm>


More information about the osg-users mailing list