three.js中TWEEN动画的使用

github tween源码及使用说明

	var targetPos = orbit.target;
	var targetZoom = orbit.object;
	
	tweenRotationOrbit = new TWEEN.Tween(targetPos).to({
				x:54,y:0,z:6}, 1500
			).easing(TWEEN.Easing.Linear.None).onUpdate(function(){
				targetPos.x = this.x;
				targetPos.y = this.y;
				targetPos.z = this.z;
				orbit.update();
			}).onComplete(function(){
				orbit.target.set(54,0,6);
			});
	
	tweenZoomCamera = new TWEEN.Tween(targetZoom).to({zoom: 6}, 1000
		).easing(TWEEN.Easing.Linear.None).onUpdate(function(){
				orbit.object.zoom = this.zoom;
				orbit.object.updateProjectionMatrix();
			}).onComplete(function(){
				orbit.object.zoom = 6;
			});
	//设定执行顺序,不然会将两个动画同时执行
	tweenRotationOrbit.chain(tweenZoomCamera);
	tweenRotationOrbit.start();

针对Blender中导出的cube进行形变时(morph)…待续

//找到你要进行形变的那个mesh,需要设置可以进行形变

	mesh.material.morphTargets = true;
	

猜你喜欢

转载自blog.csdn.net/u013270347/article/details/84328961