Geometric Theory, Algorithms, and Techniquesnetlab.cs.ucla.edu/wiki/files/cse530-geometry.pdf ·...

Post on 08-Oct-2020

1 views 0 download

transcript

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Geometric Theory, Algorithms, and Techniques

Hong QinDepartment of Computer Science

State University of New York at Stony BrookStony Brook, New York 11794--4400

Tel: (631)632-8450; Fax: (631)632-8334qin@cs.sunysb.edu

http://www.cs.sunysb.edu/~qin

Hong QinDepartment of Computer Science

State University of New York at Stony BrookStony Brook, New York 11794--4400

Tel: (631)632-8450; Fax: (631)632-8334qin@cs.sunysb.edu

http://www.cs.sunysb.edu/~qin

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Introduction• Geometric modeling and

visual computing– Computer graphics

• Visualization, animation, virtual reality

– CAD/CAM• Engineering, manufacturing

– Computer vision– Physical simulation– Natural phenomena

• Geometric modeling and visual computing– Computer graphics

• Visualization, animation, virtual reality

– CAD/CAM• Engineering, manufacturing

– Computer vision– Physical simulation– Natural phenomena

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

3D Shape Representation• Points (vertices), a set of points• Lines, polylines, curve• Triangles, polygons• Triangular meshes, polygonal meshes• Analytic (commonly-used) shape• Quadric surfaces, sphere, ellipsoid, torus• Superquadric surfaces, superellipse, superellipsoid• Blobby models

• Points (vertices), a set of points• Lines, polylines, curve• Triangles, polygons• Triangular meshes, polygonal meshes• Analytic (commonly-used) shape• Quadric surfaces, sphere, ellipsoid, torus• Superquadric surfaces, superellipse, superellipsoid• Blobby models

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Basic Shapespoint line

plane

triangle

polygon

curve

surface

Curved

solid

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Fundamental Shapes• Vertex (vertices)• Line segments• Triangle, triangular meshes• Quadrilateral• Polygon• Curved object• Tetrahedron, pyramid, hexahedron• Many more…

• Vertex (vertices)• Line segments• Triangle, triangular meshes• Quadrilateral• Polygon• Curved object• Tetrahedron, pyramid, hexahedron• Many more…

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Polygonal Meshes

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Shaded Model

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Mechanical Part

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

NURBS model

PDE models

Subdivision model

Implicit model

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Building Structure

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Mathematical Tools• Parametric curves and surfaces• Spline-based objects (piecewise polynomials)• Explicit, implicit, and parametric representations• The integrated way to look at the shape:

– Object can be considered as a set of faces, each face can be further decomposed into a set of edges, each edge can be decomposed intovertices

• Subdivision models• Other procedure-based models• Sweeping• Surfaces of revolution• Volumetric models

• Parametric curves and surfaces• Spline-based objects (piecewise polynomials)• Explicit, implicit, and parametric representations• The integrated way to look at the shape:

– Object can be considered as a set of faces, each face can be further decomposed into a set of edges, each edge can be decomposed intovertices

• Subdivision models• Other procedure-based models• Sweeping• Surfaces of revolution• Volumetric models

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Line Equation• Parametric representation

• Parametric representation is not unique• In general

• Re-parameterization (variable transformation)

• Parametric representation

• Parametric representation is not unique• In general

