From ac6a4fba914c8c2494e8c765e7b97256f62db1d0 Mon Sep 17 00:00:00 2001 From: ffreyer Date: Thu, 30 Nov 2023 13:33:38 +0100 Subject: [PATCH 1/2] tweak clipping behaviour --- src/camera/camera3d.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/camera/camera3d.jl b/src/camera/camera3d.jl index dc789edadaf..63305b92566 100644 --- a/src/camera/camera3d.jl +++ b/src/camera/camera3d.jl @@ -728,7 +728,7 @@ function update_cam!(scene::Scene, cam::Camera3D) far = far_dist * far elseif cam.settings.clipping_mode[] === :adaptive view_dist = norm(eyeposition - lookat) - near = view_dist * near; far = far + near = view_dist * near; far = max(1f0, view_dist) * far elseif cam.settings.clipping_mode[] !== :static @error "clipping_mode = $(cam.settings.clipping_mode[]) not recognized, using :static." end @@ -775,7 +775,7 @@ function update_cam!(scene::Scene, cam::Camera3D, area3d::Rect, recenter::Bool = cam.far[] = 2f0 * dist elseif cam.settings.clipping_mode[] === :adaptive cam.near[] = 0.1f0 * dist / norm(cam.eyeposition[] - cam.lookat[]) - cam.far[] = 2f0 * dist + cam.far[] = 2.2f0 * dist / norm(cam.eyeposition[] - cam.lookat[]) end update_cam!(scene, cam) From 83fdb1c0296cbf2e0b258faa9f9db8869eb4385f Mon Sep 17 00:00:00 2001 From: ffreyer Date: Thu, 30 Nov 2023 13:44:55 +0100 Subject: [PATCH 2/2] update news [skip ci] --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 95da45b9d88..a365a87fb7b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ ## master - Fixed a bug with h/vlines and h/vspan not correctly resolving transformations [#3418](https://github.com/MakieOrg/Makie.jl/pull/3418) +- Fixed clipping when zooming out of a 3D (L)Scene [#3433](https://github.com/MakieOrg/Makie.jl/pull/3433) ## 0.20.1