三维空间中的向量
(Vectors in 3-Space)
向量的表示
we represent a vector as a directed line segment
《3D游戏编程大师技巧》
向量是从一个点到另一个点的有向线段。
向量是用起点和终点定义的,只需定义3D 空间中向量的终点,该向量的起点总是(0, 0, 0)。
向量u 从p1 指向p2,则 u = p2 – p1 = <x2-x1, y2-y1>
向量的两个属性
The two properties of vectors: length, magnitude
用向量来表示粒子的速度和加速度
We use vectors to model the velocity and acceleration of our particles. Other times in 3D computer graphics we use vectors to model directions only.
单位向量
A vector with a magnitude of one is called a unit vector.
向量相等
Since location is not a property of vectors, two vectors that have the same length and point in the same direction are considered equal,even if they are in different locations.
四个特殊的3D 向量
zero vector零向量:
it is denoted by a bold zero: 0 = (0, 0, 0).
standard basis vectors 标准基向量:
The next three special vectors are referred to as the standard basis vectors for R3.
These vectors, called the i, j, and k vectors, run along the x-, y-, and z-axis of our coordinate system, respectively, and have a magnitude of one: i = (1, 0, 0), j = (0, 1, 0), and k = (0, 0, 1).
左手坐标系和右手坐标系
(left-handed rectangular coordinate system and right-handed rectangular coordinate system)
如果你观察屏幕的方向是Z 轴正方向的话,这个屏幕的笛卡尔坐标系加上Z轴一起构成了左手坐标系。
The difference between the two is the directions in which the positive z-axis runs. In the left-handed system, the positive z-axis goes into the page. In the right-handed system, the positive z-axis comes out of the page.
将向量平移到标准位置
When a vector’s tail coincides with the origin it is in standard position.
(注:Coincide: To correspond exactly)
区分对点和向量的描述 (处于标准位置的向量只需描述其head,用于描述向量的坐标称为分量component)
Because we can describe a vector in standard position by specifying the coordinates of the vector’s head, as if we are describing a point, it is easy to confuse points and vectors.
A point describes only a location in the coordinate system, whereas a vector describes a magnitude and a direction.
计算向量长度
||u|| = sqrt(ux + uy, + uz)
数乘
Ku = (kux + kuy, + kuz)
点积
点积的结果是标量,可用来做两向量的垂直测式。u*v = ||u|| * ||v|| * cos
叉积的结果是同时垂直于两向量的第三个向量