From 90337ae1ff5017172494dbbe586bc9bb91bbcb55 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Sat, 8 May 2021 12:09:42 +0100 Subject: [PATCH] Update javascript to be compatible with threejs r111 Forwarded: https://github.com/solvespace/solvespace/pull/906 Last-Update: 2021-02-11 Applied-Upstream: 3.0.0, https://github.com/solvespace/solvespace/commit/d16e33ac48cb717f24a06a30e268227c860476d2 Gbp-Pq: Name 11_update_js_three_r111.patch --- 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) { -- 2.30.2