My code is :
function move(){
var A = new TWEEN.Tween(meshA.position).to({ z: -10 }, 2000).start();
var B = new TWEEN.Tween(meshB.rotation).to({ z: Math.PI }, 2000);
var C = new TWEEN.Tween(meshC.position).to({ x: 10 }, 2000);
A.chain(B);
B.chain(C);
C.chain(A);
animate();
}
But, how to code if I want start multiple tween's simultaneous. (A and B move together then C).
My code is :
function move(){
var A = new TWEEN.Tween(meshA.position).to({ z: -10 }, 2000).start();
var B = new TWEEN.Tween(meshB.rotation).to({ z: Math.PI }, 2000);
var C = new TWEEN.Tween(meshC.position).to({ x: 10 }, 2000);
A.chain(B);
B.chain(C);
C.chain(A);
animate();
}
But, how to code if I want start multiple tween's simultaneous. (A and B move together then C).
Share Improve this question asked Apr 4, 2016 at 13:14 Treize CinqTreize Cinq 4251 gold badge5 silver badges16 bronze badges 2- 1 Try with the github./CreateJS/TweenJS CreateJs Tween the advantage of this normal tween library with wrapper function. I used in my project this is cool – Ajit kohir Commented Apr 4, 2016 at 17:15
- I'm looking, Thks Stallion – Treize Cinq Commented Apr 5, 2016 at 5:47
1 Answer
Reset to default 5To animate A and B together, then C :
function move(){
var A = new TWEEN.Tween(meshA.position).to({ z: -10 }, 2000)
.onStart(function(){
new TWEEN.Tween(meshB.rotation).to({ z: Math.PI }, 2000).start();
}).start();
var C = new TWEEN.Tween(meshC.position).to({ x: 10 }, 2000);
A.chain(C);
C.chain(A);
animate();
}
Et voilà !
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745543678a4632241.html
评论列表(0条)