]> git.scottworley.com Git - nt3d/blobdiff - cone_primitive.html
Use a params object rather than loose arguments
[nt3d] / cone_primitive.html
index 19a76862796434c7e7ebc362686623b0ae284e42..ef044fd36c8a30b3c0ad48d526a06a27a2337c7c 100644 (file)
@@ -3,12 +3,12 @@
     <title>Cone primitive</title>
     <script type="text/javascript" src="nt3d.js"></script>
     <script type="text/javascript">
     <title>Cone primitive</title>
     <script type="text/javascript" src="nt3d.js"></script>
     <script type="text/javascript">
-      function cone_primitive(height, radius, steps) {
-       return nt3d.cone([0,0,0], [0,0,height], radius, steps);
+      function cone_primitive(params) {
+       return nt3d.cone([0,0,0], [0,0,params.height], params.radius, params.steps);
       }
       }
-      var params = [["Height", 100],
-                    ["Radius", 50],
-                    ["Steps", 30]];
+      var params = [["height", 100],
+                    ["radius", 50],
+                    ["steps", 30]];
     </script>
   </head>
   <body onload="nt3d.framework(cone_primitive, params)">
     </script>
   </head>
   <body onload="nt3d.framework(cone_primitive, params)">