[osg-users] Matrixf and Quat problem
Vincent Bourdier
vincent.bourdier at gmail.com
Fri Mar 14 02:48:29 PDT 2008
I've located my problem, and this time I don't know why it doesn't change
anything...
osg::Matrixf MR = osg::Matrixf::identity();
MR.rotate(angle*osg::PI/180.0, rotaxis);
note :
rotaxis : 0.03, 0.0000006, -0.99
angle = 19.78
result :
MR = identity...
Is it me who make mistakes ? or there is a real problem ?
Thanks,
Vincent
2008/3/14, Vincent Bourdier <vincent.bourdier at gmail.com>:
>
> Hi,
>
> You're right !! cross product is null ... I don't know why but now I know
> where is the problem.
>
> Thanks :)
>
> Vincent.
>
> 2008/3/13, Vican, Justin E. <jvican at draper.com>:
> >
> > What are the values of _NodeTranslation and_NodeTranslationStart? If
> > that cross product returns a zero vector (0,0,0), a NULL rotation will be
> > computed.
> >
> >
> >
> > *From:* osg-users-bounces at lists.openscenegraph.org [mailto:
> > osg-users-bounces at lists.openscenegraph.org] *On Behalf Of *Vincent
> > Bourdier
> > *Sent:* Thursday, March 13, 2008 12:55 PM
> > *To:* osg
> > *Subject:* [osg-users] Matrixf and Quat problem
> >
> >
> >
> > 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
> >
> > _______________________________________________
> > osg-users mailing list
> > osg-users at lists.openscenegraph.org
> >
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080314/e35c4320/attachment.htm
More information about the osg-users
mailing list