GLMakie, how to set viewing to include points 'outside' the 3D frame

I suspect I’m missing something with the camera settings and/or clip planes, but I’ve been messing with them all day and cannot get it.

In GLMakie v0.18 (held back by ModelingToolkitDesigner) I would see 3D points also ‘outside’ the axis box, so I could rotate around and see them from all angles.
To take advantage of 3D zoom & pan, I updated GLMakie to latest v0.11.2 (Makie 0.22.1), now they are being cut off.

MWE to show a very simplistic cut-off. The full application has dynamically moving 3D multi-bodies as Observables updating the plot (achieving ~70Hz), but they ‘wander’ outside the initially defined box in unknown direction. Now the only way to see them is to zoom them back ‘inside’ the box, which ‘views’ wrong.

I suspect I need to set the camera

using GLMakie   # v0.11.2

# define points in space
bodies = [ (0,0,0),(1,0,0,),(2,0,0) ] .|> GLMakie.Point3f
clrs = [:red, :green, :blue]

# collect the pairs of point locations for the linesegments
lines_vec = [(bodies[i-1], bodies[i]) for i in 2:length(bodies)] 


fig = Figure(size=(900,900));
ax = Axis3(fig[1,1], aspect=:equal)
hidespines!(ax)	
meshscatter!(ax, bodies, markersize=0.1, color=clrs)
linesegments!(ax, lines_vec, color=clrs[1:length(lines_vec)])

display(fig)

# deliberately limit the axis so one points falls outside
xlims!(ax, high=1.8)



As best as I can tell, this is resolved by changing the lines that actually plot to:

meshscatter!(ax, bodies, markersize=0.1, color=clrs, clip_planes = Plane3f[])
linesegments!(ax, lines_vec, color=clrs[1:length(lines_vec)], clip_planes = Plane3f[])

Don’t know many details, picked this up when trying to figure out a similar issue and found this: Clipping defaults changed when upgrading to GLMakie v0.11 [noticed in Brillouin.jl] · Issue #4741 · MakieOrg/Makie.jl · GitHub

Edit: It is in the documented attributes for e.g., meshscatter:

clip_planes = automatic — Clip planes offer a way to do clipping in 3D space. You can set a Vector of up to 8 Plane3f planes here, behind which plots will be clipped (i.e. become invisible). By default clip planes
  are inherited from the parent plot or scene. You can remove parent clip_planes by passing Plane3f[]
1 Like

Thank you!.
I went down the Axis(…) and Camera(…) rabit hole, completely misses this.