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

Christian Buchner christian.buchner at gmail.com
Tue May 17 02:58:59 PDT 2016


Could it be that the "throw" feature of the camera manipulator is
responsible for the roll?
If so, try disabling it.

Also, post source code if you want specific help with a specific issue in
your implementation.

Christian


2016-05-16 14:59 GMT+02:00 Daniel Neos <daniel.rd at hotmail.de>:

> Hi everyone,
>
> I have implemented a Cameramanipulator by myself, because I need more
> individually control over the camera in the scene, like rotating around a
> specific axis.
>
> I let osg compute the Boundingsphere of my scene and set the rotationpoint
> and the lookat-point or center-point at the center of the Boundingsphere.
>
> My rotation works like this
>
> 1.) Translate the camera to the center of the Boundingsphere
> (Multiplicated from the right side of the viewmatrix of the camera fist)
>
> 2.) Rotate the viewmatrix by the OSG::x_axis and OSG::y_axis (depending on
> the mousemovement)
>
> 3.) Translate the camera back with the vector from step 1.
>
> 4.) Now with the last step I ensure, that the camera stays focused at the
> samepoint by getting the eye, center and up vector and reseting the center
> vector, while eye and up remains the same.
>
> This usually works fine and it is easy to navigate through the scene with
> the mouse, but as I reach some regions the camera unexpectedly seem to
> rotate around its own z-axis which results in to a 'roll'.
>
> How can I prevent this behaviour? Sample code with arcball camera would be
> appreciated too :)
>
> Thank you!
>
> Cheers,
> Daniel
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67113#67113
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160517/397a69fd/attachment-0003.htm>


More information about the osg-users mailing list