IfMoonWereOnlyOnePixel

I wrote about abandoning projects two weeks ago. This time I didn't abandon it.

I built MoonPixel3D. It's a 3D visualization of the solar system where 1 pixel = Moon's diameter (3,474.8 km). I saw Josh Worth's "If the Moon Were Only 1 Pixel" and thought what if I can move around in 3D and actually navigate through space. So I made it.

MoonPixel3D Screenshot

I have updated the project with a cockpit and now it somehow feels like you are the one controlling it. It even has sound

At this scale Earth is 43,051 pixels from the Sun. Neptune is 1,293,488 pixels away. Even at light speed it takes 8 minutes to reach Earth and over 4 hours to reach Neptune. Space is really big and empty.

Built with C++20 and OpenGL 3.3+. Made procedural starfield in GLSL shaders so I don't have to load textures. You can travel at different speeds including light speed (86.26 pixels/s). Runs at 60+ FPS. Used ImGui for the UI and planet information.

Version 2.0 is done. It works. It has bugs and things I would change but it's finished.

GitHub: github.com/valhizen/ifthemoonwereonlyonepixel

Youtube: Watch the demo

Some technical things

Light speed calculation: 299,792.458 km/s ÷ 3,474.8 km/pixel = 86.26 pixels/second. This makes traveling feel real because even at light speed everything is slow.

Stars are generated in fragment shader using hash functions. No texture loading. Just math.


First project I actually finished. Maybe I can finish more things now.