osg::AnimationPath osg::AnimationPath::ControlPoint osg::AnimationPathCallback


  •     osg::AnimationPath *  animationPath  =   new  osg::AnimationPath;
        
    // 设置循环,还可设成摇摆:SWING 或仅动作1次:NO_LOOPING 
        animationPath -> setLoopMode(osg::AnimationPath::LOOP);
        
    // 插入时间,和对应的位置和角度
        animationPath -> insert(time,osg::AnimationPath::ControlPoint(position,rotation));
        
    // 设置回调,第二个参数是延迟时间,第三个参数是和时间相乘,可加快和减缓速度
        xform -> setUpdateCallback( new  osg::AnimationPathCallback(animationPath, 0.0 , 1.0 ));
     
  • osg::AnimationPathCallback用法(Examples osgclip)
    osg::AnimationPathCallback::AnimationPathCallback  (  const  osg::Vec3d  &   pivot,  
      
    const  osg::Vec3d  &   axis,  
      
    float   angularVelocity   
     ) 
    含义:以privot为中心点,axis为轴,角速度是angularVelocity,一下为例子:
    osg::MatrixTransform *  transform =   new  osg::MatrixTransform;
    osg::NodeCallback
    *  nc  =   new  osg::AnimationPathCallback(subgraph -> getBound().center(),osg::Vec3( 0.0f , 0.0f , 1.0f ),osg::inDegrees( 45.0f ));
    transform
    -> setUpdateCallback(nc);
    transform
    -> addChild(clipnode);
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值