Top Banner
Bspline/NURBS and Subdivision Surface Surface Computer Graphics Lecture 17 Taku Komura Taku Komura
38

Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Oct 12, 2019

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Bspline/NURBS and Subdivision Surface

Bspline/NURBS and Subdivision Surface

Computer Graphics

Lecture 17

Taku KomuraTaku Komura

Page 2: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Today

– More about Bspline– More about Bspline– NURBS – Subdivision Surface

Page 3: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Bezier, Hermite are not enough• For modeling more complex shapes, we need

curves / surface with more degrees of freedomfreedom

– Controlling the continuity, – Changing the weights of

each control points

-> Bsplines, NURBS

Page 4: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

a Bspline of order k (polynomial of degree k-1) is a parametric curve composed of a linear combination of basis B-splines Bi,n

B-Spline : from the last lecture

curve composed of a linear combination of basis B-splines Bi,n

Pi (i=0,…,m) are called the control points

Knots: - the knots subdivide the domain of the B-spline curve into a set of knot spans [ti, ti+1)

∑=

=m

ikii tBPtp

0, )()(

mkttt +≤≤≤ ...10

4

The B-splines can be defined by

)()()(

otherwise 0,

tt t1,)(

1,11

1,1

,

1ii1,

tBtt

tttB

tt

tttB

tB

kiiki

kiki

iki

iki

i

−+−+

+−

−+

+

−−+

−−=

<≤

=

http://www.ibiblio.org/e-notes/Splines/Basis.htm

Page 5: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Domain of the function

• Order k, Degree k-1 (the basis functions are polynomials of degree k-1)polynomials of degree k-1)

• Control points Pi (i=0,…,m)• Knots : tj, (j=0,…, n)• An important rule : n – m = k • The domain of the function tk-1 ≦ t≦ tm+1

– Below, k = 4, m = 9, domain, t ≦ t≦ t≦ ≦

– Below, k = 4, m = 9, domain, t3 ≦ t≦ t10

3t

m+10

Page 6: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Clamped Bsplines

• The first and last knot values are repeated with multiplicity equal to the order (degree + 1) multiplicity equal to the order (degree + 1)

• The end points pass the control point• For cubic bsplines, the multiplicity of the first /

last knots must be 4 (repeated four times)

Page 7: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Closed curves

• What about closed curves ? curves ?

Page 8: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Controlling the shape of B-splines

• Moving the control points is the most obvious way to control bspline curvesway to control bspline curves

• Changing the position of control point Pi only affects the interval [ti, ti+k), where k is the order of a B-spline curve – Editing the shape through the knot vector is not very

intuitive

Page 9: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

What if you want to edit some details?

• You might want to add some high resolution details at a particular area while keeping the rest the same at a particular area while keeping the rest the same

Page 10: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Knot insertion • We can do this by knot Insertion

– increase the resolution for some area

• New knots can be added without changing the • New knots can be added without changing the shape of the curve

• Because of the basic rule n-m = k (n+1: number of knots, m+1 : the number control points, k : order) the control points also increase

Page 11: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Knot insertion • If the new knot t is inserted into the span [t j, tj+1),the new control points can be computed by

