Building a CCD solver
CCD is a simple and popular Inverse Kinematics method to solve the motion of nodes to reach a target.
We start with an overview of the CCD algorithm, and after the CCD basics have been explored, we will add a new Inverse Kinematics solver class and enhance the existing classes, enabling the model to use the CCD solver.
Understanding the CCD basics
The basic idea of CCD is to rotate every bone of the skeleton limb in an iterative way to get closer to the target. To explain the steps involved, we will use a simplified robotic arm. A sample CCD iteration is shown in both Figure 13.3 and Figure 13.4:
- We can see the initial position of the three nodes in Figure 13.3 (1). Here, three bones, the target, and the effector are drawn. The blue node is attached to the ground, and the outer red node is used as the effector.
Figure 13.3: Solving Inverse Kinematics using CCD – part 1
- Then, we will draw a virtual...