mirror of
https://github.com/storytold/spark.git
synced 2026-10-21 08:06:45 +00:00
fix speed on camera movment (final fix)
This commit is contained in:
committed by
Diego Marcos
parent
cdf7b02838
commit
8da970b4f4
@@ -221,7 +221,7 @@
|
|||||||
// camera movement
|
// camera movement
|
||||||
const targetZ = 90.5;
|
const targetZ = 90.5;
|
||||||
const startZ = 104;
|
const startZ = 104;
|
||||||
const duration = 9;
|
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);
|
||||||
camera.position.z = startZ + (targetZ - startZ) * smoothProgress;
|
camera.position.z = startZ + (targetZ - startZ) * smoothProgress;
|
||||||
|
|||||||
Reference in New Issue
Block a user