Cursor Gravity
richardsimoes.com
Cursor Gravity
1–10 of 10 posts
Re: Cursor Gravity
#2It's surprisingly fun for such a simple little thing, especially since the lack of friction makes it so much more compelling than the "marble in a bowl" demonstration I got when I was a kid.
Re: Cursor Gravity
#3Howto for orbits: This is a closed system so the only energy that can possibly be added into the system is from your movement of the cursor. So keep the cursor far away from the planet until it hits about center and then move the cursor close but so that the planet slingshots around it. This should establish a stable orbit. If you are careful enough, the orbit will stay in the screen.
PS. Checked the physics. Seems fine as its just standard Newtonian.
Re: Cursor Gravity
#4I used to do this with a large magnet and a little chip off the magnet... accidentally figured out how orbits work. Fun times. :)
Re: Cursor Gravity
#5He's used the Euler method, which I think is why you get aberrant behaviour when the cursor comes near the particle:
Re: Cursor Gravity
#6This also serves as a good repro of a Firefox memory leak (watch your task manager while it's running). There won't be many usable canvas apps until their JS engine is tightened up or replaced.
Re: Cursor Gravity
#7Nice little toy, but what's the next level? 2 objects, try to get a stable orbit? Talk about a steep difficulty curve. (http://en.wikipedia.org/wiki/N-body_problem)
Re: Cursor Gravity
#8This also serves as a good repro of a Firefox memory leak (watch your task manager while it's running). There won't be many usable canvas apps until their JS engine is tightened up or replaced.
[deleted]
Re: Cursor Gravity
#9This also serves as a good repro of a Firefox memory leak (watch your task manager while it's running). There won't be many usable canvas apps until their JS engine is tightened up or replaced.
No, it gcs after a while. Memory usage steadily climbs until it hits a certain point and then drops back down.
Re: Cursor Gravity
#10Would work fine in IE if he just added the ExplorerCanvas js file (from Google) http://excanvas.sourceforge.net/