[osg-users] Matrixf and Quat problem
Vincent Bourdier
vincent.bourdier at gmail.com
Thu Mar 13 09:55:20 PDT 2008
Hi,
I am trying for hours to make a rotation with two vectors...
The code is :
osg::Matrixf MR = osg::Matrixf::identity(); //matrix rotation
MR.rotate(angle*osg::PI/180.0, _NodeTranslation^_NodeTranslationStart);
osg::Quat qrotation = osg::Quat();
qrotation.set(MR);
_rotation *= qrotation;
cout<<"Rot : "<<qrotation.x()<<" "<<qrotation.y()<<" "<<qrotation.z()<<" "<<
qrotation.w()<<endl;
And in the console, the result is :
Rot : 0 0 0 1
Rot : 0 0 0 1
Rot : 0 0 0 1
...
I've checked 'angle' and it is a good value, always increasing...
Is there any problem in my code ? Why the Quat doesn't change... ?
Thanks,
regard,
Vincent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080313/907ba83a/attachment.html
More information about the osg-users
mailing list