diff options
| author | syfyra <258908070+syfyra@users.noreply.github.com> | 2026-11-25 23:17:28 +0100 |
|---|---|---|
| committer | syfyra <258908070+syfyra@users.noreply.github.com> | 2026-11-25 23:17:28 +0100 |
| commit | cbeea42cdd416a432b092e9ca1c9cdf0b838715a (patch) | |
| tree | 272be809a3fa9eecfe28a7ae3feb1bed7aa7c5d9 /runtime/test/clzero_patch_test.cpp | |
| parent | 24d8af66af151f024b0b520fb397d899924f5486 (diff) | |
studio: scale the camera's near and far planes with the model fit (STUDIO-FIT-CLIP-PLANES)
The model viewer creates its camera once with near 0.1 and far 1000, and
the auto-fit then places it at maxDim * (1.5, 1.2, 1.8), about 2.63 x
maxDim from the model's centre, without touching either plane. Every
point of the model lies within half its diagonal of that centre, so a
model under about 6 cm sat wholly in front of the near plane and one over
about 290 m wholly beyond the far plane: the canvas stayed empty. A 2 cm
prop's depth range is 0.036..0.070, a 600 x 40 x 600 m terrain tile's is
1,194..1,965; the gallery sorts such models into its own categories
(farlod, terrain, road, level).
The fit now sets near to 1/1000 and far to 100 x its distance and
rebuilds the projection, which leaves room to zoom in and out.
Tested: node --test tests/test_viewer_studio.cjs (Node 26). The new test
fits a 2 cm cube, a 5 m car-sized box and a 600 m tile and checks the
model's depth range lies between the planes; it fails on main (near 0.1
clips the 2 cm cube) and all 13 tests pass with the change. The harness
camera gains near, far and updateProjectionMatrix.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/clzero_patch_test.cpp')
0 files changed, 0 insertions, 0 deletions