Commits

Jason S committed ca176dd

tweaks to animation

Comments (0)

Files changed (2)

demos/pendulum/togif/pendulum.html

     function tick()
     {
         var nop = function(){};
-        pendulum.update(dt*0.5);
+        pendulum.update(dt*0.25);
+        pendulum.update(dt*0.25);
         pendulum.draw(canvas, {backgrounddraw: bkgdfunc, opacity: 0.05});
-        pendulum.update(dt*0.5);
+        pendulum.update(dt*0.25);
+        pendulum.update(dt*0.25);
         pendulum.draw(canvas, {backgrounddraw: nop});
     } 
     var i = 0;
-    var nframes = 1000;
+    var nframes = 1225;
     setInterval(function() {
         tick();
         document.getElementById('count').textContent = ''+i;

demos/pendulum/togif/pendulum.js

     {
         if (etc.coils[which] < 0)
         {
-            etc.coiltorque = etc.coilstrength;
+            etc.coiltorque = which ? etc.coilstrength : -etc.coilstrength;
         }
         else
         {
     etc.damping = 0.01;
     etc.dampingmagnet = 1.25;
     etc.coiltorque = 0;
-    etc.coilstrength = 102;
-    etc.coilcapture = 0.05;
-    etc.coilthreshold = 1;
+    etc.coilstrength = 105;
+    etc.coilcapture = 0.08;
+    etc.coilthreshold = 1.3;
     etc.coils = [0,0];
     etc.showcoils = function(i) { 
         var c = this.coils[i] / this.coilthreshold;