- Hands-On C++ Game Animation Programming
- Gabor Szauer
- 238字
- 2021-06-30 14:46:00
Chapter 4: Implementing Quaternions
In this chapter, you will learn about quaternions. Quaternions are used to encode rotations. A quaternion is a complex number in an xi + yj + zk + w form. Think of i, j,
and k as placeholders that each represent a three-dimensional axis. w is a real number. While quaternions don't directly encode an angle axis pair, it's easy to think of them
as just that—a rotation about an arbitrary axis.
By the end of this chapter, you should have a strong understanding of what quaternions are and how to use them and you will have implemented a robust quaternion class in code. This chapter will cover the following topics:
- Different methods for creating quaternions
- Retrieving the angle and axis of a quaternion
- Basic component-wise operations
- The length and dot product of two quaternions
- Inverting quaternions
- Combining quaternions
- Transforming vectors by quaternions
- Interpolating between quaternions
- Converting quaternions and matrices
Why are quaternions important? Most humanoid animations are created using only rotations—no translation or scale is needed. Think about an elbow joint, for example. The natural motion of an elbow only rotates. If you want to translate the elbow through space, you rotate the shoulder. Quaternions encode rotations and they interpolate well.
Important information:
In this chapter, you will implement quaternions with an intuitive, code-first approach. If you are interested in the more formal math behind quaternions, check out https://gabormakesgames.com/quaternions.html.
- 零基礎(chǔ)搭建量化投資系統(tǒng):以Python為工具
- MySQL數(shù)據(jù)庫應(yīng)用與管理 第2版
- Android Development with Kotlin
- Python GUI Programming Cookbook
- TypeScript實戰(zhàn)指南
- 軟件項目管理實用教程
- Spring Boot進(jìn)階:原理、實戰(zhàn)與面試題分析
- Teaching with Google Classroom
- AppInventor實踐教程:Android智能應(yīng)用開發(fā)前傳
- Learning OpenStack Networking(Neutron)
- Java系統(tǒng)化項目開發(fā)教程
- Mobile Device Exploitation Cookbook
- Python商務(wù)數(shù)據(jù)分析(微課版)
- OpenCV Android開發(fā)實戰(zhàn)
- Getting Started with React VR