From 6728908d18f1cbd454fbc4f0b2e13bf6442c63fa Mon Sep 17 00:00:00 2001 From: Mike Lynch Date: Tue, 28 May 2024 17:57:11 +1000 Subject: [PATCH] Link scaling --- fourDShape.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fourDShape.js b/fourDShape.js index 3ccc923..bc3bda0 100644 --- a/fourDShape.js +++ b/fourDShape.js @@ -48,8 +48,8 @@ class FourDShape extends THREE.Group { makeLink(basematerial, link) { const n1 = this.nodes3[link.source]; const n2 = this.nodes3[link.target]; - const s1 = n1.scale; - const s2 = n2.scale; + const s1 = this.link_scale * n1.scale; + const s2 = this.link_scale * n2.scale; const length = n1.v3.distanceTo(n2.v3); const centre = new THREE.Vector3(); centre.lerpVectors(n1.v3, n2.v3, 0.5); @@ -65,8 +65,8 @@ class FourDShape extends THREE.Group { updateLink(link, links_show) { const n1 = this.nodes3[link.source]; const n2 = this.nodes3[link.target]; - const s1 = n1.scale; - const s2 = n2.scale; + const s1 = this.link_scale * n1.scale; + const s2 = this.link_scale * n2.scale; const length = n1.v3.distanceTo(n2.v3); const centre = new THREE.Vector3(); centre.lerpVectors(n1.v3, n2.v3, 0.5);