Just test it. The multiplication order is soo messed up.
Vector3 vs. Matrix = post-multiplication
Vector3 vs. Quat = pre-multiplication
Quat vs. Quat = post-multiplication
The consequence is that all three lines below give you the same output.
int main(int argc, char** argv)
{
osg::Matrix m;
osg::Matrix m2;
osg::Quat q( osg::PI_2, osg::Vec3( 0, 0, 1 ) );
osg::Quat q2( osg::PI_2, osg::Vec3( 0, 1, 0 ) );
osg::Vec3d t( 2, 0, 0 );
osg::Vec3d x( 3, 0, 0 );
m.setRotate( q );
m.setTrans( t );
m2.setRotate( q2 );
osg::Vec3d out = x * m * m2;
osg::Vec3d out2 = q2 * ( q * x + t );
osg::Vec3d out3 = q * q2 * x + q2 * t;
return 0;
}
Richard
(PS.: And in GLSL you got Vector4 vs. Matrix = pre-Multiplication ...)
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org