Skip to content

Visualizer3D: clip planes from the camera's distance, not fixed at 20 m - #1464

Merged
BioCam merged 1 commit into
PyLabRobot:mainfrom
BioCam:visualizer3d-clip-planes-from-distance
Oct 2, 2026
Merged

BioCam merged 1 commit into
PyLabRobot:mainfrom
BioCam:visualizer3d-clip-planes-from-distance

Conversation

@BioCam

@BioCam BioCam commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

Both cameras are made with fixed clip planes - the perspective one draws to 20 m, the orthographic one 20 m either side - and only frameBox refits 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 as frameBox already did (near distance / 1000, far distance * 50), the orthographic one distance * 50 either side
  • frameBox calls it for either projection, which covers the opening view, home and focusing a resource
  • setProjection calls it, so the toggle keeps drawing what was on screen
  • a perspective framing is sized as before; the demo facilities, framed from a few metres, look the same

Tests: 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

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>
@BioCam
BioCam requested a review from a team as a code owner October 2, 2026 16:53
@BioCam
BioCam merged commit ffdc748 into PyLabRobot:main Oct 2, 2026
39 of 40 checks passed
@BioCam
BioCam deleted the visualizer3d-clip-planes-from-distance branch October 2, 2026 21:08
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