http://www.newtek.com/3d/tutorial/character1/ik.html (Amiga Plus Extra No. 5/97, 05/1997)
Setting Up Inverse Kinematics
Once we have the skeleton finished, the next step is to set up IK. This will include teaching the skeleton what it's limit are and setting the IK goals.
We are now going to teach each bone how much it is allowed to rotate. This will help keep items such as knees from hyper-extending. It also makes it easier for LightWave to calculate the skeletons motion by reducing the number of possible IK solutions. Teaching a bone its limits consists of entering two rotation values, a miminum limit and a maximum limit. This can either be done interactively through layout, or if the exact values are known, through the IK panel.
- Select Bone (1) and use Mouse -> Rotate to rotate the leg backwards until the display shows a pitch of 55 degrees. Now hit Shift + Open Bracket < Shift + [ > on the keyboard. This sets the minimum pitch rotation limit to 55 degrees. Rotate the leg forward to 205 degrees and hit Shift + Close Bracket < Shift + ] > on the keyboard. This sets the maximum pitch rotation limit to 205 degrees. To reset the bone back to its normal position, hit Shift + Right Arrow for Next KeyFrame or select Reset from the layout controls.
- Check the results of step 1 by hitting the i key < i > on the keyboard. This will open the Inverse Kinematics panel. See Figure 5. Make sure the values match those entered in step 1. If we made a mistake, or we would have know the exact values for the limits, we could have entered them directly using this panel. Close the IK panel with the continue button.
- Enter the following values for the rest of the leg. You can do this interactively or through the IK panel.
|
Minimum Pitch Limit
|
Maximum Pitch Limit
|
Bone (2):
|
-115 degrees
|
-10 degrees
|
Bone (3):
|
25 degrees
|
145 degrees
|
Bone (4):
|
0 degrees
|
0 degrees
|
Note: These numbers are arbitrary, please don't send flames about impossible joint rotations beyond the limit of any human on the planet. It looked good, so we left them! Also, most joints have multiple degrees of freedom. To simplify this tutorial we have chosen to limit the joints to pitch only.
- To make the leg move, we have to set up at least one IK goal. In LightWave these IK goals can be any object. To make things easier we use Null Objects. Select Objects Panel -> Add Null Object. This will create a Null object that can be used as a goal for an IK chain. Go back to Layout by selecting continue.
- From Layout Select Bone (4). If you have difficulty doing this, make sure to select the Leg.lwo object first with Edit -> Objects, then select Edit -> Bones. When Bone (4) is selected, open the IK panel by using the i key. From the Goal Object Pop-Up select Null as the goal object. Leave the goal strength at 1, and select Full-Time IK. By setting the Null object as the goal, you have told Bone (4) to reach out and try to "touch" or attain the goals position. In doing this, it will cause the entire leg to rotate with it. When you close the IK panel, you should see the leg rotate into position to reach the goal.
- Select the Null object and begin moving it around. You will see the leg move along with it. Try moving the leg instead, you should see the leg reach out and point at the null. You may notice that leg is a bit jumpy in some positions. This happens because there are a number of different solutions for the leg to reach the position of the goal. There are a couple of ways to solve this. If the bones did not have Rotation Limits set, this would be one of the first places that we would check. Since we have already done this, so let's move on to the next solution. Multiple goals!
- Add a second null object with Object Panel -> Add Null Object. This will add a null object called Null (2). This Null could be used as a goal for two key areas along the leg, either the knee joint, or the ankle joint. For this tutorial we have chosen the ankle joint. After the tutorial is finished, you might want to play around with using the second goal on the knee.
- Select Bone (3), open the IK panel and select Null (2) as the goal object. Be sure to turn Full-Time IK on. Close the IK panel.
- Select Null (2) and Move it around. We can see that Null (2) now controls the leg and the foot continues to point at Null (1). In using this set-up, Null (2) now becomes the main goal of the leg while Null (1) can be used as a fine tune control over the foot.
- If this leg were going to walk, you wouldn't want to have to keep moving Null (1) to keep it up with the rest of the leg. In the case of this animation, it make sense to parent Null (1) to Null (2). You can do this by selecting Null (1) and then by selecting Parent from Layout. From the Parent requester, choose Null (2) as the parent. From Layout Move Null (1) about a foot's distance from Null (2) and create a KeyFrame at frame 0. See Figure 6.
- Select Null (2) again and move it around. We can see that by parenting the two we have the added benifit of keeping the foot level. Try Moving the Leg object around, it will also react appropriately to the goals.