优化银河相机视角
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.
|
// Background galaxy rendered as layered shader fog instead of dense point clouds.
|
||||||
galaxy: {
|
galaxy: {
|
||||||
zPosition: -40,
|
zPosition: -40,
|
||||||
width: 72,
|
width: 84,
|
||||||
height: 48,
|
height: 56,
|
||||||
tiltX: Math.PI * 0.35,
|
tiltX: Math.PI * 0.35,
|
||||||
tiltY: Math.PI * 0.15,
|
tiltY: Math.PI * 0.08,
|
||||||
|
tiltZ: Math.PI * -0.15,
|
||||||
palette: {
|
palette: {
|
||||||
coreWhite: '#ffffff',
|
coreWhite: '#ffffff',
|
||||||
coreGold: '#ffd36b',
|
coreGold: '#ffd36b',
|
||||||
|
|||||||
@@ -469,6 +469,7 @@ export function createTravelScene(container: HTMLElement): TravelSceneController
|
|||||||
galaxyGroup.position.z = APP_CONFIG.galaxy.zPosition
|
galaxyGroup.position.z = APP_CONFIG.galaxy.zPosition
|
||||||
galaxyGroup.rotation.x = APP_CONFIG.galaxy.tiltX
|
galaxyGroup.rotation.x = APP_CONFIG.galaxy.tiltX
|
||||||
galaxyGroup.rotation.y = APP_CONFIG.galaxy.tiltY
|
galaxyGroup.rotation.y = APP_CONFIG.galaxy.tiltY
|
||||||
|
galaxyGroup.rotation.z = APP_CONFIG.galaxy.tiltZ
|
||||||
scene.add(galaxyGroup)
|
scene.add(galaxyGroup)
|
||||||
|
|
||||||
const galaxyGeometry = new THREE.PlaneGeometry(APP_CONFIG.galaxy.width, APP_CONFIG.galaxy.height, 1, 1)
|
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
|
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.x = viewX * APP_CONFIG.interaction.maxOffset * 4.5
|
||||||
camera.position.y = viewY * APP_CONFIG.interaction.maxOffset * 3.0
|
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)
|
renderer.render(scene, camera)
|
||||||
animationFrameId = window.requestAnimationFrame(render)
|
animationFrameId = window.requestAnimationFrame(render)
|
||||||
|
|||||||
Reference in New Issue
Block a user