I am trying to make the rotation of the satellite around the Earth. I'm obtaining the satellite's position in the orbit from TLE elements and getting the XYZ of it. So moving along the trajectory (orbit) is done by just adding keyframes to the location of the Satellite.
The problem is with the self-rotation (spin) of the satellite. The satellite's orientation should be: (-Z) axis pointed to the Earth's centre. But I have it like in the picture (Small black dots are added for an orbit visualisation).
I like to have it like on the next picture The X-axis should point in the direction of movement along the orbit, Z - like a normal vector to the Earth's surface. I guess it should be some local coordinate system... maybe.
But I am avoiding any constraints (to the Earth) because there will be a self-rotation (spin) around the Z axis and even a precession of the Z axis.
How can I produce such orientation?
If you provide also python code it will help a lot. The whole blender project is here: link