2
$\begingroup$

I am making an animation of orbits. So far, I have made it so a planet follows an elliptical path around the sun (which is at the focus). However, the planet orbits at a constant speed. How should I implement code so that it obeys keplers second law and increases in velocity as it moves around the curve close to the centred mass. Code was modelled from: (blender.stackexchange.com/a/91511/15543)

I am wondering is it possible to constrain an object to a path WHILE also have a force acting on it. Would it be possible to add gravity to this while keeping the orbit on its path.

$\endgroup$
2
  • 1
    $\begingroup$ Jenny I posted some links to a previous q of yours and i see you are using the code from [this one[(blender.stackexchange.com/a/91511/15543) The code, it is of course free for anyone to use, Some attribution would be nice. Would keep the linear orbit, ie an average velocity and 0 acceleration, and calculate the lag or gain based on the acceleration on the tangent vector due to the force to move it further on or back on the path. Not sure if the physics engine is set up for gravity $\endgroup$
    – batFINGER
    Dec 7 '19 at 12:27
  • $\begingroup$ as in Newton's equations for planets. (Haven't tested: does zero scene gravity and objects with huge masses orbit or wobble?) $\endgroup$
    – batFINGER
    Dec 7 '19 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.