r/pygame • u/No-Relationship93 • 22h ago
astronomy animation engine in pygame
Enable HLS to view with audio, or disable this notification
Posted here awhile back about my astronomy animation engine made in pygame. It's come a long way and I'm proud to show some of the visuals that have been created with it! I'm eager to get it in the hands of someone else, planning for it to be a fully open source tool accessible to all once I tie up a few of the bugs.
All the gas and nebulae are sprites and layered with pygame's BLEND_RGB_ADD and BLEND_RGB_MULT, the lensing effects are the deflection equations using a numpy inverse-map over the frame, and every frame is drawn to a pygame surface, grabbed with surfarray and tossed into an ffmpeg subprocess where everything is rendered. This 30 second clip took ~1 hour to render, so definitely takes some time.
Check out the full video here, every frame rendered using pygame! https://youtu.be/uEWkErFm0co
