简体   繁体   English

使用Animation webgl three.js缩放立方体Y

[英]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. Webgl Three.js补间和Java脚本我从补间的对象的x或y属性获得了意外的结果,我没有错误,并且该对象正在缩放但没有动画。

 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. 我试图通过动画使立方体伸展到正确的高度,但是目前它只是直接捕捉到缩放比例y。

您应该像这样在Tween中使用整个对象

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM