Canvas Three.js-设置对象大小动画

Canvas Three.js-设置对象大小动画,canvas,jquery-animate,three.js,Canvas,Jquery Animate,Three.js,我一直在学习这个教程:(或者只是复制和粘贴它)。它工作得非常好(我认为只有FF),但对于我的“项目”,我需要设置圆柱体大小的动画。如何做到这一点 旋转的动画如下所示: three.cylinder.rotation.x += angleChange; 我试过几种方法,如size.height,height,scale.height,scale[0]等等,但我找不到正确的函数 有人知道如何实现这一点吗?在animate()函数中,尝试以下操作: three.cylinder.scale.set(

我一直在学习这个教程:(或者只是复制和粘贴它)。它工作得非常好(我认为只有FF),但对于我的“项目”,我需要设置圆柱体大小的动画。如何做到这一点

旋转的动画如下所示:

three.cylinder.rotation.x += angleChange;
我试过几种方法,如
size.height
height
scale.height
scale[0]
等等,但我找不到正确的函数

有人知道如何实现这一点吗?

animate()
函数中,尝试以下操作:

three.cylinder.scale.set( 1, Math.abs( Math.sin( time * 0.0002 ) ), 1 );
这将缩放内部y尺寸,并保持x和z尺寸不变。由于圆柱体的方向,在本例中,y尺寸是长度。

animate()
函数中,请尝试以下操作:

three.cylinder.scale.set( 1, Math.abs( Math.sin( time * 0.0002 ) ), 1 );

这将缩放内部y尺寸,并保持x和z尺寸不变。由于圆柱体的方向,在这种情况下,y尺寸是长度。

为了简单起见:
three.cylinder.scale.y=Math.abs(Math.sin(time*0.0002))即使将“时间”定义为一个数字,动画也是即时的。此外,为了简单起见:
three.cylinder.scale.y=Math.abs(Math.sin(time*0.0002))即使将“时间”定义为数字,动画也是即时的。