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

**URL:** https://discourse.julialang.org/t/glmakie-how-to-set-viewing-to-include-points-outside-the-3d-frame/125875
**Category:** New to Julia
**Created:** [February 13, 2025, 6:19pm UTC](https://discourse.julialang.org/t/glmakie-how-to-set-viewing-to-include-points-outside-the-3d-frame/125875 "2025-02-13T18:19:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![RobbesU](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robbesu/32/212459_2.png) [@RobbesU](https://discourse.julialang.org/u/RobbesU)
#### Post date: [February 13, 2025, 6:19pm UTC](https://discourse.julialang.org/t/glmakie-how-to-set-viewing-to-include-points-outside-the-3d-frame/125875/1 "2025-02-13T18:19:58Z")

</div>

I suspect I’m missing something with the camera settings and/or [clip planes](https://docs.makie.org/stable/reference/generic/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 `Observable`s 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

```julia
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)

```

---

<div class="post-metadata">

### Author: ![JonasWickman](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@JonasWickman](https://discourse.julialang.org/u/JonasWickman)
#### Post date: [February 13, 2025, 8:30pm UTC](https://discourse.julialang.org/t/glmakie-how-to-set-viewing-to-include-points-outside-the-3d-frame/125875/2 "2025-02-13T20:30:50Z")

</div>

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

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

```

 ![no_clip](https://global.discourse-cdn.com/julialang/original/3X/3/5/35b489e94948161186f298aa72d5ae5bcbadf325.png)

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](https://github.com/MakieOrg/Makie.jl/issues/4741#issuecomment-2600938816)

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

```julia
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[]

```

---

<div class="post-metadata">

### Author: ![RobbesU](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robbesu/32/212459_2.png) [@RobbesU](https://discourse.julialang.org/u/RobbesU)
#### Post date: [February 14, 2025, 6:42am UTC](https://discourse.julialang.org/t/glmakie-how-to-set-viewing-to-include-points-outside-the-3d-frame/125875/3 "2025-02-14T06:42:34Z")

</div>

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