The camera postion is fixed, and its lookAt target is moving, maybe this is why the system look like drifting.
No, the system is drifting because the sum of momentum is non-zero.
At the beginning, one of my purpose is to simulate solar system operation with the planetary parameters. I searched those values from Internet and set then as objects initial state, but them run not well, at least not like our real solar system, so I changed those values…
OK, there may be bugs too. I can’t tell that by visual inspection. What kind of numerical integration do you use?
Well, I’ll change the ‘Reset’ button to set all objects’s initial velocity as 0
You only need to subtract mass-weighted mean velocity from all, as far as I can tell.
but I could not get why need to set mass center as 0. Does it just for setting most of objects in center of view window?
Yes. You will only need to subtract the computed mass center from all positions.
I’ve chang the camera’s parameter ‘near’ to smaller for reducing the probability of curves disappearance.
For the best quality projection, also make sure the
near plane is not farther than necessary to capture all objects.