]> git.scottworley.com Git - nt3d/commitdiff
Twirl a fixed distance; inner rings twirl tighter
authorScott Worley <scottworley@scottworley.com>
Sun, 25 May 2014 08:15:34 +0000 (01:15 -0700)
committerScott Worley <scottworley@scottworley.com>
Sun, 25 May 2014 08:15:34 +0000 (01:15 -0700)
medusa.html

index da807f59dfb59624d51b7319886f79d019d631c6..87e9301b9d7723652f06a77ea3e425b74e9a59d9 100644 (file)
@@ -5,8 +5,10 @@
     <script type="text/javascript">
       function finger(params, finger_crosssection, ring_radius, finger_angle) {
         var path = [];
     <script type="text/javascript">
       function finger(params, finger_crosssection, ring_radius, finger_angle) {
         var path = [];
+        var twirl_angle = params.finger_twirl_distance / (ring_radius * 2 * Math.PI);
+        console.log(twirl_angle);
         for (var finger_point = 0; finger_point <= params.finger_points; finger_point++) {
         for (var finger_point = 0; finger_point <= params.finger_points; finger_point++) {
-          var angle = (finger_angle + params.finger_twirl * finger_point / params.finger_points) * 2 * Math.PI;
+          var angle = (finger_angle + twirl_angle * finger_point / params.finger_points) * 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]);
           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]);
@@ -34,7 +36,7 @@
                     ["finger_radius", 3],
                     ["finger_faces", 3],
                     ["finger_points", 20],
                     ["finger_radius", 3],
                     ["finger_faces", 3],
                     ["finger_points", 20],
-                    ["finger_twirl", .1, "Finger Twirl (in turns)"],
+                    ["finger_twirl_distance", 50],
                     ["finger_height", 100]];
     </script>
   </head>
                     ["finger_height", 100]];
     </script>
   </head>