Book Image

Hands-On C++ Game Animation Programming

By : Gabor Szauer
Book Image

Hands-On C++ Game Animation Programming

By: Gabor Szauer

Overview of this book

Animation is one of the most important parts of any game. Modern animation systems work directly with track-driven animation and provide support for advanced techniques such as inverse kinematics (IK), blend trees, and dual quaternion skinning. This book will walk you through everything you need to get an optimized, production-ready animation system up and running, and contains all the code required to build the animation system. You’ll start by learning the basic principles, and then delve into the core topics of animation programming by building a curve-based skinned animation system. You’ll implement different skinning techniques and explore advanced animation topics such as IK, animation blending, dual quaternion skinning, and crowd rendering. The animation system you will build following this book can be easily integrated into your next game development project. The book is intended to be read from start to finish, although each chapter is self-contained and can be read independently as well. By the end of this book, you’ll have implemented a modern animation system and got to grips with optimization concepts and advanced animation techniques.
Table of Contents (17 chapters)

Creating a FABRIK solver

FABRIK (Forward And Backward Reaching Inverse Kinematics) has a more natural, humanoid looking convergence. Like CCD, FABRIK works with an IK chain that has a base, end effector, and target to reach for. Unlike CCD, FABRIK works with positions, not rotations. The FABRIK algorithm is easier to understand since it can be implemented using only vectors.

In many ways, FABRIK can be used as a drop-in replacement for CCD. Both algorithms address the same problem, but they take different approaches to address it. FABRIK tends to converge faster and look better for humanoid animation, so you will probably use it as the solver for character limbs.

Working with positions instead of rotations will not work well when it comes to humanoid rigs, which need to be animated by rotating joints. This can be solved by adding a pre- and post-process step to the algorithm. The pre-process step will convert all transforms in the IK chain into world space position vectors....