You are browsing as a guest. Sign up (or log in) to start making projects!

3h 0m 44s logged

I got gravity simulation working! Now the Earth is spinning around the Sun!

I know you can’t see it in the video I posted, but the Earth is there, it’s just that this simulation is drawn to scale, the Earth would actually barely be visible if you were looking from a spacecraft that far away.

This took quite a while because of this one really stupid bug: basically I store all the distance values in light minutes rather than kilometers or miles because otherwise those values would be too big. However, the physics equations that I’m using expect the values to be in meters, not light minutes.

So basically, I forgot to convert from light minutes to meters when calculating the gravity acceleration, so those values were too small to change the velocity of the Earth, causing it to go in a straight line forever.

But now that that is done, I will start adding the rest of the planets and maybe their moons as well to this simulation, then I can look purely at quality of life improvements to improve the interactivity of it.

This project is turning out to be easier than I expected! Hopefully another challenge doesn’t pop up…

0
7

Comments 0

No comments yet. Be the first!