refactor: 提取地球坐标常量到EARTH_CONFIG
- 添加tilt、chinaLat、chinaLon、latCoefficient等常量 - earth.js和controls.js使用常量替代硬编码 - 离开地球时隐藏tooltip
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// earth.js - 3D Earth creation module
|
||||
|
||||
import * as THREE from 'three';
|
||||
import { CONFIG } from './constants.js';
|
||||
import { CONFIG, EARTH_CONFIG } from './constants.js';
|
||||
import { latLonToVector3 } from './utils.js';
|
||||
|
||||
export let earth = null;
|
||||
@@ -22,9 +22,9 @@ export function createEarth(scene) {
|
||||
opacity: 0.8,
|
||||
side: THREE.DoubleSide
|
||||
});
|
||||
|
||||
|
||||
earth = new THREE.Mesh(geometry, material);
|
||||
earth.rotation.x = 23.5 * Math.PI / 180;
|
||||
earth.rotation.x = EARTH_CONFIG.tiltRad;
|
||||
scene.add(earth);
|
||||
|
||||
const textureUrls = [
|
||||
|
||||
Reference in New Issue
Block a user