Hi Aviral, A 4x4 matrix isn't sufficient for setting all the values of TrackballManipulator as it needs to know the eye point and center of ratation, a 4x4 matrix can provide the eye point and look direction but not the distance between the eye and center of rotation.
Robert. On 2 March 2015 at 07:06, Aviral Goel <[email protected]> wrote: > Hi, > > I am trying to implement a KyeboardManipulator for translating, scaling > and rotating 3D models via keyboard, similar to the TrackballManipulator. I > am surprised that osg does not have this already. > > I wrote a keyboard manipulator class to at least zoom in and zoom out and > translate the model. However I am having a hard time getting it to work > with the Trackball Manipulator. Once I update the view matrix via keyboard, > the TrackballManipulator does not resume from there. Obviously, unless > told, it has no way of figuring this out by itself. So I tried to find some > function which will cause the TrackballManipulator to update its state > based upon the current view matrix. But I couldn't find any function which > does this. setByMatrix does not seem to work the way I expected. The > TrackballManipulator goes bonkers once I update model via keyboard and use > setByMatrix. It does not allow the model to be rotated properly afterwards. > Somehow the rotation axis changes and a small mouse movement causes it to > pan the model rather than rotate it. > > Once I manipulate model via keyboard, what steps are needed for me to > update the TrackballManipulator to continue from there instead of resetting > the model position.? > ... > > Thank you! > > Cheers, > Aviral Goel > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=62892#62892 > > > > > > _______________________________________________ > 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

