osg指定向量旋转指定角度

向量AB,沿着n旋转10度

osg::Vec3 left = AB*osg::Matrix::rotate(osg::inDegrees(10), n);

osg::Vec3 right = AB*osg::Matrix::rotate(osg::inDegrees(-10), n);//right=-left

特殊情况下,可以使用向量叉乘实现,例如旋转90度

osg::Vec3 left = n^AB;

osg::Vec3 right = AB^n;

原文地址:https://www.cnblogs.com/coolbear/p/10856179.html