Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On C++ Game Animation Programming

You're reading from   Hands-On C++ Game Animation Programming Learn modern animation techniques from theory to implementation with C++ and OpenGL

Arrow left icon
Product type Paperback
Published in Jun 2020
Publisher Packt
ISBN-13 9781800208087
Length 368 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Gabor Szauer Gabor Szauer
Author Profile Icon Gabor Szauer
Gabor Szauer
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Chapter 1: Creating a Game Window 2. Chapter 2: Implementing Vectors FREE CHAPTER 3. Chapter 3: Implementing Matrices 4. Chapter 4: Implementing Quaternions 5. Chapter 5: Implementing Transforms 6. Chapter 6: Building an Abstract Renderer 7. Chapter 7: Exploring the glTF File Format 8. Chapter 8: Creating Curves, Frames, and Tracks 9. Chapter 9: Implementing Animation Clips 10. Chapter 10: Mesh Skinning 11. Chapter 11: Optimizing the Animation Pipeline 12. Chapter 12: Blending between Animations 13. Chapter 13: Implementing Inverse Kinematics 14. Chapter 14: Using Dual Quaternions for Skinning 15. Chapter 15: Rendering Instanced Crowds 16. Other Books You May Enjoy

Introducing vectors

What is a vector? A vector is an n-tuple of numbers. It represents a displacement measured as a magnitude and a direction. Each element of a vector is usually expressed as a subscript, such as (V0, V1, V2, … VN). In the context of games, vectors usually have two, three, or four components.

For example, a three-dimensional vector measures displacement on three unique axes: x, y, and z. Elements of vectors are often subscripted with the axis they represent, rather than an index. (VX, VY, VZ) and (V0, V1, V2) are used interchangeably.

When visualizing vectors, they are often drawn as arrows. The position of the base of an arrow does not matter because vectors measure displacement, not a position. The end of the arrow follows the displacement of the arrow on each axis.

For example, all of the arrows in the following figure represent the same vector:

Figure 2.1: Vector (2, 5) drawn in multiple locations

Figure 2.1: Vector (2, 5) drawn in multiple locations

Each arrow has the same length and points in the same direction, regardless of where it is positioned. In the next section, you will start to implement the vector structure that will be used throughout the rest of this book.

You have been reading a chapter from
Hands-On C++ Game Animation Programming
Published in: Jun 2020
Publisher: Packt
ISBN-13: 9781800208087
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime