41
Inverse Kinematics Inverse Kinematics

Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

  • View
    221

  • Download
    3

Embed Size (px)

Citation preview

Page 1: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Inverse KinematicsInverse Kinematics

Page 2: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

OverviewOverview

What is IK?What is IK?

Important concepts in IKImportant concepts in IK

The role of IK in game developmentThe role of IK in game development

Page 3: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

What is IK?What is IK?

Forward Kinematics (FK) Forward Kinematics (FK) Incrementally manipulating each of the component parts of a flexible, jointed Incrementally manipulating each of the component parts of a flexible, jointed object to achieve an overall, desired pose.object to achieve an overall, desired pose.

Mathematically is concerned with finding the position of the end effector, Mathematically is concerned with finding the position of the end effector, given the angle of the joints and the length of each articulated segment.given the angle of the joints and the length of each articulated segment.

Page 4: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

FK EquationFK Equation

Page 5: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

FK EquationFK Equation

Page 6: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

FK EquationFK EquationExpression for P1:Expression for P1:

Page 7: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

FK EquationFK EquationExpression for P2:Expression for P2:

Page 8: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

FK EquationFK EquationExpanded, FK Solution for P2:Expanded, FK Solution for P2:

Page 9: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Drawing Kinematic ChainsDrawing Kinematic Chains

Drawing kinematic chains requires that the links are drawn from the outermost link to the innermost.

The positioning of each link requires translations and rotations from each other link prior to it.

Page 10: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Drawing Kinematic ChainsDrawing Kinematic ChainsStarting with the effector’s object:Starting with the effector’s object:

Page 11: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Drawing Kinematic ChainsDrawing Kinematic ChainsStarting with the effector’s object:Starting with the effector’s object:

Translate by lengthTranslate by length

Page 12: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Drawing Kinematic ChainsDrawing Kinematic ChainsStarting with the effector’s object:Starting with the effector’s object:

Translate by lengthTranslate by length Rotate by angleRotate by angle

Page 13: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Drawing Kinematic ChainsDrawing Kinematic ChainsStarting with the effector’s object:Starting with the effector’s object:

Now translate by the length of the next link…Now translate by the length of the next link…

Page 14: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Drawing Kinematic ChainsDrawing Kinematic ChainsStarting with the effector’s object:Starting with the effector’s object:

Now translate by the length of the next link…Now translate by the length of the next link… … … and rotate the entire chain by the angle of that linkand rotate the entire chain by the angle of that link

Page 15: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Drawing Kinematic ChainsDrawing Kinematic ChainsStarting with the effector’s object:Starting with the effector’s object:

Translate again by the length of the next link in the chain…Translate again by the length of the next link in the chain…

Page 16: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Drawing Kinematic ChainsDrawing Kinematic ChainsStarting with the effector’s object:Starting with the effector’s object:

Translate again by the length of the next link in the chain…Translate again by the length of the next link in the chain… … … and rotate the entire chain by that link’s angleand rotate the entire chain by that link’s angle

Page 17: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Drawing Kinematic ChainsDrawing Kinematic ChainsStarting with the NEXT link’s object:Starting with the NEXT link’s object:

Page 18: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Drawing Kinematic ChainsDrawing Kinematic ChainsStarting with the NEXT link’s object:Starting with the NEXT link’s object:

Translate by the object’s length…Translate by the object’s length… Rotate by the object’s angle.Rotate by the object’s angle.

Page 19: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Drawing Kinematic ChainsDrawing Kinematic ChainsStarting with the NEXT link’s object:Starting with the NEXT link’s object:

Translate by the next object’s length…Translate by the next object’s length…

Page 20: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Drawing Kinematic ChainsDrawing Kinematic ChainsStarting with the NEXT link’s object:Starting with the NEXT link’s object:

Translate by the next object’s length…Translate by the next object’s length… And rotate the entire chain by that object’s angle.And rotate the entire chain by that object’s angle.

Page 21: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Drawing Kinematic ChainsDrawing Kinematic ChainsSo on, and so forth…So on, and so forth…

Place the next linkPlace the next link

Page 22: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Drawing Kinematic ChainsDrawing Kinematic ChainsSo on, and so forth…So on, and so forth…

Place the next linkPlace the next link translatetranslate

Page 23: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Drawing Kinematic ChainsDrawing Kinematic ChainsSo on, and so forth until chain is complete.So on, and so forth until chain is complete.

Place the next linkPlace the next link TranslateTranslate RotateRotate

Page 24: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Inverse KinematicsInverse Kinematics

Now that we know generally what Forward Now that we know generally what Forward Kinematics are, how do we define Kinematics are, how do we define

Inverse Kinematics?Inverse Kinematics?

Page 25: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Inverse KinematicsInverse Kinematics

Forward Kinematics (FK) Forward Kinematics (FK) Mathematically determining the Mathematically determining the

position and angle of joints in a position and angle of joints in a

series of flexible, jointed objects series of flexible, jointed objects

after determining the position and after determining the position and

orientation of the end effector. orientation of the end effector.

