Makie Visualization for Planetary Simulation for High School Students

Hi,

I am going to teach some simple orbital dynamics to high school students in summer.
The students are going to implement the gravitational forces and some sort of time integration (simple explicit or implicit euler) by themselves.
Also, we want to include some rockets designs with simplified thrust models and weight loss. So that is mostly their learning part.

Is there a easy way to use Makie as some 3D viewer where one can maybe change the perspective and navigate in space?

Frankly I am a bit overwhelmed about all the options so I’d be very happy about any hints to visualize this.

Thank you :)),

Felix

See GitHub - HolyLab/FlyThroughPaths.jl: Create "fly-throughs" in 3d visualization, you could either just use it directly or see how it manipulates the camera to do it yourself!

You can also set camera settings in LScene’s camera I think, via cameracontrols(scene) (or cameracontrols(lscene.scene)).

Also see the controls here:

You can also try to make a small interactive plot with GLMakie like this.
Note that I just made a quick example so it is not consistent with astrodynamics.

using GLMakie

sun = Point3f(0.0,0.0,0.0)
planenet1(t) = Point3f(1.0*cos(0.02 *t), 1.2*sin(0.02*t), 0.0)
planenet2(t) = Point3f(2.3*cos(0.01 *t + 1), 2.1*sin(0.01*t + 1 ), 0.0)

let 
    fig = Figure()
    ax = Axis3(fig[1,1], 
        limits=((-3.0,3.0),(-3.0,3.0),nothing))

    sg = SliderGrid(fig[2, 1],(label = "t", range = 0:0.1:1000, startvalue = 0.0))

    p1 = Observable([planenet1(0)])
    p2 = Observable([planenet2(0)])
    p1_track = Observable(planenet1.(0:0))
    p2_track = Observable(planenet2.(0:0))

    scatter!(ax, sun, color=:orange, markersize=30)
    scatter!(ax, p1, color=:green)
    scatter!(ax, p2, color=:blue)
    
    lines!(ax, p1_track, color=:green)
    lines!(ax, p2_track, color=:blue)

    on(sg.sliders[1].value) do t
        p1[] = [planenet1(t)]
        p2[] = [planenet2(t)]

        p1_track[] = planenet1.(0:0.1:t)
        p2_track[] = planenet2.(0:0.1:t)
    end
    
    fig
end