diff --git a/js/globe.js b/js/globe.js index 706a2c9..9710259 100644 --- a/js/globe.js +++ b/js/globe.js @@ -75,13 +75,9 @@ waitForGlobeReady: true, animateIn: true, }) - // 夜间地球 + 地形凹凸贴图(使用 three-globe 示例贴图) - .globeImageUrl( - "https://unpkg.com/three-globe/example/img/earth-night.jpg" - ) - .bumpImageUrl( - "https://unpkg.com/three-globe/example/img/earth-topology.png" - ) + // 不使用外部贴图,改用自定义材质,避免贴图加载或权限问题导致地球不可见 + .globeImageUrl(null) + .bumpImageUrl(null) .showAtmosphere(true) .atmosphereColor("#2b9fff") .atmosphereAltitude(0.18) @@ -108,22 +104,27 @@ scene.add(globe); // 放大地球整体,让主体更突出 - globe.scale.set(1.3, 1.3, 1.3); + globe.scale.set(1.4, 1.4, 1.4); - // 调整地球材质,使底色稍微亮一点,避免在浅色背景下看不清 + // 自定义地球材质,使用渐变蓝色球体,避免依赖贴图 try { var globeMat = globe.globeMaterial && globe.globeMaterial(); if (globeMat) { - globeMat.color = new THREE.Color("#133b74"); - globeMat.emissive = new THREE.Color("#020b18"); - globeMat.specular = new THREE.Color("#3aaefc"); - globeMat.shininess = 45; + globeMat.color = new THREE.Color("#163a5f"); // 基础色 + globeMat.emissive = new THREE.Color("#061727"); // 自发光 + globeMat.specular = new THREE.Color("#3aaefc"); // 高光 + globeMat.shininess = 40; globeMat.needsUpdate = true; } } catch (e) { console.warn("[Globe] failed to tweak globe material:", e); } + // 暴露给调试用 + if (typeof window !== "undefined") { + window.__globe = globe; + } + // 星辰背景(简单加一点点空间感) var starGeometry = new THREE.BufferGeometry(); var starCount = 600;