Add per-frame up vectors to camera tracks - #326
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Camera tracks (
--camera-track) rendered every frame with the fixed--camera-upvector, 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 afovfall back to--camera-fov.loadCameraTrackgains an optional thirddefaultUpargument (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.mjscovers per-frame up, mid-frame normalized lerp, the default fallback, malformeduprejection, and the editor/viewer formats using the default. End-to-end, a track frame withup: [1,0,0]renders byte-identical to a single render with--camera-up 1,0,0, and a frame withoutuprenders byte-identical to the default-up single render.