diff --git a/src/constants/config.ts b/src/constants/config.ts index 58bb330..9bcca11 100644 --- a/src/constants/config.ts +++ b/src/constants/config.ts @@ -67,10 +67,11 @@ export const APP_CONFIG = { // Background galaxy rendered as layered shader fog instead of dense point clouds. galaxy: { zPosition: -40, - width: 72, - height: 48, + width: 84, + height: 56, tiltX: Math.PI * 0.35, - tiltY: Math.PI * 0.15, + tiltY: Math.PI * 0.08, + tiltZ: Math.PI * -0.15, palette: { coreWhite: '#ffffff', coreGold: '#ffd36b', diff --git a/src/utils/createTravelScene.ts b/src/utils/createTravelScene.ts index 4d42e7d..cfb54ac 100644 --- a/src/utils/createTravelScene.ts +++ b/src/utils/createTravelScene.ts @@ -469,6 +469,7 @@ export function createTravelScene(container: HTMLElement): TravelSceneController galaxyGroup.position.z = APP_CONFIG.galaxy.zPosition galaxyGroup.rotation.x = APP_CONFIG.galaxy.tiltX galaxyGroup.rotation.y = APP_CONFIG.galaxy.tiltY + galaxyGroup.rotation.z = APP_CONFIG.galaxy.tiltZ scene.add(galaxyGroup) const galaxyGeometry = new THREE.PlaneGeometry(APP_CONFIG.galaxy.width, APP_CONFIG.galaxy.height, 1, 1) @@ -844,9 +845,12 @@ export function createTravelScene(container: HTMLElement): TravelSceneController travelRoot.position.y = -viewY * 1.0 // 加大相机的偏移幅度和观察点偏移 + // 增加一点默认偏移,让相机的中心略微向左上,从而使画面整体偏向右下,填补空旷 + const baseLookX = -3.0 + const baseLookY = 5.0 camera.position.x = viewX * APP_CONFIG.interaction.maxOffset * 4.5 camera.position.y = viewY * APP_CONFIG.interaction.maxOffset * 3.0 - camera.lookAt(viewX * 2.5, viewY * 1.5, -30) + camera.lookAt(baseLookX + viewX * 2.5, baseLookY + viewY * 1.5, -30) renderer.render(scene, camera) animationFrameId = window.requestAnimationFrame(render)