0

I was going to simulate planetary motion in blender and i have simulated the gravitational attraction between two planets with rigid body and force field. but i don't have any idea about how to give one of them initial velocity with physical accuracy If there is a way to do this with python that would be awesome!!

Here is my blender file : https://gofile.io/d/XnTyAw enter image description here

There is a problem with the common trick of giving objects initial velocity because it suddenly disappears : enter image description here

1 Answers1

0

an initial velocity in a rigid body simulation is very easy to do:

  1. check animated checkbox and keyframe a location

  2. keyframe another location on another later frame (distance + keyframe distance will "make" the speed

  3. one keyframe later: disable animated checkbox and keyframe it

Chris
  • 59,454
  • 6
  • 30
  • 84
  • I've tried this and the object suddenly vanishes – pouya rahgozar Apr 23 '21 at 10:47
  • that was your question, and that is my answer. of course - if there are some other circumstances like force fields or parenting (like you have) it behaves differently. One problem in your simulation is: you turned gravity on which is in your case - nonsense - because gravity in Blender is in one direction (normally -z - but you can change that). But in your case you don't want that, because you want "space gravity between objects) and not directional gravity(simplified) like on earth. – Chris Apr 23 '21 at 10:57
  • It disappears because of gravity in -z direction!! – Chris Apr 23 '21 at 16:08
  • so how to fix?(sorry i'm beginner) – pouya rahgozar Apr 23 '21 at 16:24