u/faorien

▲ 123 r/raylib

Built a digital clock out of tiny analog clocks

A digital clock except every digit is made out of tiny analog clocks.

The fun part was not really drawing the clocks, but figuring out a simple way to describe each number as a pattern of symbols, then mapping those symbols to hand positions. When the time changes, the hands smoothly rotate into their new positions instead of instantly snapping.

The animation feels surprisingly satisfying to watch compared to simply switching (snapping) the digits without it.

Source code: https://github.com/letsreinventthewheel/clockwork-digits
YouTube coding session: https://www.youtube.com/watch?v=CLUtwAQx51Y

UPDATE:
It turns out there is actually a Raylib example (on the official web site) that has the same project, same result. Honestly, I didn't even know about it. So even though we achieve the same result I believe I took a few different turns from original example, which might be interesting to take a look at

u/faorien — 4 days ago