New answers tagged orbit
First generate a random 3D rotation matrix. Then for each frame compute a simple, boring rotation vector around the center (e.g x = r*cos(k*t), y = r*sin(k*t), z = 0), multiply it by the rotation matrix, add it to the center of the sphere, and you have a random orbit.
I would suggest creating an arc-ball camera. This is a camera that can orbit around the point-of-interest and change its distance from the point-of-interest (basically zooming in and out). By simpling changing the location of the point-of-interest you get panning for free ;). Have a look at this code snippet: ...
If the players will never know the difference, then don't worry about mass or radius. For the oribiting planet store - the distance to the center planet (radius of rotation) - current position in degrees - orbit-speed (degrees per game tick) For each game tick - change the position by adding the speed - calculate the new position (using Cos and Sin) ...
If players have no effect over the orbit (such as moving planets) then the best option would simply be to define paths for the planet to travel along (using bezier curves etc). It's stable and simple. You would never be able to affect the movement in game (unless you went to the trouble of altering the defined path) and may open up unrealistic possibilities ...
Top 50 recent answers are included