• Re-parameterization (variable transformation)

]1,0[)-(),( 01010

∈+=

uupppppl

]1,1[010110

−∈−++=

vv)p0.5(p)p0.5(p)p,l(p

],[),(

bauu∈

p

]1,0[))(()(

)()/()(

∈+−=

+−=−−=

vavabv

avabuabauv

pq

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Basic Concepts• Linear interpolation:

• Local coordinates: • Reparameterization: • Affine transformation:

• Polynomials• Continuity

• Linear interpolation:

• Local coordinates: • Reparameterization: • Affine transformation:

• Polynomials• Continuity

)()1( 10 tt vvv +−=

]1,0[,10 ∈∈ t]v,[vv)())((),(),( vhvgfvguuf ==

1)()()(

=++=+

baybfxafbyaxf

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Linear and Bilinear Interpolation

a

b

bap uu +−= )1(

a b

c

d

fepdbfcae

vvuuuu

+−=+−=+−=

)1()1()1(

e

f

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Fundamental Features• Geometry

– Position, direction, length, area, normal, tangent, etc.• Interaction

– Size, continuity, collision, intersection• Topology• Differential properties

– Curvature, arc-length• Physical attributes• Computer representation & data structure• Others!

• Geometry– Position, direction, length, area, normal, tangent, etc.

• Interaction– Size, continuity, collision, intersection

• Topology• Differential properties

– Curvature, arc-length• Physical attributes• Computer representation & data structure• Others!

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Mathematical Formulations• Point:

• Line:• Quadratic curve:

• Parametric domain and reparameterization:

• Point:

• Line:• Quadratic curve:

• Parametric domain and reparameterization:

⎥⎥⎥

⎢⎢⎢

⎡=

z

y

x

aaa

p

[ ] [ ]TT uu bbbaaal +=)(

[ ] [ ] [ ]TzyxT

zyxT

zyx uuu cccbbbaaaq ++= 2)(

)/()(];1,0[];,[ seses uuuuvvuuu −−=∈∈

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Parametric Polynomials• High-order polynomials

• No intuitive insight for the curved shape• Difficult for piecewise smooth curves

• High-order polynomials

• No intuitive insight for the curved shape• Difficult for piecewise smooth curves

n

zn

yn

xni

zi

yi

xi

z

y

x

uuu⎥⎥⎥

⎢⎢⎢

⎡++

⎥⎥⎥

⎢⎢⎢

⎡++

⎥⎥⎥

⎢⎢⎢

⎡=

,

,

,

,

,

,

,0

,0

,0

......)(aaa

aaa

aaa

c

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Parametric Polynomials

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

How to Define a Curve?• Specify a set of points for interpolation and/or

approximation with fixed or unfixed parameterization

• Specify the derivatives at some locations• What is the geometric meaning to specify derivatives?• A set of constraints• Solve constraint equations

• Specify a set of points for interpolation and/or approximation with fixed or unfixed parameterization

• Specify the derivatives at some locations• What is the geometric meaning to specify derivatives?• A set of constraints• Solve constraint equations

⎥⎥⎥

⎢⎢⎢

)()()(

i

i

i

uzuyux

⎥⎥⎥

⎢⎢⎢

)(')(')('

i

i

i

uzuyux

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

One Example• Two end-vertices: c(0) and c(1)• One mid-point: c(0.5)• Tangent at the mid-point: c’(0.5)• Assuming 3D curve

• Two end-vertices: c(0) and c(1)• One mid-point: c(0.5)• Tangent at the mid-point: c’(0.5)• Assuming 3D curve

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Cubic Polynomials• Parametric representation (u is in [0,1])

• Each components are treated independently• High-dimension curves can be easily defined• Alternatively

• Parametric representation (u is in [0,1])

• Each components are treated independently• High-dimension curves can be easily defined• Alternatively

⎥⎥⎥

⎢⎢⎢

⎡+

⎥⎥⎥

⎢⎢⎢

⎡+

⎥⎥⎥

⎢⎢⎢

⎡+

⎥⎥⎥

⎢⎢⎢

⎡=

⎥⎥⎥

⎢⎢⎢

0

0

0

1

1

12

2

2

23

3

3

3

)()()(

cba

ucba

ucba

ucba

uzuyux

[ ][ ]

UCuzUBuy

UAaaaauuuux T

==

==

)()(

1)( 012323

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Cubic Polynomial Example• Constraints: two end-points, one mid-point, and

tangent at the mid-point

• In matrix form

• Constraints: two end-points, one mid-point, and tangent at the mid-point

• In matrix form

[ ][ ][ ]

[ ]AxAx

AxAx

1111)1(01)5.0(2)5.0(3)5.0('

15.05.05.0)5.0(1000)0(

2

123

==

=

=

A

xxxx

⎥⎥⎥⎥

⎢⎢⎢⎢

=

⎥⎥⎥⎥

⎢⎢⎢⎢

111101175.015.025.0125.01000

)1()5.0(')5.0(

)0(

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Solve this Linear Equation• Invert the matrix

• Rewrite the curve expression

• Invert the matrix

• Rewrite the curve expression

⎥⎥⎥⎥

⎢⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

−−−−

−−

=

)1()5.0(')5.0(

)0(

000112454648

4404

xxxx

A

[ ][ ][ ]T

T

T

zzzzUMuz

yyyyUMuy

xxxxUMux

)1()5.0(')5.0()0()(

)1()5.0(')5.0()0()(

)1()5.0(')5.0()0()(

=

=

=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Basis Functions• Special polynomials

• What is the image of these basis functions?• Polynomial curve can be defined by

• Observations– More intuitive, easy to control, polynomials

• Special polynomials

• What is the image of these basis functions?• Polynomial curve can be defined by

• Observations– More intuitive, easy to control, polynomials

144)(

264)(

44)(

1584)(

234

233

22

231

+−=

−+−=

+−=

+−+−=

uuuf

uuuuf

uuuf

uuuuf

)()1()()5.0(')()5.0()()0()( 4321 ufufufufu ccccc +++=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Lagrange Curve• Point interpolation• Point interpolation

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Lagrange Curves• Curve

• Lagrange polynomials of degree n:• Knot sequence: • Kronecker delta: • The curve interpolate all the data point, but

unwanted oscillation

• Curve

• Lagrange polynomials of degree n:• Knot sequence: • Kronecker delta: • The curve interpolate all the data point, but

unwanted oscillation

)(...)()( 0 uLuLu nn

n

⎥⎥⎥

⎢⎢⎢

⎡++

⎥⎥⎥

⎢⎢⎢

⎡=

aaa

aaa

c

)(uLni

nuu ,...,0

ijjni uL δ=)(

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Lagrange Basis Functions

))()...(())()...(()(

))...()()...(())...()()...(()(

))...()(())...()(()(

0),...,1,0,(1

)(

120

120

110

110

02010

210

−−

−−

+−

+−

−−−−−−

=

−−−−−−−−

=

−−−−−−

=

⎩⎨⎧ ==

=

nnnnn

nnnn

niiiiii

niini

n

nn

jni

uuuuuuuuuuuuuL

uuuuuuuuuuuuuuuuuL

uuuuuuuuuuuuuL

Otherwisenjiji

uL

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Cubic Hermite Splines

C(0)

C’(0)

C(1)

C’(1)

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Cubic Hermite Curve• Hermite curve

• Two end-points and two tangents at end-points

• Matrix inversion

• Hermite curve

• Two end-points and two tangents at end-points

• Matrix inversion

⎥⎥⎥

⎢⎢⎢

⎡=

)()()(

)(uzuyux

uc

A

xxxx

⎥⎥⎥⎥

⎢⎢⎢⎢

=

⎥⎥⎥⎥

⎢⎢⎢⎢

0123010011111000

)1(')0('

)1()0(

[ ][ ]T

T

zzzzUMuz

yyyyUMuy

xxxx

Uux

)1(')0(')1()0()(

)1(')0(')1()0()(

)1(')0('

)1()0(

00010100

12331122

)(

=

=

⎥⎥⎥⎥

⎢⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

⎡−−−

=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Hermite Curve• Basis functions

• Display the image of these basis functions and the Hermite curve itself

• Basis functions

• Display the image of these basis functions and the Hermite curve itself

234

233

232

231

)(

2)(

32)(

132)(

uuuf

uuuuf

uuuf

uuuf

−=

+−=

+−=

+−=

)()1(')()0(')()1()()0()( 4321 ufufufufu ccccc +++=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Cubic Hermite Splines• Two vertices and two tangent vectors:

• Hermite curve

• Two vertices and two tangent vectors:

• Hermite curve

;)1()0(

;)1(,)0(

1)1(

0)1(

10

dc,dc

vcvc

==

==

)()(),()(),()(),()(

);()()()()(

4333

322

311

30

331

320

311

300

ufuHufuHufuHufuH

uHuHuHuHu

====

+++= ddvvc

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Hermite Splines• Higher-order polynomials

• Note that, n is odd!• Geometric intuition• Higher-order derivatives are required

• Higher-order polynomials

• Note that, n is odd!• Geometric intuition• Higher-order derivatives are required

;2/)1,...(0),1()0(

);()()(

)()()()(

)(1

)(0

01)1(

112/)1(

2/)1(1

2/)1(2/)1(

01100

00

−===

++++

+++=

−+−

−−

ni

uHuHuH

uHuHuHu

iiii

nn

nn

nn

n

nn

nnn

cv,cv

vv...v

v...vvc

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Why Cubic Polynomials• Lowest degree for specifying curve in space• Lowest degree for specifying points to

interpolate and tangents to interpolate• Commonly used in computer graphics• Lower degree has too little flexibility• Higher degree is unnecessarily complex, exhibit

undesired wiggles

• Lowest degree for specifying curve in space• Lowest degree for specifying points to

interpolate and tangents to interpolate• Commonly used in computer graphics• Lower degree has too little flexibility• Higher degree is unnecessarily complex, exhibit

undesired wiggles

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Variations of Hermite Curve• Variations of Hermite curves

• In matrix form (x-component only)

• Variations of Hermite curves

• In matrix form (x-component only)3/)1('3)1('3/)0('3)0('

)1()0(

3223

0101

3

0

cpp),p(pccpp),p(pc

cpcp

−=−=+=−=

==

⎥⎥⎥⎥

⎢⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

−−

=

⎥⎥⎥⎥

⎢⎢⎢⎢

x

x

x

x

x

x

x

x

,0

,0

,0

,0

3300003310000001

)1(')0(')1()0(

pppp

cccc

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Cubic Bezier Curves• Four control points• Curve geometry• Four control points• Curve geometry

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Curve Mathematics (Cubic)• Bezier curve

• Control points and basis functions

• Image and properties of basis functions

• Bezier curve

• Control points and basis functions

• Image and properties of basis functions

∑=

=3

0

3 )()(i

ii uBu pc

333

232

231

330

)(

)1(3)(

)1(3)(

)1()(

uuB

uuuB

uuuB

uuB

=

−=

−=

−=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Recursive Evaluation• Recursive linear interpolation• Recursive linear interpolation

)(

)()1(

30

21

20

12

11

10

03

02

01

00

u

uu

cp

pp

ppp

pppp

=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Recursive Subdivision Algorithm

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Basic Properties (Cubic)• The curve passes through the first and the last

points (end-point interpolation)• Linear combination of control points and basis

functions• Basis functions are all polynomials• Basis functions sum to one (partition of unity)• All basis functions are non-negative• Convex hull (both necessary and sufficient)• Predictability

• The curve passes through the first and the last points (end-point interpolation)

• Linear combination of control points and basis functions

• Basis functions are all polynomials• Basis functions sum to one (partition of unity)• All basis functions are non-negative• Convex hull (both necessary and sufficient)• Predictability

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Derivatives• Tangent vectors can easily be evaluated at the

end-points• Second derivatives at end-points can also be

easily computed:

• Tangent vectors can easily be evaluated at the end-points

• Second derivatives at end-points can also be easily computed:

)p(pc);p(pc 2301 )1('3)0(' −=−=

)pp(p))p(p)p((pc

)pp(p))p(p)p((pc

1231223)2(

0120112)2(

2632)1(

2632)0(

+−=−−−×=

+−=−−−×=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Derivative Curve• The derivative of a cubic Bezier curve is a

quadratic Bezier curve• The derivative of a cubic Bezier curve is a

quadratic Bezier curve

22312

201

32

22

12

02

3)1(23)1(3

3))1(2(3))1(2)1((3)1(3)('

uuuu

uuuuuuuuu

)p(p)p(p)p(p

ppppc

−+−−+−−

=+−−+−−−+−−=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

More Properties (Cubic)• Two curve spans are obtained, and both of them

are standard Bezier curves (through reparameterization)

• The control points for the left and the right are

• Two curve spans are obtained, and both of them are standard Bezier curves (through reparameterization)

• The control points for the left and the right are]1,0[),(]1,0[),(

]1,[),(],0[),(

∈∈

∈∈

uuuu

uvvuvv

r

l

cccc

03

12

21

30

30

20

10

00

p,p,p,p

p,p,p,p

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

High-Degree Curves• Generalizing to high-degree curves

• Advantages:– Easy to compute, Infinitely differentiable

• Disadvantages:– Computationally complex, undulation, undesired

wiggles• How about high-order Hermite? Not natural!!!

• Generalizing to high-degree curves

• Advantages:– Easy to compute, Infinitely differentiable

• Disadvantages:– Computationally complex, undulation, undesired

wiggles• How about high-order Hermite? Not natural!!!

in

ii

i

i

ucba

uzuyux

∑= ⎥

⎥⎥

⎢⎢⎢

⎡=

⎥⎥⎥

⎢⎢⎢

0)()()(

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Bezier Splines• Bezier curves of degree n

• Control points and basis functions (Bernstein polynomials of degree n):

• Bezier curves of degree n

• Control points and basis functions (Bernstein polynomials of degree n):

∑=

=n

i

nii uBu

0)()( pc

!)!(!

)1()(

iinn

in

uuin

uB iinni

−=⎟⎟

⎞⎜⎜⎝

−⎟⎟⎠

⎞⎜⎜⎝

⎛= −

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Recursive Computation

)()(

)1(

,...2,1,0,

0

11

1

0

uu

uu

ni

n

ji

ji

ji

ii

pc

ppp

pp

=

+−=

==−+

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Recursive Computation• N+1 levels• N+1 levels

)(

)()1(

0

11

10

11

10

000

u

uu

n

nn

n

n

cp

pp.........

p...p

p......p

=

−−

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Properties• Basis functions are non-negative• The summation of all basis functions is unity• End-point interpolation• Binomial expansion theorem

• Convex hull: the curve is bounded by the convex hull defined by control points

• Basis functions are non-negative• The summation of all basis functions is unity• End-point interpolation• Binomial expansion theorem

• Convex hull: the curve is bounded by the convex hull defined by control points

npc,pc == )1()0( 0

inin

i

n uuin

uu −

=

−⎟⎟⎠

⎞⎜⎜⎝

⎛=+− ∑ )1())1((

0

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

More Properties• Recursive subdivision and evaluation• Symmetry: c(u) and c(1-u) are defined by the

same set of point points, but different ordering

• Recursive subdivision and evaluation• Symmetry: c(u) and c(1-u) are defined by the

same set of point points, but different ordering

0

0

,,p,...p

;p,...p

n

n

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Tangents and Derivatives• End-point tangents:

• I-th derivatives at two end-points depend on

• Derivatives at non-end-points involve all control points

• End-point tangents:

• I-th derivatives at two end-points depend on

• Derivatives at non-end-points involve all control points

)p(pc)p(pc

1

01

)1(')0('

−−=−=

nnnn

inn

i

−p,...,p;p,...,p 0

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Other Advanced Topics• Efficient evaluation algorithm• Differentiation and integration• Degree elevation

– Use a polynomial of degree (n+1) to express that of degree (n)

• Composite curves• Geometric continuity• Display of curve

• Efficient evaluation algorithm• Differentiation and integration• Degree elevation

– Use a polynomial of degree (n+1) to express that of degree (n)

• Composite curves• Geometric continuity• Display of curve

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Bezier Curve Rendering• Use its control polygon to approximate the curve• Recursive subdivision till the tolerance is satisfied• Algorithm go here

– If the current control polygon is flat (with tolerance), then output the line segments, else subdivide the curve at u=0.5

– Compute control points for the left half and the right half, respectively

– Recursively call the same procedure for the left one and the right one

• Use its control polygon to approximate the curve• Recursive subdivision till the tolerance is satisfied• Algorithm go here

– If the current control polygon is flat (with tolerance), then output the line segments, else subdivide the curve at u=0.5

– Compute control points for the left half and the right half, respectively

– Recursively call the same procedure for the left one and the right one

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

High-Degree Polynomials• More degrees of freedom• Easy to compute• Infinitely differentiable• Drawbacks:

– High-order– Global control– Expensive to compute, complex– undulation

• More degrees of freedom• Easy to compute• Infinitely differentiable• Drawbacks:

– High-order– Global control– Expensive to compute, complex– undulation

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Piecewise Polynomials• Piecewise --- different polynomials for different

parts of the curve• Advantages --- flexible, low-degree• Disadvantages --- how to ensure smoothness at

the joints (continuity)

• Piecewise --- different polynomials for different parts of the curve

• Advantages --- flexible, low-degree• Disadvantages --- how to ensure smoothness at

the joints (continuity)

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Piecewise Curves

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Piecewise Bezier Curves

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Continuity• One of the fundamental concepts• Commonly used cases:

• Consider two curves: a(u) and b(u) (u is in [0,1])

• One of the fundamental concepts• Commonly used cases:

• Consider two curves: a(u) and b(u) (u is in [0,1])

210 ,, CCC

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Positional Continuity

)0()1( ba =

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Derivative Continuity

)0(')1(')0()1(

baba

==

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

General Continuity• Cn continuity: derivatives (up to n-th) are the same at

the joining point

• The prior definition is for parametric continuity• Parametric continuity depends of parameterization! But,

parameterization is not unique!• Different parametric representations may express the

same geometry• Re-parameterization can be easily implemented• Another type of continuity: geometric continuity, or Gn

• Cn continuity: derivatives (up to n-th) are the same at the joining point

• The prior definition is for parametric continuity• Parametric continuity depends of parameterization! But,

parameterization is not unique!• Different parametric representations may express the

same geometry• Re-parameterization can be easily implemented• Another type of continuity: geometric continuity, or Gn

ni

ii

,...,2,1,0)0()1( )()(

== ba

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Geometric Continuity• G0 and G1• G0 and G1

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Geometric Continuity• Depend on the curve geometry• DO NOT depend on the underlying

parameterization• G0: the same joint• G1: two curve tangents at the joint align, but

may (or may not) have the same magnitude• G1: it is C1 after the reparameterization• Which condition is stronger???• Examples

• Depend on the curve geometry• DO NOT depend on the underlying

parameterization• G0: the same joint• G1: two curve tangents at the joint align, but

may (or may not) have the same magnitude• G1: it is C1 after the reparameterization• Which condition is stronger???• Examples

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Piecewise Hermite Curves• How to build an interactive system to satisfy

various constraints• C0 continuity• C1 continuity

• G1 continuity

• How to build an interactive system to satisfy various constraints

• C0 continuity• C1 continuity

• G1 continuity

)0()1( ba =

)0(')1(')0()1(

baba

==

)0(')1(')0()1(

babaα=

=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Piecewise Hermite Curves

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Piecewise Bezier Curves

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Piecewise Bezier Curves• C0 continuity• C1 continuity

• G1 continuity

• C2 continuity

• Geometric interpretation• G2 continuity

• C0 continuity• C1 continuity

• G1 continuity

• C2 continuity

• Geometric interpretation• G2 continuity

03 qp =

)q(q)p(pqp

0123

03

−=−=

)q(q)p(pqp

0123

03

−=−=

α

012123

0123

03

22 qqqppp)q(q)p(p

qp

+−=+−−=−

=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Piecewise C2 Bezier Curves

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Continuity Summary• C0: straightforward, but not enough• C3: too constrained• Piecewise curves with Hermite and Bezier

representations satisfying various continuity conditions

• Interactive system for C2 interpolating splinesusing piecewise Bezier curves

• Advantages and disadvantages

• C0: straightforward, but not enough• C3: too constrained• Piecewise curves with Hermite and Bezier

representations satisfying various continuity conditions

• Interactive system for C2 interpolating splinesusing piecewise Bezier curves

• Advantages and disadvantages

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

C2 Interpolating Splines

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Natural C2 Cubic Splines• A set of piecewise cubic polynomials

• C2 continuity at each vertex

• A set of piecewise cubic polynomials

• C2 continuity at each vertex

⎥⎥⎥

⎢⎢⎢

⎡=

)()()(

)(uzuyux

uic

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Natural C2 Cubic Splines

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Natural Splines• Interpolate all control points• Equivalent to a thin strip of metal in a physical

sense• Forced to pass through a set of desired points• No local control (global control)• N+1 control points• N pieces• 2(n-1) conditions• We need two additional conditions

• Interpolate all control points• Equivalent to a thin strip of metal in a physical

sense• Forced to pass through a set of desired points• No local control (global control)• N+1 control points• N pieces• 2(n-1) conditions• We need two additional conditions

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Natural Splines• Interactive design system

– Specify derivatives at two end-points– Specify the two internal control points that define the

first curve span– Natural end conditions: second-order derivatives at

two end points are defined to be zero• Advantages: interpolation, C2• Disadvantages: no local control (if one point is

changed, the entire curve will move)• How to overcome this drawback: B-Splines

• Interactive design system– Specify derivatives at two end-points– Specify the two internal control points that define the

first curve span– Natural end conditions: second-order derivatives at

two end points are defined to be zero• Advantages: interpolation, C2• Disadvantages: no local control (if one point is

changed, the entire curve will move)• How to overcome this drawback: B-Splines

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

B-Splines Motivation• The goal is local control!!!• B-splines provide local control• Do not interpolate control points• C2 continuity• Alternatively

– Catmull-Rom Splines– Keep interpolations– Give up C2 continuity (only C1 is achieved)– Will be discussed later!!!

• The goal is local control!!!• B-splines provide local control• Do not interpolate control points• C2 continuity• Alternatively

– Catmull-Rom Splines– Keep interpolations– Give up C2 continuity (only C1 is achieved)– Will be discussed later!!!

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

C2 Approximating Splines

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

From B-Splines to Bezier

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Uniform B-Splines• B-spline control points: • Piecewise Bezier curves with C2 continuity at

joints• Bezier control points:

• B-spline control points: • Piecewise Bezier curves with C2 continuity at

joints• Bezier control points:

np,...,p,p 10

)4(61

)4(61)

32

32(

21

32

32

3213

2102110

0

212

211

00

pppv

pppppppv

ppv

ppv

pv

++=

++=+

++

=

+=

+=

=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Uniform B-Splines• In general, I-th segment of B-splines is

determined by four consecutive B-spline control points

• In general, I-th segment of B-splines is determined by four consecutive B-spline control points

)4(61

)4(61

32

32

3213

210

212

211

+++

++

++

++

++=

++=

+=

+=

iii

iii

ii

ii

pppv

pppv

ppv

ppv

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Uniform B-Splines• In matrix form

• Question: how many Bezier segments???

• In matrix form

• Question: how many Bezier segments???

⎥⎥⎥⎥

⎢⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=

⎥⎥⎥⎥

⎢⎢⎢⎢

+

+

+

3

2

1

3

2

1

0

1410042002400141

61

i

i

i

i

pppp

vvvv

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

B-Spline Properties• C2 continuity, Approximation, Local control, convex

hull• Each segment is determined by four control points• Questions: what happens if we put more than one

control points in the same location???– Double vertices, triple vertices, collinear vertices

• End conditions– Double endpoints: curve will be tangent to line between first

distinct points– Triple endpoint: curve interpolate endpoint, start with a line

segment• B-spline display: transform it to Bezier curves

• C2 continuity, Approximation, Local control, convex hull

• Each segment is determined by four control points• Questions: what happens if we put more than one

control points in the same location???– Double vertices, triple vertices, collinear vertices

• End conditions– Double endpoints: curve will be tangent to line between first

distinct points– Triple endpoint: curve interpolate endpoint, start with a line

segment• B-spline display: transform it to Bezier curves

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Catmull-Rom Splines

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Catmull-Rom Splines• Keep interpolation• Give up C2 continuity• Control tangents locally• Idea: Bezier curve between successive points• How to determine two internal vertices

• Keep interpolation• Give up C2 continuity• Control tangents locally• Idea: Bezier curve between successive points• How to determine two internal vertices

66

66

)(32

)1('

)(32

)0('

)1()0(

122

111

232

0111

310

iii

iii

ii

ii

ii

pppv

pppv

vvppc

vvppc

vpc,vpc

++−=

−+=

−=−

=

−=−

=

====

++

−+

+

−+

+

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Catmull-Rom Splines• In matrix form

• Problem: boundary conditions• Properties: C1, interpolation, local control, non-

convex-hull

• In matrix form

• Problem: boundary conditions• Properties: C1, interpolation, local control, non-

convex-hull

⎥⎥⎥⎥

⎢⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

−−

=

⎥⎥⎥⎥

⎢⎢⎢⎢

+

+

2

1

1

3

2

1

0

06001610

01610060

61

i

i

i

i

ppp

p

vvvv

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Cardinal Splines• Four vertices define end-points and their

associated tangents

• Special case: Catmull-Rom splines when • More general case: Kochanek-Bartels splines

– Tension, bias, continuity parameters

• Four vertices define end-points and their associated tangents

• Special case: Catmull-Rom splines when • More general case: Kochanek-Bartels splines

– Tension, bias, continuity parameters

)v(vc

)v(vc

vc,vc

13)1(

02)1(

21

)1(21)1(

)1(21)0(

)1()0(

−−=

−−=

==

α

α

0=α

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Cardinal Splines

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Kochanek-Bartels Splines• Four vertices to define four conditions

– Tension parameter:– Bias parameter:– Continuity parameter:

• Four vertices to define four conditions

– Tension parameter:– Bias parameter:– Continuity parameter:

))1)(1()1)(1)((1(21)1(

))1)(1()1)(1)((1(21)0(

)1()0(

2312)1(

1201)1(

21

)v(v)v(vc

)v(v)v(vc

vc,vc

−−−+−++−=

−+−+−−+−=

==

γβγβα

γβγβα

γβα

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Piecewise B-Splines

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

B-Spline Basis Functions

)()()(

01

)(

1,11

1,1

,

11,

uBuuuuuB

uuuuuB

otherwiseuuu

uB

kiiki

kiki

iki

iki

iii

−+++

+−

−+

+

−−

+−

−=

⎩⎨⎧ <<=

=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Basis Functions• Linear examples

• How does it look like???

• Linear examples

• How does it look like???

⎩⎨⎧

∈−∈−

=

⎩⎨⎧

∈−∈−

=

⎩⎨⎧

∈−∈

=

]4,3[4]3,2[2

)(

]3,2[3]2,1[1

)(

]2,1[2]1,0[

)(

2,2

2,1

2,0

uuuu

uB

uuuu

uB

uuuu

uB

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Basis Functions• Quadratic cases (knot vector is [0,1,2,3,4,5,6])

• Cubic example

• Quadratic cases (knot vector is [0,1,2,3,4,5,6])

• Cubic example......)(......)(

433221

,)4(21

),4)(2(21)3)(1(

21

,)1(21

)(

322110

,)3(21

),3)(1(21)2(

21

,21

)(

3,3

3,2

2

2

3,1

2

2

3,0

=

=

<<=<<=<<=

⎪⎪⎪

⎪⎪⎪

−−+−−

=

<<=<<=<<=

⎪⎪⎪

⎪⎪⎪

−−+−=

uBuB

uuu

u

uuuu

u

uB

uuu

u

uuuu

u

uB

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

B-Spline Basis Function Image

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

B-Splines• Mathematics• Control points and basis functions of degree (k-

1)• Piecewise polynomials• Basis functions are defined recursively• We also have to introduce a knot sequence

(n+k+1) in a non-decreasing order

• Note that, the parametric domain:

• Mathematics• Control points and basis functions of degree (k-

1)• Piecewise polynomials• Basis functions are defined recursively• We also have to introduce a knot sequence

(n+k+1) in a non-decreasing order

• Note that, the parametric domain:

)()( ,0

uBu ki

n

ii∑

=

= pc

knuuuuu +,......,,,, 3210

],[ 11 +−∈ nk uuu

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Basis Functions

4,34,24,14,0

3,43,33,23,13,0

2,52,42,32,22,12,0

1,61,51,41,31,21,11,0

BBBBBBBBB

BBBBBBBBBBBBB

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

B-Spline Facts• The curve is a linear combination of control points and

their associated basis functions ((n+1) control points and basis functions, respectively)

• Basis functions are piecewise polynomials defined (recursively) over a set of non-decreasing knots

• The degree of basis functions is independent of the number of control points (note that, I is index, k is the order, k-1 is the degree)

• The first k and last k knots do NOT contribute to the parametric domain. Parametric domain is only defined by a subset of knots

• The curve is a linear combination of control points and their associated basis functions ((n+1) control points and basis functions, respectively)

• Basis functions are piecewise polynomials defined (recursively) over a set of non-decreasing knots

• The degree of basis functions is independent of the number of control points (note that, I is index, k is the order, k-1 is the degree)

• The first k and last k knots do NOT contribute to the parametric domain. Parametric domain is only defined by a subset of knots

},......,,......,,......,{ 110 knnk uuuu ++−

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

B-Spline Properties• C(u): piecewise polynomial of degree (k-1)• Continuity at joints: C(k-2)• The number of control points and basis functions: (n+1)• One typical basis function is defined over k sub-

intervals which are specified by k+1 knots ([u(k),u(I+k)])

• There are n+k+1 knots in total, knot sequence divides the parametric axis into n+k sub-intervals

• There are (n+1)-(k-1)=n-k+2 sub-intervals within the parametric domain ([u(k-1),u(n+1)])

• C(u): piecewise polynomial of degree (k-1)• Continuity at joints: C(k-2)• The number of control points and basis functions: (n+1)• One typical basis function is defined over k sub-

intervals which are specified by k+1 knots ([u(k),u(I+k)])

• There are n+k+1 knots in total, knot sequence divides the parametric axis into n+k sub-intervals

• There are (n+1)-(k-1)=n-k+2 sub-intervals within the parametric domain ([u(k-1),u(n+1)])

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

B-Spline Properties• There are n-k+2 piecewise polynomials• Each curve span is influenced by k control points• Each control points at most affects k curve spans• Local control!!!• Convex hull• The degree of B-spline polynomial can be independent

from the number of control points• Compare B-spline with Bezier!!!• Key components: control points, basis functions, knots,

parametric domain, local vs. global control, continuity

• There are n-k+2 piecewise polynomials• Each curve span is influenced by k control points• Each control points at most affects k curve spans• Local control!!!• Convex hull• The degree of B-spline polynomial can be independent

from the number of control points• Compare B-spline with Bezier!!!• Key components: control points, basis functions, knots,

parametric domain, local vs. global control, continuity

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

B-Spline Properties• Partition of unity, positivity, and recursive

evaluation of basis functions• Special cases: Bezier splines• Efficient algorithms and tools

– Evaluation, knot insertion, degree elevation, derivative, integration, continuity

• Composite Bezier curves for B-splines

• Partition of unity, positivity, and recursive evaluation of basis functions

• Special cases: Bezier splines• Efficient algorithms and tools

– Evaluation, knot insertion, degree elevation, derivative, integration, continuity

• Composite Bezier curves for B-splines

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Uniform B-Spline

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Another Formulation• Uniform B-spline• Parameter normalization (u is in [0,1])• End-point positions and tangents

• Uniform B-spline• Parameter normalization (u is in [0,1])• End-point positions and tangents

)p(pc

)p(pc

)pp(pc

)pp(pc

13

02

321

210

21)1('

21)0('

461)1(

461)0(

−=

−=

++=

++=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Another Formulation• Matrix representation

• Basis matrix

• Matrix representation

• Basis matrix

p

pppp

cccc

c UMMUMUMu hh =

⎥⎥⎥⎥

⎢⎢⎢⎢

=

⎥⎥⎥⎥

⎢⎢⎢⎢

=

3

2

1

0

'

)1(')0(')1()0(

)(

⎥⎥⎥⎥

⎢⎢⎢⎢

−−

−−

=

0141030303631331

61M

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Basis Functions• Note that, u is now in [0,1]• Note that, u is now in [0,1]

34,3

234,2

234,1

34,0

)(61)(

)1333(61)(

)463(61)(

)1(61)(

uuB

uuuuB

uuuB

uuB

=

+++−=

+−=

−=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

B-Spline Rendering• Transform it to a set of Bezier curves• Convert the I-th span into a Bezier representation

• Consider the entire B-spline curve

• Transform it to a set of Bezier curves• Convert the I-th span into a Bezier representation

• Consider the entire B-spline curve

110

11

−++

k

kiii

v,......,v,vp,......,p,p

3)3(4)3(47430

210

+−− nn

n

v,......,v,......,v,......,v,v,......,vp,......,p,p,p

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Matrix Expression

• The matrix structure and components of B?

• The matrix structure and components of A?

• The matrix structure and components of B?

• The matrix structure and components of A?

⎥⎥⎥

⎢⎢⎢

⎡=

⎥⎥⎥

⎢⎢⎢

+− nn p

pB

v

vΜΜ

0

3)3(4

0

ABAvq ==

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

B-Spline Discretization• Parametric domain: [u(k-1),u(n+1)]• There are n+2-k curve spans (pieces)• Assuming m+1 points per span (uniform

sampling)• Total sampling points m(n+2-k)+1=l• B-spline discretization with corresponding

parametric values:

• Parametric domain: [u(k-1),u(n+1)]• There are n+2-k curve spans (pieces)• Assuming m+1 points per span (uniform

sampling)• Total sampling points m(n+2-k)+1=l• B-spline discretization with corresponding

parametric values:

)()( ,0

10

10

ikj

n

jjii

l

l

vBv ∑=

== pcq

v,......,vq,......,q

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

B-Spline Discretization• Matrix equation

• A is (l)x(n+1) matrix, in general (l) is much larger than (n+1), so A is sparse

• The linear discretization for both modeling and rendering

• Matrix equation

• A is (l)x(n+1) matrix, in general (l) is much larger than (n+1), so A is sparse

• The linear discretization for both modeling and rendering

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥

⎢⎢⎢

⎡=⎥⎥⎥

⎢⎢⎢

−−− nlknlk

knk

l vBvB

vBvB

p

p

q

ΛΜΟΜ

ΛΜ

0

1,1,0

0,0,0

1

0

)()(

)()(

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

From B-Splines to NURBS• What are NURBS???• Non Uniform Rational B-Splines (NURBS)• Rational curve motivation• Polynomial-based splines can not represent commonly-

used analytic shapes such as conic sections (e.g., circles, ellipses, parabolas)

• Rational splines can achieve this goal• NURBS are a unified representation

– Polynomial, conic section, etc.– Industry standard

• What are NURBS???• Non Uniform Rational B-Splines (NURBS)• Rational curve motivation• Polynomial-based splines can not represent commonly-

used analytic shapes such as conic sections (e.g., circles, ellipses, parabolas)

• Rational splines can achieve this goal• NURBS are a unified representation

– Polynomial, conic section, etc.– Industry standard

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

From B-Splines to NURBS• B-splines

• NURBS (curve)

• B-splines

• NURBS (curve)

)()( ,0 ,

,

,

uB

wwww

u ki

n

i

i

izi

iyi

ixi

∑=

⎥⎥⎥⎥

⎢⎢⎢⎢

=ppp

c

=

== n

ikii

n

ikiii

uBw

uBwu

0,

0,

)(

)()(

pc

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Geometric NURBS• Non-Uniform Rational B-Splines• CAGD industry standard --- useful properties• Degrees of freedom

– Control points– Weights

• Non-Uniform Rational B-Splines• CAGD industry standard --- useful properties• Degrees of freedom

– Control points– Weights

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Rational Bezier Curve• Projecting a Bezier curve onto w=1 plane• Projecting a Bezier curve onto w=1 plane

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

From B-Splines to NURBS

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

NURBS Weights• Weight increase “attracts” the curve towards the

associated control point• Weight decrease “pushes away” the curve from

the associated control point

• Weight increase “attracts” the curve towards the associated control point

• Weight decrease “pushes away” the curve from the associated control point

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

NURBS for Analytic Shapes• Conic sections• Natural quadrics• Extruded surfaces• Ruled surfaces• Surfaces of revolution

• Conic sections• Natural quadrics• Extruded surfaces• Ruled surfaces• Surfaces of revolution

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

NURBS Circle

]4,4,4,3,2,2,1,0,0,0[knot1,5.0,5.0,1,5.0,5.0,1

==iw

gd,e,d,c,b,a,a=g

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

NURBS Curve• Geometric components

– Control points, parametric domain, weights, knots• Homogeneous representation of B-splines• Geometric meaning --- obtained from projection• Properties of NURBS

– Represent standard shapes, invariant under perspective projection, B-spline is a special case, weights as extra degrees of freedom, common analytic shapes such as circles, clear geometric meaning of weights

• Geometric components– Control points, parametric domain, weights, knots

• Homogeneous representation of B-splines• Geometric meaning --- obtained from projection• Properties of NURBS

– Represent standard shapes, invariant under perspective projection, B-spline is a special case, weights as extra degrees of freedom, common analytic shapes such as circles, clear geometric meaning of weights

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

NURBS Properties• Generalization of B-splines and Bezier splines• Unified formulation for free-form and analytic shape• Weights as extra DOFs• Various smoothness requirements• Powerful geometric toolkits• Efficient and fast evaluation algorithm• Invariance under standard transformations• Composite curves• Continuity conditions

• Generalization of B-splines and Bezier splines• Unified formulation for free-form and analytic shape• Weights as extra DOFs• Various smoothness requirements• Powerful geometric toolkits• Efficient and fast evaluation algorithm• Invariance under standard transformations• Composite curves• Continuity conditions

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Geometric Modeling• Why geometric modeling• Fundamental for visual computing

– Graphics, visualization– Computer aided design and manufacturing– Imaging– Entertainment, etc.

• Critical for virtual engineering• Interaction• Geometric information for decision making

• Why geometric modeling• Fundamental for visual computing

– Graphics, visualization– Computer aided design and manufacturing– Imaging– Entertainment, etc.

• Critical for virtual engineering• Interaction• Geometric information for decision making

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

From Curve to Surface

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Parameterization

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Surfaces• From curves to surfaces• A simple curve example (Bezier)

• Consider each control point now becoming a Bezier curve

• From curves to surfaces• A simple curve example (Bezier)

• Consider each control point now becoming a Bezier curve

]1,0[

)()(3

0

= ∑=

u

uBui

iipc

]1,0[

)(3

0,

= ∑=

v

vBj

jjii pp

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Surfaces• Then, we have• Matrix form• Then, we have• Matrix form

∑∑∑ ∑= == =

==3

0

3

0,

3

0

3

0, )()()())((),(

i jjiji

i jjji vBuBuBvBvu pps

[ ]

TTVUMPM

uBuBuBuB

uBuBuBuBvu

=

⎥⎥⎥⎥

⎢⎢⎢⎢

⎥⎥⎥⎥

⎢⎢⎢⎢

=

)()()()(

)()()()(),(

3

2

1

0

3,32,31,30,3

3,22,21,20,2

3,12,11,10,1

3,02,01,00,0

3210

pppppppppppppppp

s

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Surfaces• Further generalize to degree of n and m along

two parametric directions

• Question: which control points are interpolated?• How about B-spline surfaces???

• Further generalize to degree of n and m along two parametric directions

• Question: which control points are interpolated?• How about B-spline surfaces???

∑∑= =

=n

i

m

j

mj

niji vBuBvu

0 0, )()(),( ps

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Tensor Product Surfaces• Where are they from?• Monomial form• Bezier surface

• B-spline surface

• General case

• Where are they from?• Monomial form• Bezier surface

• B-spline surface

• General case

ji

i jji vuvu ∑∑= ,),( as

)()(),( , vBuBvu nj

mi

i jji∑∑= ps

)()(),( ,0 0

,, vBuBvu lj

m

i

n

jkiji∑∑

= =

= ps

∑∑=i j

jiji vGuFvu )()(),( ,vs

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Tensor Product Surface• Bezier Surface• Bezier Surface

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

B-Splines• B-spline curves• Tensor product B-splines

• Question again: which control points are interpolated???• Another question: can we get NURBS surface this

way???• Answer: NO!!! NURBS are not tensor-product surfaces• Another question: can we have NURBS surface?• YES!!!

• B-spline curves• Tensor product B-splines

• Question again: which control points are interpolated???• Another question: can we get NURBS surface this

way???• Answer: NO!!! NURBS are not tensor-product surfaces• Another question: can we have NURBS surface?• YES!!!

∑=

=n

ikii uBu

0, )()( pc

)()(),( ,0 0

,, vBuBvu lj

m

i

n

jkiji∑∑

= =

= ps

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

NURBS Surface• NURBS surface mathematics

• Understand this geometric construction• Question: why is it not the tensor-product

formulation??? Compare it with Bezier and B-spline construction

• NURBS surface mathematics

• Understand this geometric construction• Question: why is it not the tensor-product

formulation??? Compare it with Bezier and B-spline construction

∑ ∑

∑ ∑

= =

= == n

i

m

jljkiji

n

i

m

jljkijiji

vBuBw

vBuBwvu

0 0,,,

0 0,,,,

)()(

)()(),(

ps

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

NURBS Surface• Parametric variables: u and v• Control points and their associated weights:

(m+1)(n+1)• Degrees of basis functions: (k-1) and (l-1)• Knot sequence:

• Parametric domain:

• Parametric variables: u and v• Control points and their associated weights:

(m+1)(n+1)• Degrees of basis functions: (k-1) and (l-1)• Knot sequence:

• Parametric domain:

ln

km

vvvuuu

+

+

<=<=<=<=<=<=

............

10

10

11

11

+−

+−

<=<=<=<=

nl

mk

vvvuuu

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

NURBS Surface• The same principle to generate curves via

projection• Idea: associate weights with control points• Generalization of B-spline surface

• The same principle to generate curves via projection

• Idea: associate weights with control points• Generalization of B-spline surface

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Rectangular Surface

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Hermite Surfaces• How about Hermite surfaces???• Hermite Curve

• C(0) is not a curve s(0,v) which is also a HermiteCurve:

• How about Hermite surfaces???• Hermite Curve

• C(0) is not a curve s(0,v) which is also a HermiteCurve:

[ ]⎥⎥⎥⎥

⎢⎢⎢⎢

=

)1(')0(')1()0(

)()()()()( 3210

cccc

c uHuHuHuHu

[ ]⎥⎥⎥⎥

⎢⎢⎢⎢

=

)1,0()0,0(

)1,0()0,0(

)()()()(),0( 3210

v

v

vHvHvHvHvs

ssss

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Hermite Surfaces• Similarly, c(1) is now a curve s(1,v) which is

also a Hermite curve:

• The same are for c’(0) and c’(1):

• Similarly, c(1) is now a curve s(1,v) which is also a Hermite curve:

• The same are for c’(0) and c’(1):

[ ]⎥⎥⎥⎥

⎢⎢⎢⎢

=

)1,1()0,1(

)1,1()0,1(

)()()()(),1( 3210

v

v

vHvHvHvHvs

ssss

⎥⎥⎥⎥

⎢⎢⎢⎢

=

⎥⎥⎥⎥

⎢⎢⎢⎢

=

)1,1()0,1(

)1,1()0,1(

)(),1(

)1,0()0,0(

)1,0()0,0(

)(),0(

uv

uv

u

u

u

uv

uv

u

u

u

vHv

vHv

ssss

s

ssss

s

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Hermite Surfaces• It is time to put them together!

• Continuity conditions for surfaces• Bezier surfaces, B-splines, NURBS, Hermite

surfaces• C1 and G1 continuity

• It is time to put them together!

• Continuity conditions for surfaces• Bezier surfaces, B-splines, NURBS, Hermite

surfaces• C1 and G1 continuity

T

uvuvuu

uvuvuu

vv

vv

vHuHvu )(

)1,1()0,1()1,1()0,1()1,0()0,0()1,0()0,0()1,1()0,1()1,1()0,1()1,0()0,0()1,0()0,0(

)(),(

⎥⎥⎥⎥

⎢⎢⎢⎢

=

ssssssssssssssss

s

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Hermite Surfaces

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Surface Normal

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Surface Rendering• Parametric grids ([0,1]X[0,1]) as a set of

rectangles• Parametric grids ([0,1]X[0,1]) as a set of

rectangles

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Surface (Patch) Rendering• We use bicubic as an example• The simplest (naïve): convert curved patches into

primitives that we always know how to render• From curved surfaces to polygon quadrilaterals (non-

planar) and/or triangles (planar)• Surface evaluation at grid points• This is straight forward but inefficient, because it

requires many times of evaluation of s(u,v)• The total number is

• We use bicubic as an example• The simplest (naïve): convert curved patches into

primitives that we always know how to render• From curved surfaces to polygon quadrilaterals (non-

planar) and/or triangles (planar)• Surface evaluation at grid points• This is straight forward but inefficient, because it

requires many times of evaluation of s(u,v)• The total number is

vu δδ113

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Surface Rendering• Parametric grids ([0,1]X[0,1]) as a set of

rectangles• Parametric grids ([0,1]X[0,1]) as a set of

rectangles

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Surface Rendering• Better approach: precomputation

• M is constant throughout the entire patch. The followings are the same along isoparametriclines

• Use one dimensional array to compute and store (evaluation only once)

• Better approach: precomputation

• M is constant throughout the entire patch. The followings are the same along isoparametriclines

• Use one dimensional array to compute and store (evaluation only once)

[ ]⎥⎥⎥⎥⎥

⎢⎢⎢⎢⎢

=

1

1),(2

2

3

123

vvv

Muuuvus

[ ][ ]1

123

23

vvvuuu

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Surface Rendering• How about many patches: the array is

unchanged, its sampling rate is the same, this is more useful

• How about adaptive sampling based on curvature information!!!

• How to computer normal at any grid point (approximation)

• How about many patches: the array is unchanged, its sampling rate is the same, this is more useful

• How about adaptive sampling based on curvature information!!!

• How to computer normal at any grid point (approximation)

)),(),(()),(),((),(),(

vuvvuvuvuuvuvu vu

ssssss

−+×−+×

δδ

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Regular Surface• Generated from a set of control points. • Generated from a set of control points.

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Curve Network

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Coons Patch

)1,()0,(),1(),0(

uuvv

s,ss,s

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Coons Patch

),1(),0( vv s,s

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Coons Patch

)1,()0,( uu s,s

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Coons Patch

)1,()0,(),1(),0(

uuvv

s,ss,s

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Coons Patch• Bilinearly blended Coons patch

• Bicubically blended Coons patch

• Bilinearly blended Coons patch

• Bicubically blended Coons patch)()1,()()0,()(

)(),1()(),0()(

)()()(

11

102

11

101

212121

vLuvLuP

uLvuLvP

PPPPPPP

fff

fff

fff

+=

+=

−+=⊕=

)()1,()()1,()()0,()()0,()(

)(),1()(),1()(),0()(),0()(33

32

31

302

33

32

31

301

vHuvHuvHuvHuP

uHvuHvuHvuHvP

vv

uu

fffff

fffff

+++=

+++=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Coons Patch

)1,(),1,()0,()0,(

),1(),,1(),0(),0(

uuuu

vvvv

v

v

u

u

sss,ssss,s

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Gordon Surfaces• Generalization of Coons techniques• A set of curves

• Boolean sum using Lagrange polynomials

• Generalization of Coons techniques• A set of curves

• Boolean sum using Lagrange polynomialsmjvu

nivu

j

i

,......,0),,(,......,0),,(

==

ff

fff

ff

ff

)()()(

)(),()(

)(),()(

212121

02

01

PPPPPPP

vLvuP

uLvuP

m

j

mjj

n

i

nii

−+=⊕=

=

=

=

=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Transfinite Methods• Bilinearly blended Coons patch

– Interpolate four boundary curves• Bicubically blended Coons patch

– Interpolate curves and their derivatives• Gordon surfaces

– Interpolate a curve-network• Triangular extension

– Interpolate over triangles

• Bilinearly blended Coons patch– Interpolate four boundary curves

• Bicubically blended Coons patch– Interpolate curves and their derivatives

• Gordon surfaces– Interpolate a curve-network

• Triangular extension– Interpolate over triangles

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Triangular Surfaces

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Recursive Subdivision Algorithm

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Curve Mathematics (Cubic)• Bezier curve

• Control points and basis functions

• Image and properties of basis functions

• Bezier curve

• Control points and basis functions

• Image and properties of basis functions

∑=

=3

0

3 )()(i

ii uBu pc

333

232

231

330

)(

)1(3)(

)1(3)(

)1()(

uuB

uuuB

uuuB

uuB

=

−=

−=

−=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Recursive Evaluation• Recursive linear interpolation• Recursive linear interpolation

)(

)()1(

30

21

20

12

11

10

03

02

01

00

u

uu

cp

pp

ppp

pppp

=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Properties• Basis functions are non-negative• The summation of all basis functions is unity• End-point interpolation• Binomial expansion theorem

• Convex hull: the curve is bounded by the convex hull defined by control points

• Basis functions are non-negative• The summation of all basis functions is unity• End-point interpolation• Binomial expansion theorem

• Convex hull: the curve is bounded by the convex hull defined by control points

npc,pc == )1()0( 0

inin

i

n uuin

uu −

=

−⎟⎟⎠

⎞⎜⎜⎝

⎛=+− ∑ )1())1((

0

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Properties• Basis functions are non-negative• The summation of all basis functions is unity• End-point interpolation• Binomial expansion theorem

• Convex hull: the curve is bounded by the convex hull defined by control points

• Basis functions are non-negative• The summation of all basis functions is unity• End-point interpolation• Binomial expansion theorem

• Convex hull: the curve is bounded by the convex hull defined by control points

npc,pc == )1()0( 0

inin

i

n uuin

uu −

=

−⎟⎟⎠

⎞⎜⎜⎝

⎛=+− ∑ )1())1((

0

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Derivatives• Tangent vectors can easily evaluated at the end-

points• Second derivatives at end-points can also be

easily computed:

• Tangent vectors can easily evaluated at the end-points

• Second derivatives at end-points can also be easily computed:

)p(pc);p(pc 2301 )1('3)0(' −=−=

)pp(p))p(p)p((pc

)pp(p))p(p)p((pc

1231223)2(

0120112)2(

2632)1(

2632)0(

+−=−−−×=

+−=−−−×=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Derivative Curve• The derivative of a cubic Bezier curve is a

quadratic Bezier curve• The derivative of a cubic Bezier curve is a

quadratic Bezier curve

22312

201

32

22

12

02

3)1(23)1(3

3))1(2(3))1(2)1((3)1(3)('

uuuu

uuuuuuuuu

)p(p)p(p)p(p

ppppc

−+−−+−−

=+−−+−−−+−−=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

More Properties (Cubic)• Two curve spans are obtained, and both of them

are standard Bezier curves (through reparameterization)

• The control points for the left and the right are

• Two curve spans are obtained, and both of them are standard Bezier curves (through reparameterization)

• The control points for the left and the right are]1,0[),(]1,0[),(

]1,[),(],0[),(

∈∈

∈∈

uuuu

uvvuvv

r

l

cccc

03

12

21

30

30

20

10

00

p,p,p,p

p,p,p,p

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Barycentric Coordinates

RS

T

V

)();();(

1

RSrtsSTsrtTStsrtTsSrRV

tsr

→→→++=

=++

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Triangular Bezier Patch• Triangular Bezier surface

• Where r+s+t=1, and they are local barycentriccoordinates

• Basis functions are Bernstein polynomials of degree n

• Triangular Bezier surface

• Where r+s+t=1, and they are local barycentriccoordinates

• Basis functions are Bernstein polynomials of degree n

∑=++

>=

=nkji

kji

nkjikji tsrBvu

0,,,,,, ),,(),( ps

kjinkji tsr

kjintsrB

!!!!),,(,, =

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Triangular Bezier Patch• How many control points and basis functions:

• Partition of unity

• Positivity

• How many control points and basis functions:

• Partition of unity

• Positivity

)2)(1(21

++ nn

∑>=

=0,,

,, 1),,(kji

nkji tsrB

]1,0[,,;0),,(,, ∈>= tsrtsrBnkji

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Recursive Evaluation

n

lkji

lkji

lkji

lkji

kjikji

vu

kjilnkjitsr

0,0,0

11,,

1,1,

1,,1,,

,,0

,,

),(

0,,,;

ps

pppp

pp

=

>=−=++++=

=−

+−+

−+

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Properties• Efficient algorithms• Recursive evaluation• Directional derivatives• Degree elevation• Subdivision• Composite surfaces

• Efficient algorithms• Recursive evaluation• Directional derivatives• Degree elevation• Subdivision• Composite surfaces

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Research Issues• Continuity across adjacent patches• Integral computation• Triangular splines over regular triangulation• Transform triangular splines to a set of piecewise

triangular Bezier patches• Interpolation/approximation using triangular

splines

• Continuity across adjacent patches• Integral computation• Triangular splines over regular triangulation• Transform triangular splines to a set of piecewise

triangular Bezier patches• Interpolation/approximation using triangular

splines

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Triangular Bezier Surface

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Recursive Evaluation

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Control points (Cubic)

0,0,31,0,22,0,13,0,0

0,1,21,1,12,1,0

0,2,11,2,0

0,3,0

ppppppp

ppp

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Basis Functions (Cubic)

rrrrrtrtttttrrsrststt

rsssstsss

33363

33

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Triangular Patch Subdivision

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Triangular Domain

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Triangular Coons-Gordon Surface

),,0(;0 tsfr = )0,,(;0 srft =

),0,(;0 trfs =

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Triangular Coons-Gordon Surface

.consts =

.constt =

.constr =

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Triangular Interpolation

srr

LtrLtsPtr

rLtsLsrP

tss

LsrLtrP

+=

+=+

=

+=+

=

+=

α

γγ

α

ββ

α

αα

)(),0,()(),,0()(

)(),,0()()0,,()(

)()0,,()(),0,()(

11

103

11

102

11

101

fff

fff

fff

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Triangular Interpolation• The Boolean sum of any two operators results

the same!

• Use cubic blending functions for C1 interpolation!

• The Boolean sum of any two operators results the same!

• Use cubic blending functions for C1 interpolation!

ffffff

)()()()()()(

3223

3113

2112

PPPPPPPPP

⊕=⊕=⊕=

.........)(

.........)()()0,,()()0,,()(),0,()(),0,()(

3

2

33

32

31

301

==

+++=

ff

fffff

QQ

HsrHsrDHtrDHtrQ αααα αα

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Gregory’s Method• Convex combination

• Generalize to pentagonal patch!

• Convex combination

• Generalize to pentagonal patch!..................

)()()()(

)()()()(

.........)(.........)(

),0,(),0,()(

3

2

222

2

1

123132231

3223

3113

2112

3

2

1

==

++=

++=⊕=⊕=⊕=

==

+=

aa

tsrsa

TaTaTaTTTT

TTTTTT

TT

trDtrT

ffff

ffff

ff

fff αα

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Triangular B-splines

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Surface Properties• Inherit from their curve generators• More!• Efficient algorithms• Continuity across boundaries• Interpolation and approximation tools

• Inherit from their curve generators• More!• Efficient algorithms• Continuity across boundaries• Interpolation and approximation tools

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spherical Parameterization

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spherical Parameterization

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Possible ApplicationsShape classificationMedical registrationShape classificationMedical registration

Solving PDEs on surfaces

Smooth surface fitting

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Shape Morphing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Morphing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Multiresolution Mapping

• Multiresolution morphing• Multiresolution morphing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Feature Mapping

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Texture Mapping

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Solid

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Parametric Solids• Tricubic solid

• Bezier solid

• B-spline solid

• NURBS solid

• Tricubic solid

• Bezier solid

• B-spline solid

• NURBS solid

]1,0[,,

),,(3

0

3

0

3

0

= ∑ ∑ ∑= = =

wvu

wvuwvui j k

kjiijkap

∑∑∑=i j k

kjiijk wBvBuBwvu )()()(),,( pp

∑∑∑=i j k

KkJjIiijk wBvBuBwvu )()()(),,( ,,,pp

∑ ∑ ∑∑ ∑ ∑

=

i j kKkJjIiijk

i j kKkJjIiijkijk

wBvBuBq

wBvBuBqwvu

)()()(

)()()(),,(

,,,

,,,pp

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Parametric Solids• Tricubic Hermite solid• In general

• Also known as “hyperpatch”• Parametric solids represent both exterior and interior• Examples

– A rectangular sold, a trilinear solid

• Boundary elements– 8 corner points, 12 curved edges, and 6 curved faces

• Tricubic Hermite solid• In general

• Also known as “hyperpatch”• Parametric solids represent both exterior and interior• Examples

– A rectangular sold, a trilinear solid

• Boundary elements– 8 corner points, 12 curved edges, and 6 curved faces

]1,0[,,),,(),,(),,(

),,(

⎥⎥⎥

⎢⎢⎢

⎡=

wvuwvuzwvuywvux

wvup

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Curves, Surfaces, and Solids• Isoparametric curves for surfaces

• Isoparametric curves for solids

• Isoparametric surfaces for solids

• Isoparametric curves for surfaces

• Isoparametric curves for solids

• Isoparametric surfaces for solids

..;

),(),(),(

constvconstu

vuvuvu

ji

ji

==

s,s,s

),,(),,(),,(),,( kjkiji wvuwvuwvuwvu s,s,s,s

),,(),,(),,(),,( kji wvuwvuwvuwvu s,s,s,s

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Curves, Surfaces, and Solids• Non-isoparametric curves for surfaces

• Non-isoparametric curves for solids

• Non-isoparametric surfaces for solids

• Non-isoparametric curves for surfaces

• Non-isoparametric curves for solids

• Non-isoparametric surfaces for solids

))(),(()()(

)(

),(

tvtutvtu

t

vu

s

c

s

⎥⎦

⎤⎢⎣

⎡=

))(),(),(()(

)()(

)(

),,(

twtvtutwtvtu

t

wvu

s

c

s

⎥⎥⎥

⎢⎢⎢

⎡=

)),(),,(),,((),,( bawbavbauwvu ss =

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

CSE530-11

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Surfaces of Revolution

x y

z

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Surfaces of Revolution• Geometric construction

– Specify a planar curve profile on y-z plane– Rotate this profile with respect to z-axis

• Procedure-based model• What kinds of shape can we model?• Review: three dimensional rotation w.r.t. z-axis

• Geometric construction– Specify a planar curve profile on y-z plane– Rotate this profile with respect to z-axis

• Procedure-based model• What kinds of shape can we model?• Review: three dimensional rotation w.r.t. z-axis

⎥⎥⎥

⎢⎢⎢

⎥⎥⎥

⎢⎢⎢

⎡ −=

⎥⎥⎥

⎢⎢⎢

zyx

zyx

1000)cos()sin(0)sin()cos(

'''

θθθθ

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Surfaces of Revolution• Mathematics: surfaces of revolution• Mathematics: surfaces of revolution

⎥⎥⎥

⎢⎢⎢

⎡−=

⎥⎥⎥

⎢⎢⎢

⎡=

)()cos()()sin()(

),(

)()(

0)(

uzvuyvuy

vu

uzuyu

s

c

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Frenet Frames• Motivation: attach a smoothly-varying

coordinate system to any location of a curve• Three independent direction vectors for a 3D

coordinate system: (1) tangent; (2) bi-normal; (3) normal

• Frenet coordinate system (frame) (t,b,n) varies smoothly, as we move along the curve c(u)

• Motivation: attach a smoothly-varying coordinate system to any location of a curve

• Three independent direction vectors for a 3D coordinate system: (1) tangent; (2) bi-normal; (3) normal

• Frenet coordinate system (frame) (t,b,n) varies smoothly, as we move along the curve c(u)

))()(()())()(()(

))(()(

uunormalizeuuunormalizeu

unormalizeu

uuu

u

tbnccb

ct

×=×=

=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Frenet Coordinate System

t

b

n

)()(

)(

uu

u

uu

u

ccc

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Sweeping Surface

xy

z

x

y

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

General Sweeping Surfaces• Surface of revolution is a special case of a sweeping

surface• Idea: a profile curve and a trajectory curve

• Move a profile curve along a trajectory curve to generate a sweeping surface

• Question: how to orient the profile curve as it moves along the trajectory curve?

• Answer: various options

• Surface of revolution is a special case of a sweeping surface

• Idea: a profile curve and a trajectory curve

• Move a profile curve along a trajectory curve to generate a sweeping surface

• Question: how to orient the profile curve as it moves along the trajectory curve?

• Answer: various options

)()(

2

1

vu

cc

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

General Sweeping Surfaces• Fixed orientation, simple translation of the

coordinate system of the profile curve along the trajectory curve

• Rotation: if the trajectory curve is a circle• Move using the “Frenet Frame” of the trajectory

curve, smoothly varying orientation• Example: surface of revolution• Differential geometry fundamentals: Frenet

frame

• Fixed orientation, simple translation of the coordinate system of the profile curve along the trajectory curve

• Rotation: if the trajectory curve is a circle• Move using the “Frenet Frame” of the trajectory

curve, smoothly varying orientation• Example: surface of revolution• Differential geometry fundamentals: Frenet

frame

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Frenet Swept Surfaces• Orient the profile Curve (C1(u)) using the Frenet frame

of C2(v)– Put C1(u) on the normal plane (n,b)– Place the original of C1(u) on C2(v)– Align the x-axis of C1(u) with –n– Align the y-axis of C1(u) with b

• Example: if C2(v) is a circle• Variation (generalization)• Scale C1(u) as it moves• Morph C1(u) into C3(u) as it moves• Use your own imagination!

• Orient the profile Curve (C1(u)) using the Frenet frame of C2(v)– Put C1(u) on the normal plane (n,b)– Place the original of C1(u) on C2(v)– Align the x-axis of C1(u) with –n– Align the y-axis of C1(u) with b

• Example: if C2(v) is a circle• Variation (generalization)• Scale C1(u) as it moves• Morph C1(u) into C3(u) as it moves• Use your own imagination!

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Ruled Surfaces

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Ruled Surfaces• Move one straight line along a curve• Example: plane, cone, cylinder• Cylindrical surface• Surface equation

• Isoparametric lines• More examples

• Move one straight line along a curve• Example: plane, cone, cylinder• Cylindrical surface• Surface equation

• Isoparametric lines• More examples

)()(),()1,()0,()1(),(

)()()1(),(

uvuvuuvuvvu

uvuvvu

qpssss

bas

+=+−=

+−=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Developable Surfaces• Deform a surface to planar shape without

length/area changes• Unroll a surface to a plane without

stretching/distorting• Example: cone, cylinder• Developable surfaces vs. Ruled surfaces• More examples???

• Deform a surface to planar shape without length/area changes

• Unroll a surface to a plane without stretching/distorting

• Example: cone, cylinder• Developable surfaces vs. Ruled surfaces• More examples???

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Developable Surface

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Summary• Parametric curves and surfaces• Polynomials and rational polynomials• Free-form curves and surfaces• Other commonly-used geometric primitives

(e.g., sphere, ellipsoid, torus, superquadrics, blobby, etc.)

• Motivation: – Fewer degrees of freedom– More geometric coverage

• Parametric curves and surfaces• Polynomials and rational polynomials• Free-form curves and surfaces• Other commonly-used geometric primitives

(e.g., sphere, ellipsoid, torus, superquadrics, blobby, etc.)

• Motivation: – Fewer degrees of freedom– More geometric coverage

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Straight Line

042 =−+ yx

042 <−+ yx

042 >−+ yx

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Straight Line• Mathematics

• Example

• Mathematics

• Example

0)(0)(

0

=++−=+++

=++

cyaxcbyax

cbyax

αα

042 =−+ yx

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Circle

0122 =−+ yx

0122 <−+ yx

0122 >−+ yx

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Conic Sections• Mathematics• Examples

– Ellipse– Hyperbola– Parabola– Empty set– Point– Pair of lines– Parallel lines– Repeated lines

• Mathematics• Examples

– Ellipse– Hyperbola– Parabola– Empty set– Point– Pair of lines– Parallel lines– Repeated lines

02 22 =+++++ feydxcybxyax

02072

032032

0132032

05320532

2

2

22

22

22

2

22

22

=

=−

=−

=+

=++

=+

=−−

=−+

xx

yxyxyxyxyxyx

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Conics • Parametric equations of conics• Generalization to higher-degree curves• How about non-planar (spatial) curves

• Parametric equations of conics• Generalization to higher-degree curves• How about non-planar (spatial) curves

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Plane

01=−++ zyx

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Plane and Intersection

apbp

cp

n

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Plane • Example• General plane equation• Normal of the plane

• Arbitrary point on the plane

• Example• General plane equation• Normal of the plane

• Arbitrary point on the plane

01 =−++ zyx

0=+++ yczbyax

⎥⎥⎥

⎢⎢⎢

⎡=

cba

n

⎥⎥⎥

⎢⎢⎢

⎡=

z

y

x

a

aaa

p

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Plane• Plane equation derivation

• Parametric representation (given three points on the plane and they are non-collinear!)

• Plane equation derivation

• Parametric representation (given three points on the plane and they are non-collinear!)

0)(

0)()()(

=++−++

=−+−+−

cabaaaczbyax

cazbayaax

zyx

zyx

vuvu acaba )p(p)p(pp)p( −+−+=,

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Plane • Explicit expression (if c is non-zero)

• Line-Plane intersection

• Explicit expression (if c is non-zero)

• Line-Plane intersection

)(1 dbyaxc

z ++−=

)()()(

0))()(

01

0

01

0

010

010

ppp

npnpnp

)p(p(pn)p(ppl

planeplaneplaneu

duuu

−−=

−−=

=+−+−+=

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Circle• Implicit equation• Parametric function

• Parametric representation using rational polynomials (the first quadrant)

• Parametric representation is not unique!

• Implicit equation• Parametric function

• Parametric representation using rational polynomials (the first quadrant)

• Parametric representation is not unique!

0122 =−+ yx

πθθθ

θ

20)sin()cos(

)(

<=<=

⎥⎦

⎤⎢⎣

⎡=c

]1,0[1

2)(

11)(

2

2

2

∈+

=

+−

=

uuuuy

uuux

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

CSE530-13

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

0),( =yxf

),( yxfz =

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Implicit Equations for Curves• Describe an implicit relationship• Planar curve (point set)• The implicit function is not unique

• Comparison with parametric representation

• Describe an implicit relationship• Planar curve (point set)• The implicit function is not unique

• Comparison with parametric representation

}0),(|),{( =yxfyx

}0),(|),{(}0),(|),{(

=−=+

yxfyxyxfyx

αα

⎥⎦

⎤⎢⎣

⎡=

)()(

)(uyux

up

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Implicit Equations for Curves• Implicit function is a level-set

• Examples (straight line and conic sections)

• Other examples– Parabola, two parallel lines, ellipse, hyperbola, two

intersection lines

• Implicit function is a level-set

• Examples (straight line and conic sections)

• Other examples– Parabola, two parallel lines, ellipse, hyperbola, two

intersection lines

⎩⎨⎧

==

0),(

zyxfz

020

22 =+++++

=++

feydxcybxyaxcbyax

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Implicit Functions for Curves• Parametric equations of conics• Generalization to higher-degree curves• How about non-planar (spatial) curves

• Parametric equations of conics• Generalization to higher-degree curves• How about non-planar (spatial) curves

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Implicit Equations for Surfaces• Surface mathematics• Again, the implicit function for surfaces is not

unique

• Comparison with parametric representation

• Surface mathematics• Again, the implicit function for surfaces is not

unique

• Comparison with parametric representation

}0),,(|),,{( =zyxfzyx

}0),,(|),,{(}0),,(|),,{(

=−=+

zyxfzyxzyxfzyx

αα

⎥⎥⎥

⎢⎢⎢

⎡=

),(),(),(

),(vuzvuyvux

vup

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Implicit Equations for Surfaces• Surface defined by implicit function is a level-set

• Examples– Plane, quadric surfaces, tori, superquadrics, blobby

objects• Parametric representation of quadric surfaces• Generalization to higher-degree surfaces

• Surface defined by implicit function is a level-set

• Examples– Plane, quadric surfaces, tori, superquadrics, blobby

objects• Parametric representation of quadric surfaces• Generalization to higher-degree surfaces

⎩⎨⎧

==

0),,(

wzyxfw

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Quadric Surfaces• Implicit functions• Examples

– Sphere– Cylinder– Cone– Paraboloid– Ellipsoid– Hyperboloid

• More – Two parallel planes, two intersecting planes, single plane,

line, point

• Implicit functions• Examples

– Sphere– Cylinder– Cone– Paraboloid– Ellipsoid– Hyperboloid

• More – Two parallel planes, two intersecting planes, single plane,

line, point

0222 =+++++++++ kjzhygxfyzexzdxyczbyax

0405432

00

0101

222

222

22

222

22

222

=+−+

=−++

=++

=−+

=−+

=−++

zyxzyx

zyxzyx

yxzyx

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Quadrics: Parametric Rep.• Sphere

• Ellipsoid

• Geometric meaning of these parameters

• Sphere

• Ellipsoid

• Geometric meaning of these parameters

],[];2

,2

[

)sin()sin()cos()cos()cos(02222

ππβππα

αβαβα

−∈−∈

===

=−++

rzryrx

rzyx

],[];2

,2

[

)sin()sin()cos()cos()cos(

012

2

2

2

2

2

ππβππα

αβαβα

−∈−∈

===

=−++

czbyax

cz

by

ax

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Generalization• Higher-degree polynomials

• Non polynomials

• Higher-degree polynomials

• Non polynomials

∑ ∑ ∑ =i j k

kjiijk zyxa 0

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Superquadrics• Geometry (generalization of quadrics)• Superellipse• Superellipsoid

• Parametric representation

• What is the meaning of these control parameters?

• Geometry (generalization of quadrics)• Superellipse• Superellipsoid

• Parametric representation

• What is the meaning of these control parameters?

012

2

2

1 =−⎟⎠⎞

⎜⎝⎛+⎟

⎠⎞

⎜⎝⎛ ss

ay

ax

013

2

2

2

1

1

2

22

=−⎟⎟⎠

⎞⎜⎜⎝

⎛+

⎟⎟⎟

⎜⎜⎜

⎟⎟⎠

⎞⎜⎜⎝

⎛+⎟⎟

⎞⎜⎜⎝

⎛az

ay

ax

ss

ss

),[];2

,2

[

)(sin)(sin)(cos)(sin)(cos

2

21

21

3

2

1

ππβππα

αβαβα

−∈−∈

⎥⎥⎥

⎢⎢⎢

=⎥⎥⎥

⎢⎢⎢

s

ss

ss

aaa

zyx

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Algebraic Function• Parametric representation is popular, but…• Formulation

• Properties…– Powerful, but lack of modeling tools

• Parametric representation is popular, but…• Formulation

• Properties…– Powerful, but lack of modeling tools

∑ ∑ ∑ =i j k

kjiijk zyxa 0

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Algebraic Patch

Tetrahedron

Control point, weight

Algebraic patch

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Algebraic Patch• A tetrahedron with non-planar vertices

• Trivariate barycentric coordinate (r,s,t,u) for p

• A regular lattice of control points and weights

• A tetrahedron with non-planar vertices

• Trivariate barycentric coordinate (r,s,t,u) for p

• A regular lattice of control points and weights

nnnn 000000000000 ,,, vvvv

1000000000000

=++++++=

utsrutsr nnnn vvvvp

nlkjilkjin

lkji nnnnijkl

=+++>=

+++=

;0,,,

000000000000 vvvvp

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Algebraic Patch• There are (n+1)(n+2)(n+3)/6 control points. A

weight w(I,j,k,l) is also assigned to each control point

• Algebraic patch formulation

• Properties– Meaningful control, local control, boundary

interpolation, gradient control, self-intersection avoidance, continuity condition across the boundaries, subdivision

• There are (n+1)(n+2)(n+3)/6 control points. A weight w(I,j,k,l) is also assigned to each control point

• Algebraic patch formulation

• Properties– Meaningful control, local control, boundary

interpolation, gradient control, self-intersection avoidance, continuity condition across the boundaries, subdivision

0!!!!

!=∑∑∑ ∑

−−−=

lkji

i j k kjinlijkl utsr

lkjinw

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spatial Curves• Intersection of two surfaces• Intersection of two surfaces

⎩⎨⎧

==

0),,(0),,(

zyxgzyxf

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Algebraic Solid• Half space

• Useful for complex objects (refer to notes on solid modeling)

• Half space

• Useful for complex objects (refer to notes on solid modeling)

}0),,(|),,{(};0),,(|),,{(

>=<=

zyxfzyxorzyxfzyx

0f =

⎥⎥⎥⎥

⎢⎢⎢⎢

=

Λ),,(),,(),,(

),,(3

2

1

zyxfzyxfzyxf

zyx

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Volume Datasets

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Isosurface Rendering

Isovalue =30IsovalueIsovalue =30=30 Isovalue =100IsovalueIsovalue =100=100 Isovalue =200IsovalueIsovalue =200=200

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Direct Volume Rendering

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Implicit Functions• Long history: classical algebraic geometry• Implicit and parametric forms

– Advantages– Disadvantages

• Curves, surfaces, solids in higher-dimension• Intersection computation• Point classification• Larger than parameter-based modeling• Unbounded geometry• Object traversal• Evaluation

• Long history: classical algebraic geometry• Implicit and parametric forms

– Advantages– Disadvantages

• Curves, surfaces, solids in higher-dimension• Intersection computation• Point classification• Larger than parameter-based modeling• Unbounded geometry• Object traversal• Evaluation

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Implicit Functions• Efficient algorithms, toolkits,software• Computer-based shape modeling and design• Geometric degeneracy and anomaly• Algebraic and geometric operations are often

closed• Mathematics: algebraic geometry• Symbolic computation• Deformation and transformation• Shape editing, rendering, and control

• Efficient algorithms, toolkits,software• Computer-based shape modeling and design• Geometric degeneracy and anomaly• Algebraic and geometric operations are often

closed• Mathematics: algebraic geometry• Symbolic computation• Deformation and transformation• Shape editing, rendering, and control

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Implicit Functions• Conversion between parametric and implicit

forms• Implicitization vs. parameterization• Strategy: integration of both techniques• Approximation using parametric models

• Conversion between parametric and implicit forms

• Implicitization vs. parameterization• Strategy: integration of both techniques• Approximation using parametric models

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Free-Form Deformation• Free-Form Deformation Example• Free-Form Deformation Example

Original Model

Solid Mesh

Deformed Mesh

Result

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Free-Form Deformation• Free-Form Deformation Example (Complex >> 49000

faces)• Free-Form Deformation Example (Complex >> 49000

faces)

Original Model

Solid Mesh

Deformed (Results in both surface rendered and wireframe)

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Free-Form Deformation• Free-Form Deformation Example (Non-trivial topology)• Free-Form Deformation Example (Non-trivial topology)

Original Model

Solid Mesh with a hole

Deformed Mesh

Result (no change in central cylinder)

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Free-Form Deformation• Free-Form Deformation Example (Localized)• Free-Form Deformation Example (Localized)

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Shape Modeling• Direct Modeling / Manipulation• Direct Modeling / Manipulation

Spring, 2005CSE530 Lecture Notes ST NY BR KSTATE UNIVERSITY OF NEW YORK

Department of Computer Science

Center for Visual Computing

Material Modeling• Material Representation (Non-homogeneous)• Material Representation (Non-homogeneous)