X-Git-Url: http://git.scottworley.com/nt3d/blobdiff_plain/b62906a2c93cdea4456bc8f13d53dc13d37278e6..e06a4a20a8c49061c64714bf718061b5d695ef35:/medusa.html?ds=inline diff --git a/medusa.html b/medusa.html index 7a4babd..9bd3dc7 100644 --- a/medusa.html +++ b/medusa.html @@ -8,10 +8,13 @@ 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 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 finger_progress = finger_point / params.finger_points; + var angle = (finger_angle + twirl_angle * finger_progress) * 2 * Math.PI; + var r = ring_radius; + var x = r * Math.cos(angle); + var y = r * Math.sin(angle); + var z = params.finger_height * finger_progress; + path.push([x, y, z]); } return nt3d.extrude(path, finger_crosssection, [0, 0, 1], nt3d.pathnormals_from_point(path, [0, 0, 0])); }