Game Development Reference
In-Depth Information
Figure 9.3 A double link IK chain.
Target. x = Pivot2. x + Length2 * cos(
1 +
2 )
Target. y = Pivot2. y + Length2 * sin(
1 +
2 )
which implies that
Target. x = Pivot1. x + Length1 * cos(
1 ) + Length2 * cos(
1 +
2 )
Target. y = Pivot1. x + Length1 * sin(
1 ) + Length2 * sin(
1 +
2 )
The aim is to invert this equation and express the
values using the
known values. Assuming we are keeping the pivot point of the first link
stationary, we already know the value of Pivot1.
Using the trigonometric identities
cos(
1 +
2 ) = cos(
1 )cos(
2 ) - sin(
1 )sin(
2 )
sin(
1 +
2 ) = cos(
1 )sin(
2 ) + sin(
1 )cos(
2 )
We can restate the equations as
Target. x = Pivot1. x + Length1 * cos(
1 ) + Length2 * (cos(
1 )cos(
2 )
2 ))
Target. y = Pivot1. x + Length1 * sin(
- sin(
1 )sin(
1 ) + Length2 * (cos(
1 )sin(
2 )
+ sin(
1 )cos(
2 ))
Another useful trigonometric identity is
cos 2 (
) + sin 2 (
) = 1
Search Nedrilad ::




Custom Search