osg object AnimationPathCallback

osg::ref_ptr<osg::Node> OSG_Qt_::operateMatrix()
{
    osg::ref_ptr<osg::Group> group = new osg::Group;
    osg::ref_ptr<osg::Node> node1 = osgDB::readNodeFile("D:\\参考手册\\BIM\\osg\\tanker.OSGB");
    osg::ref_ptr<osg::Node> node2 = osgDB::readNodeFile("D:\\参考手册\\BIM\\osg\\tanker.OSGB");
    osg::ref_ptr<osg::MatrixTransform> matrixT = new osg::MatrixTransform;
    
    
    matrixT->addChild(node1);
    matrixT->setMatrix(osg::Matrix::translate(2000.0,0.0,0.0));
    matrixT->setUpdateCallback(new osg::AnimationPathCallback(osg::Vec3(0.0,0.0,0.0),osg::Z_AXIS,1.0));

    group->addChild(node2);
    group->addChild(matrixT.get());

    return group;
}

 

posted @ 2019-06-23 21:20  西北逍遥  阅读(554)  评论(0编辑  收藏  举报