coding an fk handle effector

Hello, I am working on creating an end effector for my scene in Unity. I am trying to follow these steps:

  • Compute a translation matrix for each bone.

  • Compute a rotation matrix for each joint.

  • Multiply the matrices to get the full transformation matrix.

  • Then extract the position and orientation from this matrix.

I want the effector to appear at the top of my structure.
8471384--1125743--upload_2022-9-28_0-30-50.png
My issue is finding the correct formula to get this to work. When I fix the translation matrix, it messes up my rotation matrix. Any info is helpful. Here is my code:

Here is my tree:
8471384--1125746--upload_2022-9-28_0-31-53.png

I think your problem comes from reading from .localEuler coordinates and feeding them back in as the rotation in your TRS() calls. At least that’s the first place I would crosscheck, perhaps with a super-simplified structure you can reason about fully.

Here’s why I suspect that:

All about Euler angles and rotations, by StarManta:

https://starmanta.gitbooks.io/unitytipsredux/content/second-question.html