4 <script type=
"text/javascript" src=
"nt3d.js"></script>
5 <script type=
"text/javascript">
6 function medusa(base_ring_radius, num_fingers, finger_radius, finger_faces, finger_points, finger_twirl, finger_height) {
7 var finger_crosssection = nt3d.circle(finger_radius, finger_faces);
9 for (var finger_num =
0; finger_num < num_fingers; finger_num++) {
10 var finger_angle = finger_num / num_fingers;
12 for (var finger_point =
0; finger_point <= finger_points; finger_point++) {
13 var angle = (finger_angle + finger_twirl * finger_point / finger_points) *
2 * Math.PI;
14 var x = base_ring_radius * Math.cos(angle);
15 var y = base_ring_radius * Math.sin(angle);
16 path.push([x, y, finger_height * finger_point / finger_points]);
18 var finger = nt3d.extrude(path, finger_crosssection, [
0,
0,
1], nt3d.pathnormals_from_point(path, [
0,
0,
0]));
19 fingers = fingers.concat(finger);
24 var params = [["Base ring radius",
100],
25 ["Number of fingers",
5],
28 ["Finger points",
20],
29 ["Finger twirl (in turns)",
.1],
30 ["Finger height",
100]];
33 <body onload=
"nt3d.framework(medusa, params)">
35 <p>An artsy thing.
</p>