Hi David,
On 2/09/09 12:25 PM, David Goering wrote:
rotation part of a Transformation Matrix by doing the following:
osg::Quat rot = arTransform->getMatrix().getRotate();
I then try to access the values with this: > osg::Vec4d vec = rot.asVec4();
int rx = vec.x();
int ry = vec.y();
int rz = vec.z();
int rw = vec.w();
But all my values are = 0.
That's because you're converting floats to int, thereby truncating them (from values
0.0<=x<1.0) to 0.
What I need to do is invert the rotation.
I'm not aware of a invert functionality on Quat but you could create a rotation matrix
from the Quat, invert that, and get a quaternion back.
If that is what you need, I could imagine you're after the in
go? I am not exactly sure how a quat can hold the rotation for multiple axis in
the
first place? If it contains x,y and z values with one angle, how would it hold
the rotation
around x axis 30° as well as y axis 15° ?
It holds the resulting rotation for both rotations.
Hope this helps,
Cheers,
/ulrich
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org