mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
feat(director): add authored camera directions and anchors
This commit is contained in:
1 parent
0ea10468ea
commit
13c0b8d1bc
24 files changed
+1104
-167
No files matched your search
@@ -1,3 +1,9 @@
|
||||
import {
|
||||
resolveCameraPose,
|
||||
resolveCameraMove,
|
||||
sampleCameraMove,
|
||||
} from './camera.js';
|
||||
|
||||
const DEFAULT_SHOT_DURATION_SEC = 4;
|
||||
const clamp01 = (value) => Math.max(0, Math.min(1, value));
|
||||
|
||||
@@ -78,7 +84,12 @@ export function sceneSeekState(scene, progress, durationForShot, holdForShot) {
|
||||
const holdElapsedSec = Math.max(0, shotElapsedSec - flightDurationSec);
|
||||
const holdProgress =
|
||||
holdDurationSec > 0 ? clamp01(holdElapsedSec / holdDurationSec) : 1;
|
||||
const previousCamera = scene.shots[shotIndex - 1]?.camera || shot.camera;
|
||||
const targetCamera = resolveCameraPose(scene, shot.camera);
|
||||
const previousCamera = resolveCameraPose(
|
||||
scene,
|
||||
scene.shots[shotIndex - 1]?.camera || shot.camera,
|
||||
);
|
||||
const move = resolveCameraMove(scene, shot);
|
||||
return {
|
||||
sceneProgress: totalSec > 0 ? targetSec / totalSec : 0,
|
||||
sceneElapsedSec: targetSec,
|
||||
@@ -92,6 +103,8 @@ export function sceneSeekState(scene, progress, durationForShot, holdForShot) {
|
||||
holdElapsedSec,
|
||||
cameraProgress,
|
||||
holdProgress,
|
||||
camera: cameraAtProgress(previousCamera, shot.camera, cameraProgress),
|
||||
camera: move
|
||||
? sampleCameraMove(move, cameraProgress)
|
||||
: cameraAtProgress(previousCamera, targetCamera, cameraProgress),
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user