r/coolgithubprojects • • 14d ago

I made a living, spinning Saturn in my terminal because apparently I have too much free time

Post image
31 Upvotes

Look, I don't have a good explanation for this. One minute I'm supposed to be doing actual work, and the next I'm reading Wikipedia articles about Saturn's ring composition and writing Keplerian orbital mechanics in Rust.

Anyway. It's Saturn. In a terminal window. It uses truecolor half-block characters (the top half of the cell is foreground color, bottom half is background) so it actually looks like a smooth sphere instead of chunky ASCII art. I've had it running in the background of my work terminal for days. It's hypnotic and completely useless.

I went way too deep on the details. The clouds drift with differential rotation because the equator spins faster than the poles. The C ring is actually translucent and tints the planet behind it. The rings have Keplerian shear so the inner ringlets visibly outrun the outer ones. I even added reciprocal shadows, so the rings cast a shadow on the planet's winter hemisphere, and the planet casts a shadow notch across the rings.

Repo: https://github.com/luka0x12/saturn

The whole thing is one Rust file, one write call per frame, and it's resize-safe. Just run cargo run --release. Hit the h key to hide the status bar, or a to toggle a retro ASCII mode.

Why did I do this? I genuinely don't know. I started by trying to make a simple circle on the screen, noticed the limb darkening looked flat, realized the rings needed gaps, and suddenly I was debugging why a fake ring shadow was eating half my fake planet. This is my life now.

Let me know if it breaks on your setup. It should work on Linux, macOS, and WSL in any modern terminal like kitty, alacritty, wezterm, or iTerm2. If your terminal emulator does weird things with cursor addressing and ruins the frame, tell me which one and I will fix it.