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)

Understanding skinning

Skinning is the process of specifying which vertex should be deformed by which bone. One vertex can be influenced by multiple bones. Rigid skinning refers to associating each vertex with exactly one bone. Smooth skinning associates vertices with multiple bones.

Typically, the vertex-to-bone mapping is done per vertex. This means each vertex knows which bones it belongs to. Some file formats, store this relationship in reverse, where each bone contains a list of vertices it affects. Both approaches are valid; throughout the rest of this book, the mapping is done per vertex.

To (rigid) skin a mesh, assign each vertex to a bone. To assign a joint to a vertex in code, add a new attribute to each vertex. This attribute is just an integer that holds the index of the bone that deforms the vertex. In the following figure, all the triangles that should be assigned to the lower-left arm bone are colored darker than the rest of the mesh:

Figure...