开发者

raphael.js animation problem: animate only certain points of a path

i created a sketchy cloud generator here. Every arc of the cloud is generated randomly apart from the first and the last one that are fixed.

I want the shape of the cloud to change slowly so I created an animation the take a newly generated path every time is called.

The problem is that during the interpolation bet开发者_开发百科ween the old and the new path sometimes also the last point move, while it shouldn't.

What can i do to be sure that the first and the last point don't move?


Wow, your cloud animation looks really good. I'm not quite sure how the Raphael animation function works, but I suspect the problem results from how Raphael moves between two paths with different numbers of coordinates.

You can sort of get around the problem by moving the final z (closing the shape) and manually drawing a line between those points (make sure this line isn't part of the animation). Another possibility would be make sure that there's the same number of coordinates in the path if you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