Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak Camera3D clipping #3433

Merged
merged 3 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

## master

- Fixed a bug with h/vlines and h/vspan not correctly resolving transformations [#3418](https://github.com/MakieOrg/Makie.jl/pull/3418)
- Fixed a bug with h/vlines and h/vspan returning the wrong limits, causing an error in Axis [#3427](https://github.com/MakieOrg/Makie.jl/pull/3427)
- Fixed a bug with h/vlines and h/vspan not correctly resolving transformations [#3418](https://github.com/MakieOrg/Makie.jl/pull/3418).
- Fixed a bug with h/vlines and h/vspan returning the wrong limits, causing an error in Axis [#3427](https://github.com/MakieOrg/Makie.jl/pull/3427).
- Fixed clipping when zooming out of a 3D (L)Scene [#3433](https://github.com/MakieOrg/Makie.jl/pull/3433).

## 0.20.1

Expand Down
4 changes: 2 additions & 2 deletions src/camera/camera3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Loading