paperjs - How can I combine animations in onFrame? -
my goal make wave segments move bottom of screen top, while animating wave. code i'm using make wave comes paperjs.org:
http://paperjs.org/tutorials/animation/creating-animations/#animating-path-segments
ideally, i'd close path points stay anchored bottom left , right of viewport. can fill wave solid color.
simply add points path before , after for-loop generates evenly distributed segments:
path.add(new point(0, 1) * view.size); // add 5 segment points path spread out // on width of view: (var = 0; <= amount; i++) { path.add(new point(i / amount, 1) * view.size); } path.add(new point(1, 1) * view.size);
this give points anchored bottom of view. account new segments, change loop in onframe function read:
for (var = 1; <= amount+1; i++) {
Comments
Post a Comment