Skip to content

Add per-frame up vectors to camera tracks - #326

Merged
slimbuck merged 2 commits into
playcanvas:mainfrom
slimbuck:cam-up
Sep 22, 2026
Merged

slimbuck merged 2 commits into
playcanvas:mainfrom
slimbuck:cam-up

Conversation

@slimbuck

Copy link
Copy Markdown
Member

Camera tracks (--camera-track) rendered every frame with the fixed --camera-up vector, so a multi-frame render could not tilt or roll the camera. This adds an up vector to each track pose.

The plain frames-list format now accepts an optional up: [x, y, z] per frame, interpolated between frames by normalized lerp so it stays unit-length when neighbouring frames differ in direction. Frames without one fall back to --camera-up, mirroring how frames without a fov fall back to --camera-fov. loadCameraTrack gains an optional third defaultUp argument (world +Y when omitted), so the library API stays additive.

The supersplat editor's project poses and the viewer's animation tracks carry no up vector or roll, so those formats keep a constant up from --camera-up. Adding roll there would need a change to the editor and viewer formats first.

The image writer transforms each pose's up into data space alongside its position and target, as the start/end segment path already does. CLI help and the README document the new field.

Verification: a new test/camera-track.test.mjs covers per-frame up, mid-frame normalized lerp, the default fallback, malformed up rejection, and the editor/viewer formats using the default. End-to-end, a track frame with up: [1,0,0] renders byte-identical to a single render with --camera-up 1,0,0, and a frame without up renders byte-identical to the default-up single render.

@slimbuck
slimbuck requested a lite review from Copilot September 22, 2026 13:17
@slimbuck slimbuck self-assigned this Sep 22, 2026
@slimbuck slimbuck added the enhancement New feature or request label Sep 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@slimbuck
slimbuck marked this pull request as ready for review September 22, 2026 13:27
@slimbuck
slimbuck requested a review from a team September 22, 2026 13:27
@slimbuck
slimbuck merged commit bdeeeda into playcanvas:main Sep 22, 2026
3 checks passed
@slimbuck
slimbuck deleted the cam-up branch September 22, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants