mirror of
https://github.com/Sheldan/canvas.git
synced 2026-01-27 03:47:40 +00:00
orbits: fixing label lines not getting hidden anymore when trail is being reset
This commit is contained in:
@@ -54,19 +54,10 @@ function animate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function resetTrail(sphereConfig) {
|
function resetTrail(sphereConfig) {
|
||||||
const textMesh = sphereConfig.text;
|
|
||||||
sphereConfig.line.material.dispose();
|
sphereConfig.line.material.dispose();
|
||||||
sphereConfig.line.geometry.dispose();
|
sphereConfig.line.geometry.dispose();
|
||||||
sphereConfig.group.remove(sphereConfig.line)
|
sphereConfig.group.remove(sphereConfig.line)
|
||||||
scene.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() {
|
function reset() {
|
||||||
@@ -85,7 +76,6 @@ function reset() {
|
|||||||
resetTrail(sphereConfig);
|
resetTrail(sphereConfig);
|
||||||
})
|
})
|
||||||
lines = {}
|
lines = {}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function render() {
|
function render() {
|
||||||
@@ -94,9 +84,9 @@ function render() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function formatDateTime(input) {
|
function formatDateTime(input) {
|
||||||
var epoch = new Date(0);
|
let epoch = new Date(0);
|
||||||
epoch.setSeconds(parseInt(input));
|
epoch.setSeconds(parseInt(input));
|
||||||
var date = epoch.toISOString();
|
let date = epoch.toISOString();
|
||||||
date = date.replace('T', ' ');
|
date = date.replace('T', ' ');
|
||||||
return date.split('.')[0].split(' ')[0];
|
return date.split('.')[0].split(' ')[0];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user