c# – Calculating Position Using Rotation in Unity

I have a model of a human hand in Unity.
I need to calculate the position of each finger joint using the rotation of the previous joint. In the model this is portraited as an object that is the wrist, the next 5 joints of each finger being its child object, and so on till you reach the tip of the fingers.

I’m trying to use rotation matrices, but this seems to be off when I reach certain roll rotations.
This is both a Unity question and a math question, is there something I’m doing wrong / could do better?

I will prov any other necessary information.

Read more here: Source link