just do same as for body, but add after the calculation the position of the second planet.

Fabrice


On Apr 17, 2009, at 2:15 AM, anndorian wrote:


Ok, I have a star and a planet orbiting around it using :

      // posX - distance between star and planet
      theta=Math.PI;

        theta -= (speed * 0.1) / 180 * Math.PI;

        body.x = Math.cos(theta) * posX;
        body.z = Math.sin(theta) * posX;

The problem is I don't know how to put a satellite orbiting that
planet ( which orbits the star ). Can anyone help me ?

Thanks.

Reply via email to