I got a character at some point $A$ facing to point $O$ that is equal to $(0,0,0)$, then I move it to point $B$ and I want to rotate him to face point $O$. Since this is 3D world I think that I need to do two rotations. I also got an idea of how to do this, but I need your help to actually write it down.
Create $BC$ that is vertical to $AO$, then find $C$ and calculate $CO$, $BO$ and $BC$ over the $xy$ plane, and then find the angle COB. This is for rotation one, and also I need to do this with the $x$ and $z$ axes as triangles only live in a two dimensional world.
I am not sure that my plan is good, if it's not please tell me what is the proper way of doing this, and please help me make the calculations.
I need this for my game where a person walks on a star and I need to rotate the Matrix4 when I translate him based on the player movement. I want to make sure his legs are pointed toward planet center.