本文写作动机主要在于老师上课中英文交杂,听不懂的太多QwQ
主要用于个人学习和整理
目录
Geometry
Basic Elements
scalars
vectors
-direction(方向)
-magnitude(大小)
(1)operations:
(a) inverse(取相反)
(b) be multipiled by a scalar
(c)zero vector: undefined orientation
(d) sum of two vectors is vector
(减法这里本质就是inverse+sum)
(2)Linear Vector Spaces
本质为向量的集合
operations:
上面的(b)(d)
(3)向量空间不适合几何
因为没有position
points
Location in space
(1)operations : between points and vectors
(a) v=P-Q
(b) P=v+Q
(v:vector P.Q:points)
Affine Spaces(仿射空间)
Point + a vector space
operations
标量
(a)标量间的运算
向量
(b)标量x向量
(c)向量加法(含减法)
点
(d)点+向量=点 点-点=向量
(e)定义:1·P=P
(f)定义:0·P=
0
⃗
\vec{0}
0
我们看到,在定义中没有Point类型的加减运算,也没有scalar*point这类运算。
但是实际中,我们常常见到 α 1 p 1 + α 2 p 2 \alpha_1p_1+\alpha_2p_2 α1p1+α2p2这样的公式。首先说明,这类公式是有意义的,原因在于它们的出现是由point+vector这类运算推导出来的,具体可以接着往下看,会逐渐明白的。
Rays and Line Segments
P( a) = Q + a (R-Q)=Q+av
=aR + (1-a)Q
(点=点+向量–>点=点+点)
Convexity
凸:当且仅当 P.Q属于该多边形,但是线段PQ不完全属于该多边形
Affine Sums(仿射和)
P1、P2…都是仿射空间中的点,
(1)上式中的P是point 当且仅当 右式系数和为1
证明:
P
=
α
1
P
1
+
α
2
P
2
+
.
.
.
+
α
n
P
n
;
⇔
P
=
α
1
(
P
1
−
P
2
)
+
(
α
1
+
α
2
)
(
P
2
−
P
3
)
+
(
α
1
+
α
2
+
α
3
)
(
P
2
−
P
3
)
+
.
.
.
+
(
α
1
+
.
.
.
+
α
n
)
(
P
n
−
1
−
P
n
)
+
(
α
1
+
.
.
.
+
α
n
)
P
n
;
∵
P
o
i
n
t
−
P
o
i
n
t
=
V
e
c
t
o
r
S
c
a
l
a
r
∗
V
e
c
t
o
r
=
V
e
c
t
o
r
∴
令
(
α
1
+
.
.
.
+
α
i
)
(
P
i
−
P
i
+
1
)
=
V
⃗
i
∴
P
=
V
⃗
1
+
V
⃗
2
+
.
.
.
+
V
⃗
n
−
1
+
(
α
1
+
.
.
.
+
α
n
)
P
n
∵
V
e
c
t
o
r
+
V
e
c
t
o
r
=
V
e
c
t
o
r
∴
令
V
⃗
1
+
V
⃗
2
+
.
.
.
+
V
⃗
n
−
1
=
V
⃗
∴
P
=
V
⃗
+
(
α
1
+
.
.
.
+
α
n
)
P
n
P=\alpha_1P_1+\alpha_2P_2+...+\alpha_nP_n;\\ \Leftrightarrow \\P=\alpha_1(P_1-P_2)+(\alpha_1+\alpha_2)(P_2-P_3)+(\alpha_1+\alpha_2+\alpha_3)(P_2-P_3)+...\\+(\alpha_1+...+\alpha_n)(P_{n-1}-P_n)+(\alpha_1+...+\alpha_n)P_n;\\ \quad \\ \because Point-Point=Vector \quad Scalar*Vector=Vector\\ \therefore 令(\alpha_1+...+\alpha_i)(P_i-P_{i+1})=\vec V_i\\ \therefore P=\vec V_1+\vec V_2+...+\vec V_{n-1}+(\alpha_1+...+\alpha_n)P_n\\ \because Vector+Vector=Vector\\ \therefore 令\vec V_1+\vec V_2+...+\vec V_{n-1}=\vec V\\ \therefore P=\vec V+(\alpha_1+...+\alpha_n)P_n\\
P=α1P1+α2P2+...+αnPn;⇔P=α1(P1−P2)+(α1+α2)(P2−P3)+(α1+α2+α3)(P2−P3)+...+(α1+...+αn)(Pn−1−Pn)+(α1+...+αn)Pn;∵Point−Point=VectorScalar∗Vector=Vector∴令(α1+...+αi)(Pi−Pi+1)=Vi∴P=V1+V2+...+Vn−1+(α1+...+αn)Pn∵Vector+Vector=Vector∴令V1+V2+...+Vn−1=V∴P=V+(α1+...+αn)Pn
⇒
P
是
P
o
i
n
t
则
右
式
系
数
和
为
1
∵
(
α
1
+
.
.
.
+
α
n
)
P
n
=
P
−
V
⃗
且
P
是
P
o
i
n
t
∴
(
α
1
+
.
.
.
+
α
n
)
P
n
是
P
o
i
n
t
∵
1
⋅
P
o
i
n
t
=
P
o
i
n
t
∴
(
α
1
+
.
.
.
+
α
n
)
=
1
\Rightarrow P是Point 则 右式系数和为1\\ \because (\alpha_1+...+\alpha_n)P_n=P-\vec V 且P是Point\\ \therefore (\alpha_1+...+\alpha_n)P_n是Point\\ \because 1 \cdot Point=Point\\ \therefore (\alpha_1+...+\alpha_n)=1\\
⇒P是Point则右式系数和为1∵(α1+...+αn)Pn=P−V且P是Point∴(α1+...+αn)Pn是Point∵1⋅Point=Point∴(α1+...+αn)=1
⇐
右
式
系
数
和
为
1
则
P
是
P
o
i
n
t
∵
(
α
1
+
.
.
.
+
α
n
)
=
1
且
P
n
是
P
o
i
n
t
∴
P
′
=
(
α
1
+
.
.
.
+
α
n
)
P
n
=
1
⋅
P
n
=
P
n
∴
P
=
V
⃗
+
P
′
∴
P
是
P
o
i
n
t
\Leftarrow 右式系数和为1 则P是Point\\ \because (\alpha_1+...+\alpha_n)=1 且 P_n是Point\\ \therefore P'= (\alpha_1+...+\alpha_n)P_n=1\cdot P_n=P_n\\ \therefore P=\vec V+P'\\ \therefore P是Point
⇐右式系数和为1则P是Point∵(α1+...+αn)=1且Pn是Point∴P′=(α1+...+αn)Pn=1⋅Pn=Pn∴P=V+P′∴P是Point
(2)若a1,a2,…系数都 ≥0 ,则我们能够获得由P1,P2…构成的凸包
证明:(待更新)
planes
一个平面可以由一个点和两个向量或三个点定义
Representation
到目前为止,我们已经能够在不使用任何参考系(如坐标系)的情况下处理几何实体。但是在描述点的时候,我们仍需要一个坐标系。
Dimension
在向量空间中,线性无关向量的最大数目是固定的,称为空间的维数
Representation
注意,这种表示是关于一个特定的基的
Frames
(这里没有读懂)
homogeneous coordinate(齐次坐标系)
起因在于Points和vector会出现confuse
并且一个三维矩阵无法表示空间中的所有变换(见TOPIC 3)
齐次坐标是所有计算机图形系统的关键
(1)所有的标准变换(旋转,平移,缩放)都可以通过使用4 × 4矩阵的矩阵乘法来实现
(2)对于正交观察,我们可以保持vector的w=0,point的w=1
二维坐标系到三维齐次坐标的变换:
(
X
,
Y
,
w
)
−
−
>
(
x
,
y
)
:
x
=
X
w
,
y
=
Y
w
(
x
,
y
)
−
−
>
(
X
,
Y
,
w
)
:
w
=
1
,
X
=
x
,
Y
=
y
(X,Y,w)-->(x,y) :x=\frac{X}w, y=\frac{Y}w \\ (x,y)-->(X,Y,w) : w=1,X=x,Y=y
(X,Y,w)−−>(x,y):x=wX,y=wY(x,y)−−>(X,Y,w):w=1,X=x,Y=y
齐次坐标的意义
无穷远处的点在欧氏空间中无法具体展示。
在投影空间中,平行线会在无穷远处相遇,但在欧氏空间中却做不到。
因此此处引入齐次坐标。
(上图参考:知乎:齐次坐标ikuku回答)
任何N维度齐次坐标,只要W不为0,都可以通过将每一个分量除以W来转换到 W=1的向量, 然后获得其N-1维的欧式空间的点值。
而当W=0时,这个坐标表示无限长的一个向量,通常表示N-1维的矢量。
(这里我有一点没有明白,我懂得w=0表示无穷远处一个点,但是为什么向量可以用w=0表示没有想明白)
Change of Coordinate Systems
坐标系的转化
三维坐标系
其中a是w在第一个坐标系(v1,v2,v3)中的representation,b是w在(u1,u2,u3)中的representation。
齐次坐标系
Summary
新坐标系返回旧坐标系:
[
x
y
z
1
]
=
[
X
1
′
Y
1
′
Z
1
′
Q
0
x
X
2
′
Y
2
′
Z
2
′
Q
0
y
X
3
′
Y
3
′
Z
3
′
Q
0
z
0
0
0
1
]
[
x
′
y
′
z
′
1
]
\begin{bmatrix} x \\ y \\ z \\ 1\\ \end{bmatrix}= \begin{bmatrix} X'_1 &Y'_1& Z'_1& Q_{0x} \\ X'_2 &Y'_2 &Z'_2 & Q_{0y} \\ X'_3 & Y'_3 & Z'_3 & Q_{0z} \\ 0 & 0 & 0 & 1 \\ \end{bmatrix}\begin{bmatrix} x' \\ y' \\ z' \\ 1\\ \end{bmatrix}
⎣⎢⎢⎡xyz1⎦⎥⎥⎤=⎣⎢⎢⎡X1′X2′X3′0Y1′Y2′Y3′0Z1′Z2′Z3′0Q0xQ0yQ0z1⎦⎥⎥⎤⎣⎢⎢⎡x′y′z′1⎦⎥⎥⎤
Affine Transformations
(1)每个线性变换都等价于坐标系中的变化
指坐标系中的几何体、点、向量的变换,都可以看作是坐标系的转动
(2)每个仿射变换都保留直线
(这里没有懂)
(3)然而,一个仿射变换只有12个自由度,因为矩阵中的4个元素是固定的,并且是所有可能的4x4线性变换的子集
The World and Camera Frames
Moving the Camera