Introduction to Computer Graphics – Modeling (2) –
April 23, 2020 Kenshi Takayama
Introduction to Computer Graphics Modeling (2) April 23, 2020 - - PowerPoint PPT Presentation
Introduction to Computer Graphics Modeling (2) April 23, 2020 Kenshi Takayama Subdivision surfaces First, well look at its theoretical basis: B-Spline curves Basis 2 Example: 2D polyline represented as function X-coord Y Look
April 23, 2020 Kenshi Takayama
2
First, we’ll look at its theoretical basis:
Basis
3
(1.4, -1.6) (-0.4, -3.0) (-1.4, -1.3) (-0.3, -0.3) (-0.7, 1.1) (-1.2, 2.0) (-2.2, 3.2) Parameter t 1 2 3 4 5 6 1 2
X-coord
Look at X-coord function
t=0 t=6 X Y
4
1.4 ×
X-coord
0, otherwise
# 𝐶#%& 𝑢 + #'&%$ #
𝐶#%&(𝑢 − 1)
5
𝐶!(𝑢) 𝐶"(𝑢) 𝐶#(𝑢) 1 1/2 2/3 3/4 𝑢 𝑢 𝑢 1 2 3 4 1/6 𝐶#
$ 1 = 1/2
Linear Quadratic Cubic
6
1.4 ×
7
1.4 ×
= ∑0 𝑦0𝐶# 𝑢 − 𝑗 + 𝑑 ∑0 𝐶# 𝑢 − 𝑗
8
t 1/2 1 t 2/3 1/2 1 1/2 t 1/2 1
𝑢! 2 𝑢 − 1 ! 2 − 2𝑢 − 1 ! + 4 6
Quadratic basis 1
9
Piecewise cubic Piecewise cubic Linear combination of cubic bases
Given coordinate value at each knot 𝑢 = 𝑢(, compute derivative at each knot Hermite interpolation for each interval
Representation Defined as
Continuity across intervals
C1-continuous C2-continuous
Passes through CPs?
Yes No
10
11
Quadratic
1 3 2 2.5 1.5 0.5
×3/4 ×3/4 ×1/4 ×1/4
12
1.4 ×
13
3/4 1/4
3 4 1.4 + 1 4 −0.4
1.4 ×
1/4 3/4
1 4 1.4 + 3 4 −0.4
14
1 4 1.4 + 3 4 −0.4 3 4 1.4 + 1 4 −0.4 3 4 1.4 1 4 1.4 1 4 −0.4 + 3 4 −1.4 3 4 −0.4 + 1 4 −1.4 1 4 −1.4 + 3 4 −0.3 1 4 −0.3 + 3 4 −0.7 3 4 −0.3 + 1 4 −0.7 1 4 −0.7 + 3 4 −1.2 3 4 −0.7 + 1 4 −1.2 1 4 −1.2 + 3 4 −2.2 3 4 −1.2 + 1 4 −2.2 1 4 −2.2 3 4 −2.2 3 4 −1.4 + 1 4 −0.3
15
3/4 1/4 3/4 1/4 Stencil A 3/4 1/4 3/4 1/4 Stencil B
(= For each edge, generate 2 new vertices)
16
Bi-quadratic basis: 𝐶"," 𝑡, 𝑢 = 𝐶" 𝑡 𝐶"(𝑢) 3/16 9/16 1/16 3/16 3/16 1/16 Stencil 3/16 9/16 3/4 1/4 3/4 1/4 ⊗
(= For each face, generate 4 new vertices)
17
18
×1/2 ×1/2 ×1/8 ×1/8 ×3/4
Cubic basis
1 3 2 2.5 1.5 0.5 4 3.5
19
1.4 ×
20
1.4 ×
1/2 1/2 1/8 3/4 1/8
21
1 8 1.4 + 3 4 −0.4 + 1 8 −1.4 1 2 1.4 + 1 2 −0.4 1 8 1.4 1 2 1.4 3 4 1.4 + 1 8 −0.4 1 8 −2.2 1 2 −2.2 1 8 −1.2 + 3 4 −2.2 1 8 −0.4 + 3 4 −1.4 + 1 8 −0.3 1 2 −0.4 + 1 2 −1.4 1 8 −1.4 + 3 4 −0.3 + 1 8 −0.7 1 2 −1.4 + 1 2 −0.3 1 8 −0.3 + 3 4 −0.7 + 1 8 −1.2 1 2 −0.3 + 1 2 −0.7 1 8 −0.7 + 3 4 −1.2 + 1 8 −2.2 1 2 −0.7 + 1 2 −1.2 1 2 −1.2 + 1 2 −2.2
22
1/2 1/2 1/2 1/2 Stencil A 1/8 3/4 1/8 1/8 1/8 Stencil B 3/4
23
Bi-cubic basis: 𝐶#,# 𝑡, 𝑢 = 𝐶# 𝑡 𝐶#(𝑢) 1/4 1/4 “face point” stencil 1/4 1/4 1/2 1/2 1/2 1/2 ⊗ 1/4 1/4 1/4 1/4
24
Bi-cubic basis: 𝐶#,# 𝑡, 𝑢 = 𝐶# 𝑡 𝐶#(𝑢) 1/16 3/8 “edge point” stencil 3/8 1/16 1/8 1/8 1/2 1/2 ⊗ 1/16 1/16 3/8 3/8 1/16 1/16 1/16 1/16 3/4
25
Bi-cubic basis: 𝐶#,# 𝑡, 𝑢 = 𝐶# 𝑡 𝐶#(𝑢) 1/64 3/32 “vertex point” stencil 9/16 3/32 1/8 1/8 1/8 1/8 ⊗ 1/64 3/32 3/32 9/16 1/64 3/32 1/64 3/32 3/4 1/64 3/32 1/64 3/32 1/64 1/64 3/4
26
27
28
29
9/16 3/16 1/16 3/16
𝑄 = 1 16 9 𝐵 + 3 𝐶 + 3 𝐷 + 𝐸 = 𝐵 + 𝐶 + 𝐷 + 𝐸 4 + 𝐵 + 𝐶 2 + 𝐵 + 𝐷 2 + 𝐵 4 è Applicable to general polygon mesh
A B D C P Barycenter Midpoint Midpoint For each polygon’s each vertex, generate a new vertex at the average of the polygon’s barycenter, its adjacent edges’ midpoints, and itself
30
31
32
1/4 1/4 1/4 1/4
𝑄 = 𝐵& + 𝐵7 + 𝐵8 + 𝐵9 4 è Applicable to general polygon mesh
A1 A2 A3 A4 P For each polygon, generate a new vertex at its barycenter
33
1/16 1/16
è Applicable to general polygon mesh
3/8 3/8 B2 B1 1/16 1/16 B3 B4 A1 A2
𝑄 = 3 8 𝐵& + 𝐵7 + 1 16 𝐶& + 𝐶7 + 𝐶8 + 𝐶9 = 𝐵& + 𝐵7 + 𝐶& + 𝐶7 4 + 𝐵& + 𝐵7 + 𝐶8 + 𝐶9 4 2 + 𝐵& + 𝐵7 2 2
P Barycenter Barycenter Midpoint For each edge, generate a new vertex at the average of the barycenters of its adjacent polygons and its midpoint
34
è Applicable to general polygon mesh
𝑄 = 9 16 𝐵 + 3 32 𝐶! + 𝐶" + 𝐶# + 𝐶$ + 1 64 𝐷! + 𝐷" + 𝐷# + 𝐷$
= 1 4 𝐵 + 𝐶" + 𝐷" + 𝐶! 4 + 𝐵 + 𝐶! + 𝐷! + 𝐶# 4 + 𝐵 + 𝐶# + 𝐷# + 𝐶$ 4 + 𝐵 + 𝐶$ + 𝐷$ + 𝐶" 4 4
+ 2 4 𝐵 + 𝐶! 2 + 𝐵 + 𝐶" 2 + 𝐵 + 𝐶# 2 + 𝐵 + 𝐶$ 2 4 + 1 4 𝐵
Barycenter Midpoint
1/64 3/32 C1 1/64 C4 B1 1/64 3/32 C2 1/64 C3 B3 3/32 9/16 B2 3/32 B4 A When A’s valence is n, 𝑄 = 1 𝑜 𝑅 + 2 𝑜 𝑆 + 𝑜 − 3 𝑜 𝐵 P
Barycenter Barycenter Barycenter Midpoint Midpoint Midpoint
35
= cubic surface = quadratic surface
36
When valence isn’t 6 è derived from complicated analysis (see Loop’s paper)
37
Catmull-Clark Loop Catmull-Clark
38
−1/16 −1/16 9/16 9/16
tedious modeling work using B-splines
39
https://www.youtube.com/watch?v=9IYRC7g2ICg Subdivision surfaces in character animation [DeRose,Kass,Truong,SIGGRAPH98]
40
Subdivision surfaces in character animation [DeRose,Kass,Truong,SIGGRAPH98] sharpness=0 sharpness=1 sharpness=2 sharpness=3 sharpness=∞
41
Subdivision surfaces in character animation [DeRose,Kass,Truong,SIGGRAPH98]
http://www.cs.berkeley.edu/~sequin/CS284/TEXT/LoopErrata.txt
42
43
44
OFF 8 6 0
0.5 -0.5 0.5
0.5 0.5 0.5
0.5 0.5 -0.5
0.5 -0.5 -0.5 4 0 1 3 2 4 2 3 5 4 4 4 5 7 6 4 6 7 1 0 4 1 7 5 3 4 6 0 2 4
ß xyz coord of 0th vertex ß xyz coord of 7th vertex ß #vertices, #faces ß 0th face’s #vertices and vertex indices ß 6th face’s #vertices and vertex indices 6 1 2 3 4 5 7 Geometry data Topology data OFF file format x y z ・・・ ・・・
45
6 1 2 3 4 5 7
(1) Vertex à One of halfedges emanating from it (2) Face à One of halfedges composing it (3) Halfedge à Vertex that it points to (4) Halfedge à Face that it belongs to (5) Halfedge à Next halfedge (6) Halfedge à Halfedge opposite to it
(2) à (5) à (5) à ...
(1) à (6) à (5) à (6) à (5) à ...
46
http://www.openmesh.org/
47
[Catmull,Clark,CAD78]
[Dyn,Levine,Gregory,TOG90]
[Stam,SIGGRAPH98]
[Zorin,Schroder,Sweldens,SIGGRAPH96]
48