Introduction to Computer Graphics – Modeling (1) –
April 13, 2017 Kenshi Takayama
Introduction to Computer Graphics Modeling (1) April 13, 2017 - - PowerPoint PPT Presentation
Introduction to Computer Graphics Modeling (1) April 13, 2017 Kenshi Takayama Parametric curves X & Y coordinates defined by parameter t ( time) Example: Cycloid = sin = 1 cos
April 13, 2017 Kenshi Takayama
𝑦 𝑢 = 𝑢 − sin 𝑢 𝑧 𝑢 = 1 − cos 𝑢
2
3
𝑦 0 = 𝑦0 𝑦 1 = 𝑦1 𝑦′(0) = 𝑦0
′
𝑦′ 1 = 𝑦1
′
𝑦 0 = 𝑏0 = 𝑦0 𝑦 1 = 𝑏0 + 𝑏1 + 𝑏2 + 𝑏3 = 𝑦1 𝑦′ 0 = 𝑏1 = 𝑦0
′
𝑦′ 1 = 𝑏1 + 2 𝑏2 + 3 𝑏3 = 𝑦1
′
𝑏0 = 𝑦0 𝑏1 = 𝑦0
′
𝑏2 = −3 𝑦0 + 3 𝑦1 − 2 𝑦0
′ − 𝑦1 ′
𝑏3 = 2 𝑦0 − 2 𝑦1 + 𝑦0
′ + 𝑦1 ′ t x 1
1, 𝑄2
arbitrary domain (2D, 3D, ...)
1
4
𝑄 𝑢 = 1 − 𝑢 𝑄0 + 𝑢 𝑄2 𝑄 𝑢 = ? 𝑄
1
𝑄2 𝑄0
t=0 t=1
1
12 𝑢 = 1 − 𝑢 𝑄 1 + 𝑢 𝑄2
12 1 = 𝑄2
As 𝑢 changes 0 → 1 , smoothly transition from 𝑄01 to 𝑄
12
12 𝑢
= 1 − 𝑢 1 − 𝑢 𝑄0 + 𝑢 𝑄
1 + 𝑢
1 − 𝑢 𝑄
1 + 𝑢 𝑄2
= 1 − 𝑢 2𝑄0 + 2𝑢 1 − 𝑢 𝑄
1 + 𝑢2𝑄2
5
𝑄
1
𝑄2 𝑄0 𝑄
12 𝑢 𝑢 𝑢 𝑢 1 − 𝑢 1 − 𝑢
𝑄01 𝑢 𝑄012 𝑢
1 − 𝑢 Quadratic Bezier curve
1
12 𝑢 = 1 − 𝑢 𝑄 1 + 𝑢 𝑄2
12 1 = 𝑄2
As 𝑢 changes 0 → 1 , smoothly transition from 𝑄01 to 𝑄
12
12 𝑢
= 1 − 𝑢 1 − 𝑢 𝑄0 + 𝑢 𝑄
1 + 𝑢
1 − 𝑢 𝑄
1 + 𝑢 𝑄2
= 1 − 𝑢 2𝑄0 + 2𝑢 1 − 𝑢 𝑄
1 + 𝑢2𝑄2
6
𝑄
1
𝑄2 𝑄0
Quadratic Bezier curve
1, 𝑄2 𝑄3:
123
123 𝑢
= 1 − 𝑢
1 − 𝑢 2𝑄0 + 2𝑢 1 − 𝑢 𝑄
1 + 𝑢2𝑄2 + 𝑢
1 − 𝑢 2𝑄
1 + 2𝑢 1 − 𝑢 𝑄2 + 𝑢2𝑄 3
= 1 − 𝑢 3𝑄0 + 3𝑢 1 − 𝑢 2𝑄
1 + 3𝑢2 1 − 𝑢 𝑄2 + 𝑢3𝑄3
7
𝑄
123 𝑢
𝑄012 𝑢 𝑄0123 𝑢
𝑢 1 − 𝑢
𝑄
1
𝑄3 𝑄0 𝑄2
Cubic Bezier curve
1, 𝑄2 𝑄3:
123
123 𝑢
= 1 − 𝑢
1 − 𝑢 2𝑄0 + 2𝑢 1 − 𝑢 𝑄
1 + 𝑢2𝑄2 + 𝑢
1 − 𝑢 2𝑄
1 + 2𝑢 1 − 𝑢 𝑄2 + 𝑢2𝑄 3
= 1 − 𝑢 3𝑄0 + 3𝑢 1 − 𝑢 2𝑄
1 + 3𝑢2 1 − 𝑢 𝑄2 + 𝑢3𝑄3
8
𝑄
1
𝑄3 𝑄0 𝑄2 𝑄0123 𝑢
Cubic Bezier curve
𝑜
𝑗=0 𝑜 𝑜C𝑗 𝑢𝑗 1 − 𝑢 𝑜−𝑗 𝑄𝑗
9
𝑜(𝑢)
Bernstein basis function
1 − 𝑢 4𝑄0 + 4𝑢 1 − 𝑢 3𝑄
1
+ 6𝑢2 1 − 𝑢 2𝑄2 + 4𝑢3 1 − 𝑢 𝑄3 + 𝑢4𝑄
4
1 − 𝑢 5𝑄0 + 5𝑢 1 − 𝑢 4𝑄
1
+ 10𝑢2 1 − 𝑢 3𝑄2 + 10𝑢3 1 − 𝑢 2𝑄3 + 5𝑢4 1 − 𝑢 𝑄
4
+ 𝑢5𝑄5
Quartic (4th) Quintic (5th)
1 + 3𝑢2 1 − 𝑢 𝑄2 + 𝑢3𝑄3
1 + 3 2𝑢 1 − 𝑢 − 𝑢2 𝑄2 + 3𝑢2𝑄3
1
𝑄
1 = 𝑄0 + 1 3 𝑄′ 0
𝑄2 = 𝑄3 −
1 3 𝑄′ 1
10
𝑄
1
𝑄3 𝑄0 𝑄2
𝑄′(0) 𝑄′(1)
11
line, split by de Casteljau’s algorithm
12
“Weighted average” of control points
1 + 𝑢2
𝑄
2
= 𝜇0 𝑢 𝑄
0 + 𝜇1 𝑢
𝑄
1+ 𝜇2 𝑢 𝑄2
𝜇0 𝑢 + 𝜇1 𝑢 + 𝜇2 𝑢 = 1 ∀𝑢
𝜊𝑗 𝑢 = 𝑥𝑗 𝜇𝑗(𝑢)
𝜇𝑗
′ 𝑢 = 𝜊𝑗 𝑢 𝑘 𝜊𝑘 𝑢
13
w0 = w2 = 1
Non-polynomial curve can represent arcs etc.
14
t x t0 t1 t2 t3 t4 t5 x0(t) x1(t) x2(t) x3(t) x4(t) Curve tool in PowerPoint
15
𝑢𝑙−1 𝑢𝑙 𝑢𝑙+1 𝑢𝑙+2 𝑢 𝑦 𝑦𝑙 𝑦𝑙−1 𝑦𝑙+1 𝑦𝑙+2 𝑦𝑙(𝑢)
16
𝑢𝑙−1 𝑢𝑙 𝑢𝑙+1 𝑢𝑙+2 𝑢 𝑦 𝑚𝑙−1(𝑢) 𝑚𝑙(𝑢) 𝑚𝑙+1(𝑢)
17
𝑢𝑙−1 𝑢𝑙 𝑢𝑙+1 𝑢𝑙+2 𝑢 𝑦 𝑟𝑙(𝑢) 𝑟𝑙+1(𝑢)
18
𝑢𝑙−1 𝑢𝑙 𝑢𝑙+1 𝑢𝑙+2 𝑢 𝑦 𝑦𝑙(𝑢)
Summary:
curve passing through its adjacent CPs
derivative constraints at both ends
19
A recursive evaluation algorithm for a class of Catmull-Rom splines [Barry,Colgman,SIGGRAPH88]
𝑄 𝑢0 = 𝑄0 𝑄 𝑢1 = 𝑄
1
𝑄 𝑢2 = 𝑄2 𝑄 𝑢3 = 𝑄3 𝑄 𝑢 𝑢1 ≤ 𝑢 ≤ 𝑢2
𝑢𝑙 = 𝑢𝑙−1 + 1
𝑢𝑙 = 𝑢𝑙−1 + 𝑄𝑙−1 − 𝑄𝑙
𝑢𝑙 = 𝑢𝑙−1 + 𝑄𝑙−1 − 𝑄𝑙
20
Parameterization of Catmull-Rom Curves [Yuksel,Schaefer,Keyser,CAD11]
21
Parameterization of Catmull-Rom Curves [Yuksel,Schaefer,Keyser,CAD11]
Next lecture
http://geometrie.foretnik.net/files/NURBS-en.swf
22
𝑄 𝑡, 𝑢 =
𝑗=0 3 𝑘=0 3
𝑐𝑗
3 𝑡 𝑐 𝑘 3 𝑢 𝑄𝑗𝑘
23
Bernstein basis functions 𝑐0
3 𝑢 = 1 − 𝑢 3
𝑐1
3 𝑢 = 3𝑢 1 − 𝑢 2
𝑐2
3 𝑢 = 3𝑢2(1 − 𝑢)
𝑐3
3 𝑢 = 𝑢3
24
25