I am very new to rigid body transformations.
I would like to align a 3D rigid body such that its first axis $o1$ would align with the display's vertical axis $d1$ and its second axis $o2$ with the display's horizontal axis $d2$.
In the case at hand, a human palm: I would like to align such that the palm's forward distal direction faces up in the display, and the direction perpendicular to it across the palm faces left on the display, so that the center of the palm faces forward and its front fingers face up. From an arbitrarily oriented point cloud describing the hand, from which let us assume I can somehow derive the mentioned two axes of the hand.
I've experimented aligning the entire rigid body by a rotation matrix from one single axis to the other as per this kind of transformation, which won't immediately scale for aligning two sets of (two) axes without getting the wrong directionality half of the time.
Even when aligning by just one axis through that technique ― the alignment only works in the sense of the axes converging ― without them necessarily agreeing on the sign of their direction, and hence the rigid body will undesirably flip.
Could you point me in the right direction?