Hi,
I don't know if anyone has delt w/ this problem yet, but it appears that
TrackballManipulator has a bug in it in the methods, setByMatrix() and
computePosition().
I could be wrong, as I'm a novice in OSG, but I have observed the following:
setByMatrix()
1. does not work for me as every time I call it, the camera's position &
orientation are not altered or updated
2. the code "appears" to be incorrect compared to other manipulator examples
which work.
from NodeTrackerManipulator:
void NodeTrackerManipulator::setByMatrix(const osg::Matrixd& matrix)
{
osg::Vec3d eye,center,up;
matrix.getLookAt(eye,center,up,_distance);
computePosition(eye,center,up);
}
this code works. But from TrackballManipulator:
void TrackballManipulator::setByMatrix(const osg::Matrixd& matrix)
{
_center = osg::Vec3(0.0f,0.0f,-_distance)*matrix;
_rotation = matrix.getRotate();
}
This code does NOT work.
as for computePosition()
1. in TrackballManipulator, it appears to be using COLUMN MAJOR matrices but
OSG is row major.
2. as compared to NodeTracker and Terrain manipulators, the method for
computing the position/orientation is consistent. However, in the Trackball it
is performed using, I believe, an invalid way to fill a matrix with
rotation/orientation information.
Has anyone else encountered this?
...
Thank you!
Cheers,
Allen
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=19184#19184
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org