PPQ aa +−= )1(where Qi is the new control point and ai is computed by

Pj-k+1, Pj-k+2, ..., Pj-1, Pj is replaced with Pj-k+1, Qj-k+2, ..., Qj-1, Qj ,Pj.

i1ii PPQ ii aa +−= −)1(

jij-ktt

tta

iki

ii ≤≤+

−−=−+

2for 1

Pj-k+1, Pj-k+2, ..., Pj-1, Pj is replaced with Pj-k+1, Qj-k+2, ..., Qj-1, Qj ,Pj.

Page 12: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Example

• A bspline curve of degree 3 (k=4) having

t0 to t3 t4 t5 t6 t7 t8 to t11

0 0.2 0.4 0.6 0.8 1 degree 3 (k=4) having the following knots

• t=0.5 inserted

0 0.2 0.4 0.6 0.8 1

t0 to t3 t4 t5 t6 t7 t8 t9 to t12

0 0.2 0.4 0.5 0.6 0.8 1

2

1

2.08.0

2.05.0

6

1

4.01

4.05.0

47

44

58

55

=−−=

−−=

=−

−=−−=

tt

tta

tt

tta

6

5

06.0

05.0

22.08.0

36

33

47

=−−=

−−=

tt

tta

tt

http://i33www.ira.uka.de/applets/mocca/html/noplugin/curves.html

Page 13: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

NURBS (Non-uniform rational B-spline)

• Standard curves/surface representation in computer aided design

∑n

wtB )( P

Pi : control points

B : Bspline basis of order k

=

==n

iiki

iiiki

wtB

wtBtC

0,

0,

)(

)()(

P

Bi,k: Bspline basis of order k

wi : weights

Page 14: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Benefits of using NURBS

• More degrees of freedom to control the curve (can control the weights)(can control the weights)

• Invariant under perspective transformation – Can project the control points onto the screen and

interpolate on the screen– Don’t need to apply the perspective transformation

to all the sample-points on the curveto all the sample-points on the curve

• Can model conic sections such as circles, ellipses and hyperbolas

Page 15: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Example of changing weights

• Increasing the weight will bring the curve closer to the corresponding control point to the corresponding control point

http://lubovo.misto.cz/_MAIL_/curves/nurbs.html

Page 16: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Bspline Surfaces • Given the following information:

• a set of m+1 rows and n+1 control points pi,j , where 0 <= i <= mand 0 <= j <= n; and 0 <= j <= n;

• Corresponding knot vectors in the u and v direction,

spline-B rationalnon:)()(),(0 0

,,,∑∑= =

−=m

i

n

jjiqjpi vBuBvup P

NURBS:)()(

)()(

),(

0 0,,,

0 0,,,,

∑∑

∑∑

= =

= == m

i

n

jqjpiji

m

i

n

jjiqjpiji

vBuBw

vBuBw

vup

P

Page 17: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Clamped, Closed and Open B-spline Surfaces

• Since a B-spline curve can be clamped, closed or open, a B-spline surface can also have three types in each direction.

• That is, we could ask to have a B-spline surface clamped in the u-direction and closed in the v-direction. direction and closed in the v-direction.

• If a B-spline is clamped in both directions, then this surface passes though control points p0,0, pm,0, p0,n and pm,n

• If a B-spline surface is closed in one direction, then the surface becomes a tube.

• Closed in two direction : torus – Problems handling objects of arbitrary topology, such as a ball, double torus

Page 18: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

What kind of shapes can we produce by NURBS/B-splines?

• What about open shapes?• What about open shapes?

• What about closed shapes?

Page 19: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Subdivision Surface

• A method to model smooth surfaces

Page 20: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

A Primer: Chaiken’s Algorithm

101

100

4

3

4

14

1

4

3

PPQ

PPQ

+=

+=P1

P2

Q1

Q2Q3

Q4

Q

213

212

4

3

4

14

1

4

3

PPQ

PPQ

+=

+=

13PPQ +=

101 44PPQ +=

12

314

1

4

3+

+=

+= iii PPQApply Iterated Function System

P0P3

Q0Q5

325

324

4

3

4

14

1

4

3

PPQ

PPQ

+=

+=112 4

3

4

1++ += iii PPQ

Limit Curve Surfacehttp://www.multires.caltech.edu/teaching/demos/java/chaikin.htm

Page 21: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

3D subdivision surface3D subdivision surface

• Giving a rough shape first and subdivide it recursively

• Giving a rough shape first and subdivide it recursively

• Stop when the shape is smooth enough • Used for modeling smooth surfaces

Page 22: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

MotivationMotivation

•• Shape Shape modelingmodeling•• Shape Shape modelingmodeling–– Topological restrictions of NURBS surfacesTopological restrictions of NURBS surfaces

•• Plane, Cylinder, and TorusPlane, Cylinder, and Torus•• It is difficult to maintain smoothness at seams of It is difficult to maintain smoothness at seams of

patchwork.patchwork.–– Example: hiding seams in Woody (Example: hiding seams in Woody (Toy StoryToy Story) [DeRose98]) [DeRose98]

– NURBS also require the control nets consist of a – NURBS also require the control nets consist of a regular rectangular grid of control points

•• LOD in a sceneLOD in a scene–– AA coarse shape when far away, a smooth dense coarse shape when far away, a smooth dense

surface when closer to the camerasurface when closer to the camera

Page 23: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Subdivision surfaceSubdivision surface• Can handle arbitrary topology

Different Schemes Different Schemes • Doo-Sabin ‘78• Catmull-Clark ‘78• Etc (Loop, Butterfly, and many others)

Page 24: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Doo-Sabin Subdivision• An edge point is formed from the midpoint of each edge • A face point is formed as the centroid of each polygon of

the mesh. • Finally, each vertex in the new mesh is formed as the • Finally, each vertex in the new mesh is formed as the

average of – a vertex in the old mesh, – a face point for a polygon that touches that old vertex, and – the edge points for the two edges that belong to that polygon and

touch that old vertex.

Page 25: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Doo-Sabin Subdivision

http://www.rose-hulman.edu/~finn/CCLI/Applets/DooSabinApplet.html

The new mesh, therefore, will – create quadrilaterals for each edge in the old mesh, – create a smaller n-sided polygon for each n-sided polygon

in the old mesh, and – create an n-sided polygon for each n-valence vertex

(Valence being the number of edges that touch the vertex).

hulman.edu/~finn/CCLI/Applets/DooSabinApplet.html

Page 26: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Catmull-Clark Subdivision

•• A face with n edges are subdivided into n A face with n edges are subdivided into n quadrilateralsquadrilateralsquadrilateralsquadrilaterals

•• Quads are better than triangles at capturing the Quads are better than triangles at capturing the symmetries of natural and mansymmetries of natural and man--made objects. made objects. Tube like surfaces (arms, legs, fingers) are Tube like surfaces (arms, legs, fingers) are easier to model.easier to model.

Page 27: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Catmull-Clark Subdivision

FACE

∑=n

ivn

f1

1

42121 ffvv

e+++=

EDGE

VERTEXVERTEX

∑∑ ++−=+j

jj

jii fn

en

vn

nv

221

112

http://www.rose-hulman.edu/~finn/CCLI/Applets/CatmullClarkApplet.html

Page 28: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Modeling with Catmull-Clark

• Subdivision produces smooth continuous surfaces. • How can “sharpness” and creases be controlled in a • How can “sharpness” and creases be controlled in a

modeling environment? ANSWER: Define new subdivision rules for “creased”

edges and vertices.

1. Tag Edges sharp edges.

2. If an edge is sharp, apply new 2. If an edge is sharp, apply new sharp subdivision rules.

3. Otherwise subdivide with normal rules.

Page 29: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Sharp Edges…• Tag Edges as “sharp ” or “not-sharp”

• n = 0 – “not sharp ”

• n > 0 – sharp

During Subdivision,

• if an edge is “sharp”, use sharp subdivision rules. Newly created edges, are assigned a sharpness of n-1.

• If an edge is “not-sharp”, use normal smooth subdivision rules.

IDEA: Edges with a sharpness of “n” do IDEA: Edges with a sharpness of “n” do not get subdivided smoothly for “n”

iterations of the algorithm.

�In the picture on the right, the control mesh is a unit cube

�Different sharpness applied

Page 30: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Sharp Rules

∑=n

ivn

f1

FACE (unchanged)

∑ in 1

221 vv

e+=

EDGE

VERTEX

vv =corner >2

# adj. Sharp edges

ii vv =+1

8

6 211

evev i

i

++=+crease

corner >2

2

Page 31: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Another example of creases

Page 32: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Non-Integer Sharpness

• Density of newly generated mesh increases rapidly.rapidly.

• In practice, 2 or 3 iterations of subdivision is sufficient.

• Need better “control”.

IDEA: Interpolate between smooth and sharp IDEA: Interpolate between smooth and sharp rules for non-integer sharpness values of n.

Page 33: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Subdivision Surfaces in character Subdivision Surfaces in character animation [DeRose98]animation [DeRose98]

•• Used for first time in Used for first time in Geri’s game to Geri’s game to Geri’s game to Geri’s game to overcome topological overcome topological restriction of NURBSrestriction of NURBS

•• Modeled Geri’s head, Modeled Geri’s head, hands, jacket, pants, hands, jacket, pants, shirt, tie, and shoesshirt, tie, and shoes

•• Developed cloth Developed cloth •• Developed cloth Developed cloth simulation methodssimulation methods

Page 34: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Geri’s Game

• Academy Award winning movie by Pixar– Made by subdivision surface – Made by subdivision surface

[http://www.youtube.com/watch?v=1m7dcbIKvlw]

Demo of Catmull-Clark subdivision surface• http://www.youtube.com/watch?v=lU8f0hnorU8&feature=related

Page 35: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Adaptive Subdivision

• Not all regions of a model need to be subdivided.

• Idea: Use some criteria and adaptively subdivide mesh adaptively subdivide mesh where needed.– Curvature– Screen size ( make triangles

< size of pixel )– View dependence

• Distance from viewer• Silhouettes• Silhouettes• In view frustum

– Careful! Must ensure that “cracks” aren’t made

crack

subdivide

View-dependent refinement of progressive meshes Hugues Hoppe.(SIGGRAPH ’97)

Page 36: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Subdivision Surface Summary

• Advantages– Simple method for describing complex surfaces – Simple method for describing complex surfaces – Relatively easy to implement – Arbitrary topology – Local support – Guaranteed continuity – Multi-resolution

• Difficulties• Difficulties– Intuitive specification – Parameterization – Intersections

Page 37: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

• Edwin CatmullUtah – NYIT – Lucas Films – Pixar -Utah – NYIT – Lucas Films – Pixar -present: President of Disney Animation

Studios and Pixar Animation Studios

• Jim Clark Utah – UCSC - Stanford – Silicon Graphics -Utah – UCSC - Stanford – Silicon Graphics -

Netscape - …

He also co-produced the movie The Cove.

Page 38: Bspline/NURBS and Subdivision Surface · Bspline/NURBS and Subdivision Surface Computer Graphics Lecture 17 Taku Komura. Today – More about Bspline – NURBS – Subdivision Surface.

Readings• A very good website for parametric curves / surfaces

http://www.cs.mtu.edu/~shene/COURSES/cs3621/• DeRose, Tony, Michael Kass, and Tien Truong. Subdivision Surfaces in

Character Animation. SIGGRAPH 98.• Clark, E., and J. Clark. Recursively generated B-spline surfaces on arbitrary

topological meshes. Computer Aided Geometric Design, Vol. 10, No. 6, • Clark, E., and J. Clark. Recursively generated B-spline surfaces on arbitrary

topological meshes. Computer Aided Geometric Design, Vol. 10, No. 6, 1978.

• Doo, D. and M. Sabin. Behavior of Recursive Division Surfaces Near Extraordinary Points. Computer-Aided Design. Vol. 10, No. 6, 1978.