• three.js帧动画


    three.js帧动画

    直接上代码,有疑惑请加群讨论:1047907561

            var mixer,
            var posTrack = new THREE.KeyframeTrack(
                  "Build.position",
                  [0, 20],
                  [0, 0, 0, -100, 0, 0]//前三个为起始位置,后三个为移动后的位置
                );
                var scaleTrack = new THREE.KeyframeTrack(
                  "Floor.scale",
                  [0, 1],
                  [2, 2, 2, 5, 5, 5]  //前三个值为起始值大小,后面为放大后的值
                );
                var clip = new THREE.AnimationClip("default", 1, [
                   posTrack,scaleTrack
                ]);
                mixer = new THREE.AnimationMixer(mesh);//里面的值为需要做动画的对象
                var AnimationAction = mixer.clipAction(clip);
                AnimationAction.timeScale = 5; //默认1,可以调节播放速度
                    AnimationAction.loop = THREE.LoopOnce;
                AnimationAction.clampWhenFinished = true;
                AnimationAction.time = 0;
                clip.duration = 1;
                AnimationAction5.play();


            function render(){
      

                   var time = clock.getDelta();
                        if (mixer) {
                          mixer.update(time);
                     }

            }

  • 相关阅读:
    【转】angular通过$http与服务器通信
    【转】Angular运行原理揭秘 Part 1
    【转】 定义模板和服务
    【转】angular Ajax请求
    【转】AngularJS路由和模板
    算法之美--2.2 Array
    算法之美--2.2数组
    人工神经网络--ANN
    AVL树原理及实现 +B树
    学习计划 2016//11//28
  • 原文地址:https://www.cnblogs.com/yaosusu/p/14094225.html
Copyright © 2020-2023  润新知