From ba10da785a538bb41b08a7b5d2fbb32b7e19b1af Mon Sep 17 00:00:00 2001 From: Rayzeq Date: Fri, 2 Jul 2021 14:59:02 +0200 Subject: [PATCH] Fix rotating animation + More optimization --- modules/ui/3d.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/ui/3d.js b/modules/ui/3d.js index 898e02f2..b3dd5248 100644 --- a/modules/ui/3d.js +++ b/modules/ui/3d.js @@ -97,11 +97,9 @@ const setSun = function(x, y, z) { } const setRotation = function(speed) { - cancelAnimationFrame(animationFrame); if (options.isGlobe) options.rotateGlobe = speed; else options.rotateMesh = speed; controls.autoRotateSpeed = speed; controls.autoRotate = Boolean(controls.autoRotateSpeed); - if (controls.autoRotate) animate(); } const toggleSky = function() { @@ -267,8 +265,8 @@ async function createLabels() { const citie_icon_material = new THREE.MeshBasicMaterial({color: cities_icons.attr('fill')}); const town_icon_material = new THREE.MeshBasicMaterial({color: towns_icons.attr('fill')}); - const citie_icon_geometry = new THREE.SphereGeometry(cities_icons.attr("size") * 2, 16, 16); - const town_icon_geometry = new THREE.SphereGeometry(towns_icons.attr("size") * 2, 16, 16); + const citie_icon_geometry = new THREE.SphereGeometry(cities_icons.attr("size") * 2, 8, 8); + const town_icon_geometry = new THREE.SphereGeometry(towns_icons.attr("size") * 2, 8, 8); for (const burg of pack.burgs) { const [x, y, z] = get3dCoords(burg.x, burg.y)