Search code examples
javascriptthree.jswebgltween

scale cube Y with Animation webgl three.js


Webgl Three.js tween and java script Im getting unexpected results from Tween the x or y property of an object, i have no errors and the object is scaling but with out animation.

 var scale = {y:0};         
 var tween = new TWEEN.Tween( cube.scale.y ).to( { y: 10 }, 3000 ).easing(
 TWEEN.Easing.Cubic.Out ).start();

im trying to get the cube to stretch to the right height with the animation, but currently it just snaps straight to the scale-y.


Solution

  • You should use the whole object in Tween, like this

    new TWEEN.Tween( cube.scale ).to( { y: 10 }, 3000 )