Hello, I need some help to perform some simple operations on GLMakie.
I want, say, to draw a simple torus juste like this example, zoom in, and save the plot, but I could find no example on how to use Makie’s zoom!
function.
Here is the code for plotting a torus :
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)
fig[1,1] = ax
save("zoom.png", fig)
end
and saving as a .png picture. I tried to zoom by adding
zoom!(ax.scene, 3)
to zoom by a factor 3 and it didnt work. How could I do ?
Same question applies for translations and rotations.
PS: this issue seems related, but does not provide a solution on how to zoom.