- Hands-On C++ Game Animation Programming
- Gabor Szauer
- 199字
- 2021-06-30 14:45:49
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
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.
- Oracle從入門到精通(第3版)
- Mastering OpenCV Android Application Programming
- 造個小程序:與微信一起干件正經(jīng)事兒
- Implementing Cisco Networking Solutions
- Windows Presentation Foundation Development Cookbook
- Building a Quadcopter with Arduino
- HDInsight Essentials(Second Edition)
- 愛上C語言:C KISS
- 大學(xué)計算機(jī)應(yīng)用基礎(chǔ)(Windows 7+Office 2010)(IC3)
- Python第三方庫開發(fā)應(yīng)用實(shí)戰(zhàn)
- 百萬在線:大型游戲服務(wù)端開發(fā)
- 體驗(yàn)之道:從需求到實(shí)踐的用戶體驗(yàn)實(shí)戰(zhàn)
- 區(qū)塊鏈:技術(shù)與場景
- GO語言編程從入門到實(shí)踐
- Mastering Wireless Penetration Testing for Highly Secured Environments