From ddc3d4bb111692e9203e6fa876953d23d376fdec Mon Sep 17 00:00:00 2001 From: Sheldan <5037282+Sheldan@users.noreply.github.com> Date: Mon, 1 Apr 2024 12:55:46 +0200 Subject: [PATCH] orbits: fixing label lines not getting hidden anymore when trail is being reset --- orbits/src/js/main.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/orbits/src/js/main.js b/orbits/src/js/main.js index d70fa4b..b3b878b 100644 --- a/orbits/src/js/main.js +++ b/orbits/src/js/main.js @@ -54,19 +54,10 @@ function animate() { } function resetTrail(sphereConfig) { - const textMesh = sphereConfig.text; sphereConfig.line.material.dispose(); sphereConfig.line.geometry.dispose(); sphereConfig.group.remove(sphereConfig.line) scene.remove(sphereConfig.line) - const labelLine = []; - labelLine.push(new THREE.Vector3(textMesh.position.x, textMesh.position.y, textMesh.position.z)); - labelLine.push(new THREE.Vector3(0, 0, 0)); - const lineMaterial = new THREE.LineBasicMaterial({color: sphereConfig.sphereColor}); - const lineGeometry = new THREE.BufferGeometry().setFromPoints(labelLine); - sphereConfig.line = new THREE.Line(lineGeometry, lineMaterial); - ; - sphereConfig.group.add(sphereConfig.line); } function reset() { @@ -85,7 +76,6 @@ function reset() { resetTrail(sphereConfig); }) lines = {} - } function render() { @@ -94,9 +84,9 @@ function render() { } function formatDateTime(input) { - var epoch = new Date(0); + let epoch = new Date(0); epoch.setSeconds(parseInt(input)); - var date = epoch.toISOString(); + let date = epoch.toISOString(); date = date.replace('T', ' '); return date.split('.')[0].split(' ')[0]; }