mirror of
https://github.com/storytold/spark.git
synced 2026-10-18 07:40:38 +00:00
adjust camera movement parameters
This commit is contained in:
committed by
Diego Marcos
parent
8d5e8da33d
commit
da03493d11
@@ -27,7 +27,6 @@
|
|||||||
import {
|
import {
|
||||||
ForgeRenderer,
|
ForgeRenderer,
|
||||||
PointerControls,
|
PointerControls,
|
||||||
FpsMovement,
|
|
||||||
SplatMesh,
|
SplatMesh,
|
||||||
VRButton,
|
VRButton,
|
||||||
generators,
|
generators,
|
||||||
@@ -50,8 +49,7 @@
|
|||||||
0.1,
|
0.1,
|
||||||
1000
|
1000
|
||||||
);
|
);
|
||||||
camera.position.set(6, 12, 105.5);
|
camera.position.set(8, 12, 104);
|
||||||
// camera.rotateY((Math.PI));
|
|
||||||
|
|
||||||
const renderer = new THREE.WebGLRenderer();
|
const renderer = new THREE.WebGLRenderer();
|
||||||
renderer.setSize(window.innerWidth, window.innerHeight);
|
renderer.setSize(window.innerWidth, window.innerHeight);
|
||||||
@@ -79,8 +77,7 @@
|
|||||||
scene.add(background);
|
scene.add(background);
|
||||||
await background.initialized;
|
await background.initialized;
|
||||||
|
|
||||||
//const controls = new PointerControls({ canvas: renderer.domElement });
|
const controls = new PointerControls({ canvas: renderer.domElement });
|
||||||
const controls = new FpsMovement({ moveSpeed: 8.0 });
|
|
||||||
|
|
||||||
const cam = camera.position;
|
const cam = camera.position;
|
||||||
const snowVolumeBox = new THREE.Box3(
|
const snowVolumeBox = new THREE.Box3(
|
||||||
@@ -224,8 +221,8 @@
|
|||||||
controls.update(dt, camera);
|
controls.update(dt, camera);
|
||||||
|
|
||||||
// camera movement
|
// camera movement
|
||||||
const targetZ = 99;
|
const targetZ = 91;
|
||||||
const startZ = 105.5;
|
const startZ = 104;
|
||||||
const duration = 90;
|
const duration = 90;
|
||||||
const progress = Math.min(1, t / duration);
|
const progress = Math.min(1, t / duration);
|
||||||
const smoothProgress = Math.sin(progress * Math.PI * 0.5);
|
const smoothProgress = Math.sin(progress * Math.PI * 0.5);
|
||||||
|
|||||||
Reference in New Issue
Block a user