Code: Select all
Gravity Fun at TestTubeGames.com: [ForceGr: r^(-2),Qual: 1,Zoom: 1,xSet: 0,ySet: 0], [x0: 0,y0: 0,vx: 0,vy: 0,t0: 0,who: 2,m: 100000000,n:Sun,c: 2], [x0: 14959.8261,y0: 0,vx: 0,vy: 81.7592177204741,t0: 0,who: 2,m: 300.3467,n:Earth,c: 2], [x0: 14998.266,y0: 0,vx: 0,vy: 84.5544654777364,t0: 0,who: 2,m: 3.6943,n:Moon,c: 2], [x0: 5790.905,y0: 0,vx: 0,vy: 131.409505131638,t0: 0,who: 2,m: 16.6012,n:Mercury,c: 2], [x0: 10820.8,y0: 0,vx: 0,vy: 96.132517340063,t0: 0,who: 2,m: 244.781,n:Venus,c: 2]
When you open the code, you see the BIIIIG sun. Zoom out all the way, then scroll to the right. Catch up to Earth, Ptolemy, and do stuff.
Now, this runs into a few problems. Note the scale of the Earth-Moon system. Try setting Earth and Moon's densities to a very large number (At least 1e+09. You find that there's a limit on how small planets can be. This is problem 1. (I've made a formula to calculate the exact radii, but they don't fit: http://upload.wikimedia.org/wikipedia/c ... -scale.svg. (If you can't see the moon, scroll right.)
Now try loading this code:
Code: Select all
Gravity Fun at TestTubeGames.com: [ForceGr: r^(-2),Qual: 1,Zoom: 1,xSet: 0,ySet: 0], [x0: 0,y0: 0,vx: 0,vy: 0,t0: 0,who: 2,m: 100000000,n:Sun,c: 2], [x0: 14959.8261,y0: 0,vx: 0,vy: 81.7592177204741,t0: 0,who: 2,m: 300.3467,n:Earth,c: 2], [x0: 14998.266,y0: 0,vx: 0,vy: 84.5544654777364,t0: 0,who: 2,m: 3.6943,n:Moon,c: 2], [x0: 5790.905,y0: 0,vx: 0,vy: 131.409505131638,t0: 0,who: 2,m: 16.6012,n:Mercury,c: 2], [x0: 10820.8,y0: 0,vx: 0,vy: 96.132517340063,t0: 0,who: 2,m: 244.781,n:Venus,c: 2], [x0: 22793.91,y0: 0,vx: 0,vy: 66.2354643645988,t0: 0,who: 2,m: 32.2713,n:Mars,c: 2]
Wait. Look up in the sky. Where's the sun?! (Don't believe me? Try selecting the sun while leaving. It disappears in a bit.)
Yeah, problem 2 is that objects that are too far away when the sim is running disappear.
---
Now I'm pretty sure that the radius issue is simply to make small particles easy to see, but it causes some problems here, so there should be an option. The problem of things disappearing I'm not entirely sure of, though Andy probably knows how to fix it. (Unless it's a precision issue, in which case fixing it might make the sim slower. Then you shouldn't fix it, or add an option if possible.)
These two problems limit the scale range of models in GSim (radius on small side and disappearance on big side), so simply scaling the model wouldn't work that much.
---
Notes on the model:
This assumes orbits are circular, and perturbations on the primary by a satellite are negligible. (Moon's orbit is slightly eccentric because of that.) This means you might want to CoM the sim right after you load.
Ninja-edit: A similar problem to problem 2 is observed for trails that are too far out of the viewing range. (I'm reasonably sure) the cutoff is based on current zoom level.