SIMKID: Toy motion simulator of simple physical systems for teaching kids
Teach kids physics and programming in parallel. This is a home-based project for practice Go with my younger son.
Details
In simkid
the simulation space is a 1920✕1080 pixel area which is updated in 60 fps rate. All coordinates are given in pixels. Velocity and acceleration should be in pixel per frame [p/f] and pixel per frame per frame [p/f²] accordingly.
The main component of simkid
is sim.go
- simulation logic: put here individual equations of motion for maximum 10 balls and possibly add interactions between them.
Use simkid-ffmpeg.sh
to compile PNG-frames into final MP4-video.
Usage
Clone the repo and run:
go run .
./simkid-ffmpgeg.sh
mpv "./videoset/$(ls -Art ./videoset | tail -n 1)"
Or having simkid
artefact built with
go build .
simply watch the resulting video invoking
./simkid.sh