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