javascript - Following a custom path in TweenJs - Stack Overflow

i'm trying to design a simple animation with TweenJs.. Lets consider two people playing throwing

i'm trying to design a simple animation with TweenJs.. Lets consider two people playing throwing ball. I've managed to move the ball in a linear path. But it has to seem realistic. Ball should follow a curvy path like there is gravity.. How can i define "checkpoints" in the path? Or should i change my tactic to achive that goal? Thanks in advance..

i'm trying to design a simple animation with TweenJs.. Lets consider two people playing throwing ball. I've managed to move the ball in a linear path. But it has to seem realistic. Ball should follow a curvy path like there is gravity.. How can i define "checkpoints" in the path? Or should i change my tactic to achive that goal? Thanks in advance..

Share Improve this question asked Mar 11, 2013 at 13:33 DonkeyKongDonkeyKong 8181 gold badge10 silver badges24 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

The recently released TweenJS (Version 0.4.0, Feb 12, 2013) contains a MotionGuidePlugin. The usage is pretty simple:


// Using a Motion Guide
createjs.Tween.get(target).to({guide:{ path:[0,0, 0,200,200,200, 200,0,0,0] }},7000);
// Visualizing the line
graphics.moveTo(0,0).curveTo(0,200,200,200).curveTo(200,0,0,0);

Here is a quick fiddle: http://jsfiddle/lannymcnie/qEYD4/1/

More info in the docs. http://www.createjs./Docs/TweenJS/classes/MotionGuidePlugin.html

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745267737a4619559.html

相关推荐

  • javascript - Following a custom path in TweenJs - Stack Overflow

    i'm trying to design a simple animation with TweenJs.. Lets consider two people playing throwing

    5小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信