Skip to content

Renderer: camera roll turns the right way and applies to every pass - #4

Open
DennisHerrm wants to merge 2 commits into
FernandoS27:masterfrom
DennisHerrm:pr/camera-roll-sign
Open

DennisHerrm wants to merge 2 commits into
FernandoS27:masterfrom
DennisHerrm:pr/camera-roll-sign

Conversation

@DennisHerrm

Copy link
Copy Markdown

Two fixes for camera roll, found with a rolled target camera synced from 3ds Max (Sync Camera) and with MDX camera presets (KCRL):

  • Roll direction. Camera::ComputeUpFromLookDirection (Direct mode, used by SetDirectPose) added roll·right, while ComputeUpFromAngles (Orbital mode) subtracts it. 3ds Max's LookAt roll measured in Max 2027: roll +30° gives up = cos·upBase − sin·right, the orbital convention. Direct mode now subtracts too, so an MDX camera's KCRL rolls the same way as in Max.
  • Roll on every pass. ViewRH() built its look-at with world Z as up, so the SD geosets, particles and ribbons (drawn with GetViewMatrix() = ViewRH()) stayed level while the grid, HD geosets and shadows (ViewLH()) rolled: the model seemed to turn against its own grid. ViewRH() now uses the same up vector as ViewLH().

The WhiteoutDex side (its viewport sync recovers the roll with the matching sign) is in FernandoS27/WhiteoutDex#14, which needs this change.

🤖 Generated with Claude Code

DennisHerrm and others added 2 commits October 8, 2026 19:07
ComputeUpFromLookDirection added roll·right while ComputeUpFromAngles (and
3ds Max's LookAt roll) subtract it, so an MDX camera's KCRL rolled the view
the opposite way. Measured in Max 2027: roll +30° gives up = cos·upBase −
sin·right.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ViewRH built its look-at with world Z as up, so the SD geosets, particles
and ribbons stayed level while the grid and HD passes (ViewLH) rolled: a
rolled Max camera synced into the preview turned the teapot against its
own grid. Both now use the same up vector.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant