InterStonar
Throw a rock into a simulated universe: planets that attract each other and merge, or shapes it hits, found by stepping with signed distances.
- Period
- Mar 2026 – Apr 2026
- Role
- CLI, vectors and the local (shapes) mode
- Team
- 2 people
- Status
- archived
Stack and tags
Demo
Transcript (final screen)
demo:interstonar$ ./interstonar --global toml/global_scene_example.toml -d 3600 0 0 0 100 0 0 Rock coordinates (x y z) are: t = 0: (0 0 0) t = 1: (360,000 0 0) t = 2: (301,844,089 1,628,346,981 -262,848,507) Collision between rock and Sun Mission success demo:interstonar$ ./interstonar --local toml/local_scene_example.toml 0 0 0 1 1 0 | tail -4 Step 1: (-3.54, -3.54, 0.00) Result: Intersection with BOX_1 demo:interstonar$
You throw a rock from a point, in a direction, into a scene described in a small text file. Will it hit something? InterStonar answers in two very different worlds, chosen by a flag. Built with Samuel Jaglale.
How it works
In space, there are planets with real masses and speeds, and everything attracts everything. The clock ticks, every body is pulled by every other, and when two collide they merge, keeping their total mass and momentum, as physics says they should.
Among shapes, there is no gravity, only spheres, boxes, cylinders and tori. Each shape can say how far a point is from its surface, so the rock moves forward exactly that far at each step: it can never jump through anything, and stops when it touches a surface or leaves the scene. It is the same trick graphics engines use to draw such shapes.
What I took from it
- One simple question (“how far is the nearest surface?”) can replace a costly calculation, which is why graphics uses it.
- Letting physics decide the rules, rather than special cases, keeps a simulation honest.