Live data from Hacker News

Gravity Simulator

nowykurier.com

111–120 of 135 posts

Re: Gravity Simulator

#111

Similar simulation I've made earlier: http://newton.azurewebsites.net/ Pure Javascript using Sylvester.js for Math.

Great! I wanted to say that the "add random" button tends to shoot particles light-years away, never to be seen again. Is that what you were intending?

Re: Gravity Simulator

#113

I did something similar, but with combat - ships, lasers and missiles. There are a couple of variations, and some tweaks like the ships accelerating perpendicular to the planets so they don't crash land. http://codepen.io/simonswain/full/ftEjD/ http://codepen.io/simonswain/full/CeHmh/

Very cool. I notice that many ships tend to get stuck on the edge of the map though. Maybe make it so they loop back around to the other side of the map?

Thanks. Yeah, there are a couple of glitches in there. The ships bounce off the edge of the screen, and smaller ships run from bigger ones -- combined, that makes them crawl along the sides. Looping around is a good idea, or I'm wondering if there could be some kind of log scale to distance the further out from the centre the ships get. I did a variation a while back with a star in the middle that could be tweaked for that (click to add a ship). Mind you, the gravity from the star pretty much takes care of that problem.

http://codepen.io/simonswain/full/cKejC/

Re: Gravity Simulator

#114

Very cool! I was able to get 2 masses to oscillate around each other in a funny way[1]. Seems they keep going like that forever. What is this kind of equilibrium called? [1] http://imgur.com/FQYpo9V

I've been playing with it too: http://imgur.com/VAHTfg9

It took a little bit to generate this one.

Re: Gravity Simulator

#115

Earlier quoted context omitted.

Done. Although I did this years ago: http://mobile.sheridanc.on.ca/~claassen/Gravity/Gravity.html

Great! I tried it out; when I combined a galaxy with a field , many particles went flying from the center at a high rate of speed. Why is that?

When a small particle gets accelerated to great speeds as it approaches a massive object it simply passes through because the collisions are off/aren't perfect even when they're on

Re: Gravity Simulator

#116
post #69

Very nice, wish it was HTML5 rather then flash.. It brings to light how hard it is to get a stable solar system. And of course I knew this but playing around I realized our sun is not stationary either... It's easy to forget the entire solar system we live in is this amazing mix of interactions between the planets, sun, other debris and outside mass from other parts of the universe.

Here's my HTML5 Version: https://news.ycombinator.com/item?id=8288434

Re: Gravity Simulator

#117
post #5

I'm stuck with an empty loading bar and > Error #2046

This problem can be fixed by either increasing the Adobe Flash local storage space, (also known as “Flash cookies”) or deleting them.

How does one do that...?

I did "rm -rf ~/.macromedia/Flash_Player/" but still get Error #2046....

Re: Gravity Simulator

#118
Can I play? I wrote a RK4 gravity simulator a while back in WebGL, but my main goal at the time was to find a way to visualize gravitational fields, so its nowhere near as interactive or user friendly as your implementation.

I was trying for the effect you see in high school physics videos. My approach was to use a plane geometry mesh and apply a vertex displacement shader, but never quite got it to look or perform how I wanted.

http://programmarchy.github.io/gravity

Re: Gravity Simulator

#119
post #69

Very nice, wish it was HTML5 rather then flash.. It brings to light how hard it is to get a stable solar system. And of course I knew this but playing around I realized our sun is not stationary either... It's easy to forget the entire solar system we live in is this amazing mix of interactions between the planets, sun, other debris and outside mass from other parts of the universe.

Here's my HTML5 Version: https://news.ycombinator.com/item?id=8288434

Right-clicking is a nice treat! Interesting to compare the different integration methods, too. Excellent work.
Post reply on HN