## DifferentialEquations path animation

```using Makie
using OrdinaryDiffEq
using Statistics

function lorenz(du,u,p,t)
du = 10.0*(u-u)
du = u*(28.0-u) - u
du = u*u - (8/3)*u
end

u0 = [1.0; 0.0; 0.0]
tspan = (0.0, 10.0)
prob = ODEProblem(lorenz, u0, tspan)
sol = solve(prob, Tsit5())

t = Node(tspan)
trajectory = lift(t; init = [Point3f0(sol(t[], idxs = [1,2,3]))]) do t
push!(trajectory[], Point3f0(sol(t, idxs=[1,2,3])))
end
endpoint = lift(t->[Point3f0(sol(t, idxs = [1,2,3]))], t)

xm, xM = extrema(sol[1,:])
ym, yM = extrema(sol[2,:])
zm, zM = extrema(sol[3,:])

limits = FRect3D((xm,ym,zm), (xM-xm,yM-ym,zM-zm))

scene = lines(trajectory, limits = limits, markersize = 0.7)
meshscatter!(scene, endpoint, limits = limits, markersize = 0.5, color = :red)
eyepos = Vec3f0(100, 5.0, 25)
N = 1000
record(scene, "output.mp4", LinRange(tspan..., N)) do tᵢ
global eyepos
push!(t, tᵢ)
eyepos = Vec3f0(eyepos - (N / 10000), eyepos, eyepos)
update_cam!(scene, eyepos, mean(trajectory[]))
sleep(0.001)
end

```