diff --git a/res/CMakeLists.txt b/res/CMakeLists.txt index e261ba21..9152488d 100644 --- a/res/CMakeLists.txt +++ b/res/CMakeLists.txt @@ -284,7 +284,7 @@ add_resources( shaders/edge.frag shaders/edge.vert shaders/outline.vert - threejs/three-r76.js.gz + threejs/three-r111.min.js.gz threejs/hammer-2.0.8.js.gz threejs/SolveSpaceControls.js) diff --git a/res/threejs/SolveSpaceControls.js b/res/threejs/SolveSpaceControls.js index e141acee..ca74fd52 100644 --- a/res/threejs/SolveSpaceControls.js +++ b/res/threejs/SolveSpaceControls.js @@ -470,9 +470,9 @@ solvespace = function(obj, params) { changeBasis.makeBasis(camera.right, camera.up, n); for (var i = 0; i < 2; i++) { - var newLightPos = changeBasis.applyToVector3Array( - [obj.lights.d[i].direction[0], obj.lights.d[i].direction[1], - obj.lights.d[i].direction[2]]); + var newLightPos = new THREE.Vector3(obj.lights.d[i].direction[0], + obj.lights.d[i].direction[1], + obj.lights.d[i].direction[2]).applyMatrix4(changeBasis); directionalLightArray[i].position.set(newLightPos[0], newLightPos[1], newLightPos[2]); } @@ -515,7 +515,7 @@ solvespace = function(obj, params) { } geometry.computeBoundingSphere(); - return new THREE.Mesh(geometry, new THREE.MultiMaterial(materialList)); + return new THREE.Mesh(geometry, materialList); } function createEdges(meshObj) { diff --git a/res/threejs/three-r111.min.js.gz b/res/threejs/three-r111.min.js.gz new file mode 100644 index 00000000..7e6f57f1 Binary files /dev/null and b/res/threejs/three-r111.min.js.gz differ diff --git a/res/threejs/three-r76.js.gz b/res/threejs/three-r76.js.gz deleted file mode 100644 index e2b9ca16..00000000 Binary files a/res/threejs/three-r76.js.gz and /dev/null differ diff --git a/src/export.cpp b/src/export.cpp index f5649b68..c70237e1 100644 --- a/src/export.cpp +++ b/src/export.cpp @@ -956,13 +956,16 @@ void SolveSpaceUI::ExportMeshAsThreeJsTo(FILE *f, const Platform::Path &filename SPointList spl = {}; STriangle *tr; Vector bndl, bndh; + + const std::string THREE_FN("three-r111.min.js"); + const char htmlbegin[] = R"(