Skip to content

Commit

Permalink
added actions for panorama collection #412
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaNowak committed Jan 31, 2025
1 parent 7612ade commit 1ee4dd4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/PRo3D.SimulatedViews/Snapshots/SnapshotApp.fs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ module SnapshotApp =
(float(resolution.X)/float(resolution.Y))
frustum

let calculateFrustumP (snapshotAnimation : PanoramaSnapshotCollection) =
let resolution = V3i (snapshotAnimation.resolution.X, snapshotAnimation.resolution.Y, 1)

let foV = snapshotAnimation.fieldOfView

let frustum =
Frustum.perspective foV snapshotAnimation.nearplane snapshotAnimation.farplane
(float(resolution.X)/float(resolution.Y))
frustum

let private executeCameraAnimation (a : CameraSnapshotAnimation)
(app : SnapshotApp<'model,'aModel, 'msg>) =
let frustum, recalcOption, near, far = calculateFrustumRecalcNearFar a
Expand Down
2 changes: 2 additions & 0 deletions src/PRo3D.Snapshots/Viewer/SnapshotGenerator.fs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ module SnapshotGenerator =
]
| SnapshotAnimation.PanoramaCollection a ->
[
(ViewerAction.SetRenderViewportSize a.resolution |> ViewerMessage)
(ViewerAction.SetFrustum (SnapshotApp.calculateFrustum a)) |> ViewerMessage
// Add actions that need to happen for each panorama batch (not single panorama shot) here
]

Expand Down

0 comments on commit 1ee4dd4

Please sign in to comment.