]> git.scottworley.com Git - nt3d/commitdiff
Name finger_point / params.finger_points
authorScott Worley <scottworley@scottworley.com>
Tue, 27 May 2014 03:37:59 +0000 (20:37 -0700)
committerScott Worley <scottworley@scottworley.com>
Tue, 27 May 2014 03:37:59 +0000 (20:37 -0700)
medusa.html

index 7a4babd9e69a8eaca8940dd1a4c998c694e6f091..0576312144c3a38931b80f89f473e9a943138b7d 100644 (file)
@@ -8,10 +8,11 @@
         var twirl_amplitute = Math.cos((ring_num * 2 * Math.PI) / params.finger_twirl_period);
         var twirl_angle = twirl_amplitute * params.finger_twirl_distance / (ring_radius * 2 * Math.PI);
         for (var finger_point = 0; finger_point <= params.finger_points; finger_point++) {
-          var angle = (finger_angle + twirl_angle * finger_point / params.finger_points) * 2 * Math.PI;
+          var finger_progress = finger_point / params.finger_points;
+          var angle = (finger_angle + twirl_angle * finger_progress) * 2 * Math.PI;
           var x = ring_radius * Math.cos(angle);
           var y = ring_radius * Math.sin(angle);
-          path.push([x, y, params.finger_height * finger_point / params.finger_points]);
+          path.push([x, y, params.finger_height * finger_progress]);
         }
         return nt3d.extrude(path, finger_crosssection, [0, 0, 1], nt3d.pathnormals_from_point(path, [0, 0, 0]));
       }