KineticJS HTML5 Canvas Harmonic Oscillator

时间:2014-02-23 05:40:17

标签: javascript html5 canvas kineticjs physics

我想使用KineticS制作similar thing。但只有这样的事情 - http://codepen.io/anon/pen/CptLd。你能帮帮我吗?

1 个答案:

答案 0 :(得分:0)

var anim = new Kinetic.Animation(function(frame) {
  var scale = Math.abs(0.5 * (Math.sin(2* Math.PI * frame.time / 3000) + 1.5));
  weight.setY(200 * scale + 40);
  spline.scale({y:scale});
}, layer);

http://codepen.io/anon/pen/nraLo