diff --git a/js/BufferGeometryToGeometry.js b/js/BufferGeometryToGeometry.js index 46303c0..d7fcb42 100644 --- a/js/BufferGeometryToGeometry.js +++ b/js/BufferGeometryToGeometry.js @@ -1,5 +1,7 @@ -var toGeometry = function (bg) { - // The following snipped is from Mattatz - Masatatsu Nakamura http://mattatz.org +var Converter = {}; + +Converter.toGeometry = function (bg) { + // The following snippet is from Mattatz - Masatatsu Nakamura http://mattatz.org var attrib = bg.getAttribute('position'); if(attrib === undefined) { throw new Error('a given BufferGeometry object must have a position attribute.'); diff --git a/scene/js/main.js b/scene/js/main.js index 333555a..e237133 100644 --- a/scene/js/main.js +++ b/scene/js/main.js @@ -139,7 +139,7 @@ function loadScene() { child.translateY(positions[i].y); child.translateZ(positions[i].z); new_id = child.id; - child.geometry = toGeometry(child.geometry); + child.geometry = Converter.toGeometry(child.geometry); child.geometry.mergeVertices(); child.geometry.computeFaceNormals(); child.geometry.computeVertexNormals();