模拟多个自由度的机械臂
hArm = osg::Matrix::rotate(osg::DegreesToRadians(rotateArm1), 1, 0, 0); osg::Matrix originPos = rotArm->getMatrix(); osg::Vec3d set_center = osg::Vec3d(0, 0, 4); rotArm->setMatrix(originPos*osg::Matrix::translate(-set_center)*hArm*osg::Matrix::translate(set_center));