Subject: Update javascript to be compatible with threejs r111
Forwarded: https://github.com/solvespace/solvespace/pull/906
From: Ryan Pavlik <ryan.pavlik@collabora.com>
Last-Update: 2021-02-11
Applied-Upstream: 3.0.0, https://github.com/solvespace/solvespace/commit/d16e33ac48cb717f24a06a30e268227c860476d2

Date: Tue, 19 Jan 2021 17:22:35 -0600


---
 res/threejs/SolveSpaceControls.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/res/threejs/SolveSpaceControls.js b/res/threejs/SolveSpaceControls.js
index e141ace..ca74fd5 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) {
