Visualizer3D: clip planes from the camera's distance, not fixed at 20 m - #1464
Merged
BioCam merged 1 commit intoOct 2, 2026
Merged
Conversation
Both cameras were made with fixed clip planes - the perspective one draws to 20 m, the orthographic one 20 m either side - and only frameBox refitted them, for the perspective camera alone. A facility framed whole stands further off: a 14 x 22 m lab opens with the camera 29.3 m above it, so the plan view, the home button and the projection toggle drew nothing. fitClipping(distance) sizes both cameras' planes from the camera's distance to its target; frameBox and setProjection call it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Both cameras are made with fixed clip planes - the perspective one draws to 20 m, the orthographic one 20 m either side - and only
frameBoxrefits them, for the perspective camera alone. A facility framed whole stands further off than that: a 14 x 22 m lab opens with the camera 29.3 m above it, so the opening plan view, the home button and the PSP / ORT toggle all draw nothing until something closer is focused.fitClipping(distance)sizes both cameras' planes from the camera's distance to its target: the perspective camera asframeBoxalready did (neardistance / 1000, fardistance * 50), the orthographic onedistance * 50either sideframeBoxcalls it for either projection, which covers the opening view, home and focusing a resourcesetProjectioncalls it, so the toggle keeps drawing what was on screenTests: browser_tests - a 14 x 22 m facility with four benches draws in its opening plan view, after the projection toggle and after home. It fails without the fix (0.3 % of the viewport drawn).
🤖 Generated with Claude Code