Page 26: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Inverse KinematicsInverse Kinematics

What is IK used for?What is IK used for?

Originally used in industrial robotics for Originally used in industrial robotics for assembly plantsassembly plants

In game design, IK is typically used most In game design, IK is typically used most often in character animationoften in character animation

Page 27: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Types of IK SolutionsTypes of IK Solutions

Closed Form / AnalyticalClosed Form / Analytical Calculates the angle from the root to the effector, and allows us to determine Calculates the angle from the root to the effector, and allows us to determine

immediately if a solution is even available. Then using trig identities, we can immediately if a solution is even available. Then using trig identities, we can develop an equation that can determine any number of possible solutions. develop an equation that can determine any number of possible solutions. Consider the example below for a two link chain:Consider the example below for a two link chain:

Relatively simple solution for smaller problems.Relatively simple solution for smaller problems.

However, as the chain increases in the number of elements adding new However, as the chain increases in the number of elements adding new degrees of freedom, the problem quickly becomes very complex.degrees of freedom, the problem quickly becomes very complex.

Closed Form / Analytical SolutionClosed Form / Analytical Solution Calculates the angle from the root to the effector, allowing us to determine Calculates the angle from the root to the effector, allowing us to determine

immediately if a solution is even available. immediately if a solution is even available.

Page 28: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Types of IK SolutionsTypes of IK Solutions

Cyclic-Coordinate DescentCyclic-Coordinate Descent First defined by Chris Welmen, borrowing from work by Li-Chun Tommy First defined by Chris Welmen, borrowing from work by Li-Chun Tommy

Wang and Chih Cheng Chen in a paper titled IEEE Transactions on Wang and Chih Cheng Chen in a paper titled IEEE Transactions on Robotics and AutomationRobotics and Automation

Minimizes the possibility of system error by adjusting each joint angle Minimizes the possibility of system error by adjusting each joint angle one at a timeone at a time

Page 29: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Types of IK SolutionsTypes of IK SolutionsCyclic-Coordinate DescentCyclic-Coordinate Descent

- Starting with the root of our effector, R, to our current endpoint, E.- Starting with the root of our effector, R, to our current endpoint, E.

- Next, we draw a vector from R to our desired endpoint, D- Next, we draw a vector from R to our desired endpoint, D

- The inverse cosine of the dot product gives us the angle between the vectors: cos(a) = RD - The inverse cosine of the dot product gives us the angle between the vectors: cos(a) = RD ●● RERE

Page 30: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Types of IK SolutionsTypes of IK SolutionsCyclic-Coordinate DescentCyclic-Coordinate DescentRotate our link so that RE falls on RDRotate our link so that RE falls on RD

Page 31: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Types of IK SolutionsTypes of IK SolutionsCyclic-Coordinate DescentCyclic-Coordinate DescentMove one link up the chain, and repeat the processMove one link up the chain, and repeat the process

Page 32: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Types of IK SolutionsTypes of IK SolutionsCyclic-Coordinate DescentCyclic-Coordinate Descent

The process is basically repeated until the root joint is reached. Then the process begins all over The process is basically repeated until the root joint is reached. Then the process begins all over again starting with the end effector, and will continue until we are close enough to D for an again starting with the end effector, and will continue until we are close enough to D for an acceptable solution. acceptable solution.

Page 33: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Types of IK SolutionsTypes of IK SolutionsCyclic-Coordinate DescentCyclic-Coordinate Descent

Page 34: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Types of IK SolutionsTypes of IK SolutionsCyclic-Coordinate DescentCyclic-Coordinate Descent

We’ve reached the root. Repeat the processWe’ve reached the root. Repeat the process

Page 35: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Types of IK SolutionsTypes of IK SolutionsCyclic-Coordinate DescentCyclic-Coordinate Descent

Page 36: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Types of IK SolutionsTypes of IK SolutionsCyclic-Coordinate DescentCyclic-Coordinate Descent

Page 37: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Types of IK SolutionsTypes of IK SolutionsCyclic-Coordinate DescentCyclic-Coordinate Descent

Page 38: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Types of IK SolutionsTypes of IK SolutionsCyclic-Coordinate DescentCyclic-Coordinate Descent

Page 39: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Types of IK SolutionsTypes of IK SolutionsCyclic-Coordinate DescentCyclic-Coordinate Descent

Page 40: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Types of IK SolutionsTypes of IK SolutionsCyclic-Coordinate DescentCyclic-Coordinate Descent

We’ve reached the root again. Repeat the process until solution reached.We’ve reached the root again. Repeat the process until solution reached.

Page 41: Inverse Kinematics. Overview What is IK? Important concepts in IK The role of IK in game development

Using IK in Game DevelopmentUsing IK in Game Development

Examples of IK in action:Examples of IK in action: Character Animation Demo (Softimage XSI Character Animation Demo (Softimage XSI

5.0)5.0)

Real-Time calculations: E3 2003 Demo Real-Time calculations: E3 2003 Demo Footage of Half-Life 2Footage of Half-Life 2