Building a FABRIK solver
The second heuristic Inverse Kinematics solver to explore is FABRIK, the Forward and Backward Reaching Inverse Kinematics solver. FABRIK needs fewer iterations compared to CCD to find a satisfactory solution.
Similar to CCD, we will start with an overview of the FABRIK algorithm. After the basics have been explained, we will update the Inverse Kinematics Solver
class, the user interface, and the renderer code to allow the selection of FABRIK as a second Inverse Kinematics solver.
Understanding the FABRIK basics
While CCD rotates the bones around the nodes to align the effector with the target, FABRIK moves and scales the bones to make the effector reach the target. Also, FABRIK moves along the chain of bones in two directions, forward and backward, hence its name.
Let us use the same simple robotics arm covered in the Understanding the CCD Basics section; the steps for a single iteration are shown in Figures 13.6 to 13.9. We can see the same initial...