Hi,
I'm having some problems with getting the rotation from a matrix. I
was able to reproduce the problem with the following code:
osg::Matrixd m(-1, 0, 0, 0,
0, 0.0370117, -0.999315, 0,
0, -0.999315, -0.0370117, 0,
0, 0, 0, 1);
std::cout << m << std::endl;
m.setRotate(m.getRotate());
std::cout << m << std::endl;
Here is the output of the code:
{
-1 0 0 0
0 0.0370117 -0.999315 0
0 -0.999315 -0.0370117 0
0 0 0 1
}
{
-1 0 0 0
0 0.0370117 0.999315 0
0 0.999315 -0.0370117 0
0 0 0 1
}
As you can see, the rotation of the second matrix is flipped. I looked
through Matrix_implementation.cpp and found multiple versions for
getting the rotation for the matrix. I uncommented the version called
"David Spillings implementation Mk 1" and it seemed to fix this
specific case. Was there something wrong with this older version, or
is the newer version just supposed to be faster? I'm more concerned
with accuracy over speed, so I'd like to use the older version in my
code. I just wanted to make sure I'm not introducing another problem.
-Farshid
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org