stlviewer.js

changeset 19
32de35694e56
parent 18
ff1941c85fd3
--- a/stlviewer.js	Thu Apr 06 16:21:21 2017 +0200
+++ b/stlviewer.js	Thu Apr 06 17:18:24 2017 +0200
@@ -33,6 +33,10 @@
     });
     update_scene();
 
+    $(".listcontainer")
+        .mouseout(function() {controls.enabled = true})
+        .mouseover(function() {controls.enabled = false});
+
     $("#image2d").click(function() {
         var img = $("#image2d").clone();
         //img.css('width', '100%');
@@ -108,7 +112,7 @@
                     volume += obj[4][2];
                     if (obj[4][1] > length) length = obj[4][1];
                 }
-                position = [data.scale3d * 0.01 * obj[0], 0, 0];
+                position = [data.scale3d * 0.01 * (obj[0] - data.offset), 0, 0];
                 loadSTL(filename, material + "", position);
                 content += "</li>"
             }

mercurial