Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 三个JS之间的JS不平滑_Javascript_Three.js_Tween - Fatal编程技术网

Javascript 三个JS之间的JS不平滑

Javascript 三个JS之间的JS不平滑,javascript,three.js,tween,Javascript,Three.js,Tween,我在三个JS上使用TWEEN,面临平滑问题 当我把吐温数从1变为2时,我得到这个数: 你可以看到数字有时会被超越。这样可以防止动画平滑 这是我的场景动画配置: function animate() { requestAnimationFrame( animate ); render(); controls.update(); TWEEN.update(); stats.update();

我在三个JS上使用TWEEN,面临平滑问题

当我把吐温数从1变为2时,我得到这个数:

你可以看到数字有时会被超越。这样可以防止动画平滑

这是我的场景动画配置:

function animate() { 
          requestAnimationFrame( animate );
          render();
          controls.update();
          TWEEN.update();
          stats.update();      
    }

    function render() {      
          renderer.clear();
          renderer.render( scene, camera );
          updateHUDSprites ();
          renderer.clearDepth();
          renderer.render( sceneOrtho, cameraOrtho );                                                           
    }
吐温函数:

  var lineTween = new TWEEN.Tween({value:1}).to({value:1000},100).easing(TWEEN.Easing.Linear.None).onStart(function(){

  }).onUpdate(function () {
             console.log(this.value);  
  }).onComplete(function () {

  }).start(); 

专家们对此有经验吗?为什么会这样?

您的帧速率足够高吗?可能问题在于性能,而不是tween Library你的tween是什么。放松功能60,意味着最大始终,场景是平滑的,移动相机时也是如此。将tween功能添加到问题@gaitatProblem solved我启动了两次功能。上下再上。谢谢。