-
-
Notifications
You must be signed in to change notification settings - Fork 311
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
Documentation on Zoom!
#1236
Comments
The function The new camera has a method If you don't want an fov-based zoom you may want to try translating the camera instead. You can use Another option is to adjust the camera position (eyeposition) and/or focal point (lookat) via This all only applies to 3D |
I just tried this and can confirm it doesn't work for me either, in fact the plot disappears altogether after updating the camera as you described. However, Is it possible that there is a typo on this line https://github.com/JuliaPlots/Makie.jl/blob/27fdbd6e5d1141e1e4456c9b008776825f3818c8/src/camera/camera3d.jl#L495 ? It seems that the |
Thanks to both of you for your answers ! using GLMakie
let
U = LinRange(-pi, pi, 100) # 50
V = LinRange(-pi, pi, 20)
x1 = [cos(u) + .5 * cos(u) * cos(v) for u in U, v in V]
y1 = [sin(u) + .5 * sin(u) * cos(v) for u in U, v in V]
z1 = [.5 * sin(v) for u in U, v in V]
x2 = [1 + cos(u) + .5 * cos(u) * cos(v) for u in U, v in V]
y2 = [.5 * sin(v) for u in U, v in V]
z2 = [sin(u) + .5 * sin(u) * cos(v) for u in U, v in V]
fig = Figure(resolution =(900,600))
ax = LScene(fig, scenekw = (camera = cam3d!, show_axis = true))
wireframe!(ax.scene, x1,y1,z1, shading = false)
zoom!(ax.scene, cameracontrols(ax.scene), 3)
update_cam!(ax.scene, cameracontrols(ax.scene))
fig[1,1] = ax
end does not result in a zoomed picture, with or without the Replacing the |
Oh yea, that's a typo.
I think Makie enters things everything when the plot is first displayed. You can try reordering some things and displaying first fig = Figure(resolution =(900,600))
ax = LScene(fig, scenekw = (camera = cam3d!, show_axis = true))
wireframe!(ax.scene, x1,y1,z1, shading = false)
fig[1,1] = ax
display(fig)
zoom!(ax.scene, cameracontrols(ax.scene), 3)
update_cam!(ax.scene, cameracontrols(ax.scene)) or manually centering ax = LScene(fig, scenekw = (camera = cam3d!, show_axis = true, center = false))
wireframe!(ax.scene, x1,y1,z1, shading = false)
center!(ax.scene)
zoom!(ax.scene, cameracontrols(ax.scene), 3)
update_cam!(ax.scene, cameracontrols(ax.scene)) |
Continues #2831 ! Still needs to check, if I rebased correctly and didn't incorrectly apply some of the changes! ## Merged PRs - #2598 - #2746 - #2346 - #2544 - #3082 - #2868 - #3062 - #3106 - #3281 - #3246 ## TODOS - [x] fix flaky test `@test GLMakie.window_size(screen.glscreen) == scaled(screen, (W, H))` - [x] Merge axis type inferences from #2220 - [x] Test on different resolution screens, IJulia, Pluto, VSCode, Windowed - [x] rebase to only have merge commits from the PRs - [x] investigate unexpected speed ups - [x] reset camera settings from tests - [ ] check doc image generation - [x] rethink default near/far in Camera3D (compatability with OIT) - [x] merge #3246 - [x] fix WGLMakie issues/tests: - [x] fix line depth issues (see tests: ~~hexbin colorrange~~ (not new), LaTeXStrings in Axis3, Axis3 axis reversal) - [x] fix lighting of surface with nan points (fixed in #3246) - ~~volume/3D contour artifacts (see 3D Contour with 2D contour slices)~~ not new - ~~artifacting in "colorscale (lines)"~~ not new - [x] GLMakie: - [x] slight outline in "scatter image markers" test - ~~clipping/z-fighting in "volume translated"~~ not new - [x] CairoMakie: - ~~Artfiacting in `colorscale (lines)"~~ not new - ~~markersize in "scatter rotations" changed?~~ not new - ~~color change in "colorscale (poly)"~~ not new - ~~transparency/render order of "OldAxis + Surface"~~ not new - ~~render order in "Merged color mesh"~~ not new - ~~render order of "Surface + wireframe + contour"~~ not new - [x] Check "SpecApi in convert_arguments" (colors swapped?) ## Fixes the following errors - fixes #2721 via #2746 - fixes #1600 via #2746 - fixes #1236 via #2746 - fixes MakieOrg/GeoMakie.jl#133 via #2598 - closes #2522 - closes #3239 via #3246 - fixes #3238 via #3246 - fixes #2985 via #3246 - fixes #3307 via #3281
Hello, I am trying to use the
zoom!
function, see here, but there is no usable doc and no examples.More generally, the doc is extremely hard to use: there are many functions who use
Vec3f0
, but I found no reference for this. For instance,zoom(scene, Vec3f0(0,0,0), 2)
outputs aso that I have no clue on how to use these Vec3f0 objects.
I also have no clues on what are those
5f0
often found in examples, and I could not find something in the doc on them.Related : https://discourse.julialang.org/t/zoom-in-glmakie-3d-plot-then-save/65745
The text was updated successfully, but these errors were encountered: