优化银河相机视角
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user