mobile crane 1

void MobileCrane::rotateRope2()
{
    //double r_angle1 = rotateRope + rorate3;
    //std::cout << "r_angle1:" << rotateRope << std::endl;
    //rotRope->setMatrix(osg::Matrix::rotate(osg::DegreesToRadians(rotateRope), 0, 1, 0));
    ropeMatrix = osg::Matrix::rotate(osg::DegreesToRadians(rotateRope), 1, 0, 0);
    osg::Matrix originPos = rotRope->getMatrix();
    osg::Vec3d set_center = osg::Vec3d(0, 7, 0);
    rotRope->setMatrix(originPos*osg::Matrix::translate(-set_center)*ropeMatrix*osg::Matrix::translate(set_center));

}

 

posted @ 2019-09-15 18:53  西北逍遥  阅读(210)  评论(0编辑  收藏  举报