From ad483ced113b112a91f12484845f1ec0cb82f972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=81=E5=86=9C=E9=98=BF=E6=A5=A0?= Date: Tue, 26 May 2026 02:24:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=93=B6=E6=B2=B3=E7=9B=B8?= =?UTF-8?q?=E6=9C=BA=E8=A7=86=E8=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/config.ts | 7 ++++--- src/utils/createTravelScene.ts | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) 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)