下面结果是一样的
osg::Matrix mtrixx;mtrixx.makeRotate(90 / 180.f * osg::PI, osg::Vec3(1, 0, 0));osg::Matrix mtrixx12 = osg::Matrix::rotate(90 / 180.f * osg::PI, 1, 0, 0);
下面结果是一样
osg::Matrix m1;m1.makeTranslate(osg::Vec3(18, 12,3));osg::Matrix m2= osg::Matrix::translate(osg::Vec3(18, 12, 3));
下面结果是一样
osg::Matrix mtrixxttt;mtrixxttt.makeScale(osg::Vec3(2, 3,3));osg::Matrix mtrixxppp = osg::Matrix::scale(osg::Vec3(2, 3, 3));
下面两段代码是一样的,旋转90移动15,然后再转90然后再移动15
osg::Matrix mtrixx;mtrixx.makeRotate(90 / 180.f * osg::PI, osg::Vec3(0, 1, 0));tr->setMatrix(mtrixx * tr->getMatrix());mtrixx.makeTranslate(osg::Vec3(15, 0, 0));tr->setMatrix(mtrixx * tr->getMatrix());mtrixx.makeRotate(90 / 180.f * osg::PI, osg::Vec3(0, 1, 0));tr->setMatrix(mtrixx * tr->getMatrix());mtrixx.makeTranslate(osg::Vec3(15, 0, 0));tr->setMatrix(mtrixx * tr->getMatrix());
osg::Matrix mtrixx;tr->setMatrix(osg::Matrix::rotate(90 / 180.f * osg::PI, 0, 1, 0) * tr->getMatrix());tr->setMatrix(osg::Matrix::translate(osg::Vec3(15, 0, 0)) * tr->getMatrix());tr->setMatrix(osg::Matrix::rotate(90 / 180.f * osg::PI, 0, 1, 0) * tr->getMatrix());tr->setMatrix(osg::Matrix::translate(osg::Vec3(15, 0, 0)) * tr->getMatrix());
牛的局部坐标是这样的