Hi all,
I get some code from NodeTrackerManipulator to get my own manipulator able
to track a node, and I suceed, but there is some point I do not understand :
I get the node rotation using :
double sx = 1.0/sqrt(localToWorld(0,0)*localToWorld(0,0) +
localToWorld(1,0)*localToWorld(1,0) + localToWorld(2,0)*localToWorld(2,0));
double sy = 1.0/sqrt(localToWorld(0,1)*localToWorld(0,1) +
localToWorld(1,1)*localToWorld(1,1) + localToWorld(2,1)*localToWorld(2,1));
double sz = 1.0/sqrt(localToWorld(0,2)*localToWorld(0,2) +
localToWorld(1,2)*localToWorld(1,2) + localToWorld(2,2)*localToWorld(2,2));
localToWorld = localToWorld*osg::Matrixd::scale(sx,sy,sz);
_nodeRotation = localToWorld.getRotate(); //node rotation in world
coordinate
But the rotation I get is not exactly the same has the rotation I set for
the node.
When I put the rotation :
(x, y, z, alpha)
I get
(z, -x, -y, alpha)
Any idea to explain this ?
For the moment I added
qq2[0] = -qq[1];
qq2[1] = -qq[2];
qq2[2] = qq[0];
qq2[3] = qq[3];
Now the result is exactly was I expect ... but I would prefer to understand
why there is this "strange" coordinate system rotations (PI_2 around Y and
PI_2 around X if I'm right)
Thanks.
Regards,
Vincent.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org