HI Frashid,

Which version of the OSG are you using? The getRotate has gone through
many incarnations and quite a few months back that was a big round of
interations that settled on what is current in SVN - which meant
effectively reverting back to an older implementation.

Robert.

On 8/23/07, Farshid Lashkari <[EMAIL PROTECTED]> wrote:
> 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
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to