4 <script type=
"text/javascript" src=
"nt3d.js"></script>
5 <script type=
"text/javascript">
6 function medusa(params) {
7 var finger_crosssection = nt3d.circle(params.finger_radius, params.finger_faces);
9 for (var ring_num =
0; ring_num < params.num_rings; ring_num++) {
10 var ring_radius = params.first_ring_radius + ring_num * params.ring_spacing;
11 for (var finger_num =
0; finger_num < params.num_fingers; finger_num++) {
12 var finger_angle = finger_num / params.num_fingers;
14 for (var finger_point =
0; finger_point <= params.finger_points; finger_point++) {
15 var angle = (finger_angle + params.finger_twirl * finger_point / params.finger_points) *
2 * Math.PI;
16 var x = ring_radius * Math.cos(angle);
17 var y = ring_radius * Math.sin(angle);
18 path.push([x, y, params.finger_height * finger_point / params.finger_points]);
20 var finger = nt3d.extrude(path, finger_crosssection, [
0,
0,
1], nt3d.pathnormals_from_point(path, [
0,
0,
0]));
21 fingers = fingers.concat(finger);
27 var params = [["first_ring_radius",
20],
29 ["ring_spacing",
10, "Space Between Rings"],
33 ["finger_points",
20],
34 ["finger_twirl",
.1, "Finger Twirl (in turns)"],
35 ["finger_height",
100]];
38 <body onload=
"nt3d.framework(medusa, params)">
40 <p>An artsy thing.
</p>