diff --git a/diplomacy/animation/assets/maps/standard.svg b/diplomacy/animation/assets/maps/standard.svg index 25e25a4..7984346 100644 --- a/diplomacy/animation/assets/maps/standard.svg +++ b/diplomacy/animation/assets/maps/standard.svg @@ -93,57 +93,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - @@ -227,95 +213,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/diplomacy/animation/simple-test.html b/diplomacy/animation/simple-test.html index 81c4f0e..2708101 100644 --- a/diplomacy/animation/simple-test.html +++ b/diplomacy/animation/simple-test.html @@ -576,6 +576,16 @@ } // This rotates the SVG the "correct" way round, and scales it down group.scale.set(0.5, -0.5, 0.5) + // After adding all meshes to the group, update its matrix: + group.updateMatrixWorld(true); + + // Compute the bounding box of the group: + const box = new THREE.Box3().setFromObject(group); + const center = new THREE.Vector3(); + box.getCenter(center); + + // Offset the group's position by subtracting the center: + group.position.sub(center); scene.add(group); },