1

Im using TWEEN on THREE JS https://github.com/sole/tween.js/ and facing smooth problem.

when i pot tween number from 1 to 2 i get this numbers:

enter image description here

You can see numbers are sometimes overtaken. That prevent to have smooth animations.

This is my scene animation config:

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 );                                                           
    }

TWEEN function:

  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(); 

Is the some experience with this? Why can it be?

5
  • 1
    Is your frame rate high enough ? May be the problem is about performance and not the tween library
    – vals
    Dec 15, 2014 at 16:57
  • 1
    what is your TWEEN.Easing function
    – gaitat
    Dec 15, 2014 at 17:01
  • its 60, means the max always, scene is smooth, the same when moving camera
    – Martin
    Dec 15, 2014 at 17:01
  • added tween function to question @gaitat
    – Martin
    Dec 15, 2014 at 17:05
  • Problem solved I launched function twice. OnmouseDown and OnmouseUp again. THX.
    – Martin
    Dec 15, 2014 at 17:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.