lecture - university of michigan

16
1 1 Lecture 5 Parametric Curves Goal : Better Approximation of a Curve than Piecewise Linear • Parametric Curve Segments ) ( ) ( ) ( 2 1 u z z u u u u y y u x x = = = • Cubic Polynomial • Reasonable Compromise • Flexibility (without “ringing”) • Speed of Computation • Easy Manipulation / Differentiation 1 0 ) ( 2 3 = u d u c u b u a u x x x x x 1 0 2 3 ) ( ) ( 2 = = u c u b u a u x u x du d x x x 2 Lecture 5 Splines • Spline Curves • Defined by a set of Control Points • All Points on the Curve • Some Points on the Curve • No Points on the Curve • Ease of Interaction Useful in Design • Interpolate => Control points on curve • Approximate => Control points not on curve 0 P 1 P 2 P 3 P 0 P 1 P 2 P 3 P 0 P 1 P 2 P 3 P 0 P 1 P 2 P 3 P Convex Hull Control Graph

Upload: others

Post on 02-Dec-2021

3 views

Category:

Documents


0 download

TRANSCRIPT

1

1

Lecture5Parametric Curves

Goal : Better Approximation of a Curve than Piecewise Linear

• Parametric Curve Segments

)()()(

21

uzzuuuuyy

uxx

=≤≤=

=

• Cubic Polynomial• Reasonable Compromise

• Flexibility (without “ringing”)• Speed of Computation

• Easy Manipulation / Differentiation

10)( 23 ≤≤+++= uducubuaux xxxx

1023)()( 2 ≤≤++=′= ucubuauxuxdu

dxxx

2

Lecture5Splines

• Spline Curves• Defined by a set of Control Points

• All Points on the Curve• Some Points on the Curve• No Points on the Curve

• Ease of Interaction Useful in Design

• Interpolate => Control points on curve• Approximate => Control points not on curve

0P

1P

2P

3P

0P

1P

2P

3P0P

1P

2P

3P0P

1P

2P

3P

Convex Hull Control Graph

2

3

Lecture5Splines

• Spline Representation• Boundary Conditions• Basis Matrix• Blending Functions

10)( 23 ≤≤+++= uducubuaux xxxx

[ ] [ ] [ ]CU=

=

x

x

x

x

d

c

b

a

uuu 123

[ ] [ ][ ]GMC =Let

4

Lecture5Splines

[ ][ ] spline) of each typefor (DifferentMatrix Basis

)Conditions(Boundary sConstraint Geometric

=

=

M

G

• The Combination of the Basis Matrix with the Geometric Constraints Give Rise to the Polynomial Coefficients

Linear Interpolation

1P

2P2)()1( PP(u)P 1 uu +−=

[ ] [ ] [ ] [ ] [ ]GMUCU ==)(ux

• The Combination of the Parametric Matrix with the Basis MatrixGives rise to the Blending Functions

Blending Functions

3

5

Lecture5

[ ] [ ][ ][ ] [ ]

==

=

4

3

2

1

44434241

34333231

24232221

14131211

23 1

)(

)(

)(

g

g

g

g

mmmm

mmmm

mmmm

mmmm

uuu

uz

uy

ux

GMUP(u)

Splines

• Determine Blending Functions for Splines

44434242

143

34333232

133

24232222

123

14131212

113

)()()(

)()(

gmummumugmummumugmummumugmummumuux

+++++++++++

++++=

• Spline Curve is a Weighted Sum of Elements inthe Geometry Matrix

6

Lecture5Hermite Splines

• Boundary Conditions are :• Two Endpoints• Tangents at Each End

1 @Endpoint )1(0 @Endpoint )0(

====

uPuP

1 @Tangent )1(0 @Tangent )0(

==′==′

uPuP

[ ] [ ]

=

=

z

z

z

z

y

y

y

y

x

x

x

x

d

c

b

a

d

c

b

a

d

c

b

a

uuu

uz

uy

ux

1

)(

)(

)(23P(u)

[ ] [ ]

=

z

z

z

z

y

y

y

y

x

x

x

x

d

c

b

a

d

c

b

a

d

c

b

a

10000)P( [ ] [ ]

=

z

z

z

z

y

y

y

y

x

x

x

x

d

c

b

a

d

c

b

a

d

c

b

a

11111)P(

4

7

Lecture5Hermite Splines

[ ]

−−

==

0001

0100

1233

1122

Matrix Basis Hermite HM

[ ] [ ][ ][ ] [ ]

−−

==

=

4

3

2

1

0001

0100

1233

1122

123

)(

)(

)(

P

P

P

P

uuu

uz

uy

ux

HH GMUP(u)

423

323

223

123 )()2()32()132( PPPPP(u) uuuuuuuuu −++−++−++−=

2

1

)1()0(

PP

==

PP

4

3

)1()0(

PP

=′=′

PPwhere

8

Lecture5Bezier Curves

• Developed by Pierre Bezier• Automobile Design for Renault

• Arbitrary Number of Control Points• First and Last Control Points Lie ON the Curve

5

9

Lecture5Bezier Curves

• Given (n+1) Control Points the Bezier Curve isDetermined by :

10)()( ,

0

≤≤= ∑=

uuBu nk

n

k

kPP

sPolynomialBerstein are )( where , uB nk

knknk uu

knk

nuB −−

−= )1(

)!(!

!)(,

Would like the highest order of u to be 3 (u3), so k=3 means n=3

Note: n=3 implies 4 control points

10

Lecture5Bezier Curves

• Given (n+1) Control Points the Bezier Curve isDetermined by :

10)()( 3,

3

0

≤≤= ∑=

uuBu k

k

kPP

33

22

12

03 )1(3)1(3)1()( PPPPP uuuuuuu +−+−+−=

[ ] [ ] [ ] [ ]BBu GMUP =)(

[ ] [ ]

−−

−−

=

3

2

1

0

23

0001

0033

0363

1331

1)(

P

P

P

P

uuuuP

)(3)1()(3)0(

)1()0(

233

012

1

0

PPPPPPPP

PPPP

−=′=−=′=

==

6

11

Lecture5Curve Segment Continuity

• Parametric Continuity• Zero-th Order, Co

Curve segments meet (join point)

• 1st Order, C1

1st Derivatives are equal at join point• 2nd Order, C2

2nd Derivatives are equal at join point

2Segment for )0()1( 1Segment PP =

Tangents Equal

C0

C1

C2Curvature Continuous

• Geometric Continuity• Zero-th Order, Go

Curve segments meet (join point)• 1st Order, G1

1st Derivatives are proportional at join point• 2nd Order, G2

2nd Derivatives are proportional at join point

Parametric Continuity

Geometric Continuity

12

Lecture5Bezier Curves Segments

0P

1P2P

3P0Q

1Q

2Q

3Q

1S2S

• Zero-th Order Continuity Achieved by : 30 PQ =

• C1 Continuity Achieved by :All Three Points Are Collinear and Equally Spaced

)( 2331 PPPQ −+=

• C2 Continuity Achieved by : )(4 2312 PPPQ −+=

C2 Continuity May Be Too Restrictive Since It Leaves Only Q3 for Adjustment

7

13

Lecture5Splines

• Blending Functions• Everywhere non-zero• ALL control points effect curve

14

Lecture5Splines

• Blending Functions

Hermite

Bezier

323

223

123

023 )()2()32()132()( PPPPP uuuuuuuuuu −++−++−++−=

33

22

12

03 )1(3)1(3)1()( PPPPP uuuuuuu +−+−+−=

u u u u

u u u u

1 1 1 1

1 1 1 1

0.4 0.4

0.2

8

15

Lecture5Splines

• B-splines• Large class of approximating splines

• Uniform, Non-rational• Non-uniform,Non-rational• Non-uniform, Rational (NURBS)

• Weighted sums of polynomial basis functions

• Local curve control

• Degree of blending polynomial independent of number of control points

• Much more complex

16

Lecture5Bezier Patches

• Parametric Curve Along Two Dimensions

u

v

• 16 Control Points• 4 Corner Points on Curve

33323130

23222120

13121110

03020100

PPPP

PPPP

PPPP

PPPP

9

17

Lecture5Bezier Patches

33

22

12

03 )1(3)1(3)1()( PPPPP uuuuuuu +−+−+−=Curve :

[ ] [ ] [ ]

=

3

2

1

0

123)(

PPPP

MP Buuuu [ ]

−−

−−

=

0001

0033

0363

1331

BM

[ ] [ ][ ] [ ] [ ]

=

1

1),(2

3

23

v

v

v

uuuvu TBB MPMPSurface :

[ ]

=

33323130

23222120

13121110

03020100

PPPP

PPPP

PPPP

PPPP

P

)(3)0( 01 PPP −=′

)(3)1( 23 PPP −=′

18

Lecture5Bezier Patches

)(9)0,0( 11100100 PPPPP +−−=vu

00)0,0( PP =

• Tangent / Control Point Relationships

( )r rP P Pv ,0 0 3 01 00= −( )

( )r rP P Pu ,0 0 3 10 00= −( )

10

19

Lecture5Bezier Patches

Corner Points

u

v

Tangent Vectors in u

u

v

)(3)0,0( 0001 PPP −=u

)(3)0,0( 0001 PPP −=v

00)0,0( PP =

u

v

Tangent Vectors in v

u

v

Twist Vectors

)(9

)0,0(

11100100 PPPP

P

+−−

=vu

20

Lecture5Bezier Patches

• Continuity Between Patches• C0 and G0 by using common control points along edge• G1 when collinear control points with length in equal ratios

33323130

23222120

13121110

03020100

PPPP

PPPP

PPPP

PPPP

33323130

23222120

13121110

03020100

QQQQ

QQQQ

QQQQ

QQQQ

0003 QP =1013 QP =

2023 QP =3033 QP =

( ) ( )00010203 QQkPP −=−

( ) ( )10111213 QQkPP −=−

( ) ( )20212223 QQkPP −=−

( ) ( )30313233 QQkPP −=−

11

21

Lecture5Subdivision Surfaces

• Create smooth surfaces out of arbitrary meshes

• The need to generalize spline patch model to arbitrary surfaces

• Define a smooth surface as the limit of a sequence of successive refinements

22

Lecture5Subdivision Surfaces

12

23

Lecture5Subdivision Surfaces

Many Attractive Features

• Arbitrary topology

• Scalability LOD

• Uniformity

• Numerical Quality

• Code Simplicity

24

Lecture5Hierachical Modeling

• Construct complex objects from modular subsystems

• Increase storage economy• Subsytems (instances) stored once• Transformations matricies stored for each invocation

• Easy object updates• Update instance• Chahnges propagated to each use of the instance

• Graphical representation of modeled object

13

25

Lecture5Hierarchical Modeling

Car

Driver

Rear

Passenger

RearFrame HingeHandle Window

Driver Passenger

Front Front

Body SuspensionInterior Engine

ChasisWheelsSeats ConsoleSteeringWheel

Doors Hood

Wheel

Tire BrakesHubcap

26

Lecture5Hierarchical Modeling

CSG Object

Obj A Obj B

Obj C Obj D Obj E

Operator

Operator

[ ]CM [ ]DM [ ]EM

[ ]BM[ ]AM

14

27

Lecture5Hierarchical Modeling

Allows the building of complex scenes with a basic set of 3-D primitives

•Each 3-D object can be defined in it’s own, convenient, space.•Transforms will allow us to assemble the primitives•These Transforms are nested or hierarchical.

[ ]M

[ ]N

[ ]

[ ]

28

Lecture5Hierarchical Modeling

Example code:

Procedure Scene()House(B)House(D)

end

Procedure House(E)Prism(E•M)Cube(E•M)

end

Procedure Cube(F)…

end

Procedure Prism(F)…

end

15

29

Lecture5Hierarchical Modeling

Matrix Stack:

Start with identity 4 x 4

Each transform used is multiplied into the 4 x4

Special commands help manipulate the Matrix

•Push - make a copy of the 4 x 4 and save it

•Pop - restore the saved copy of the 4 x 4

30

Lecture5Hierarchical Modeling

•First transform should be the viewing TransformThis sets up the camera - all objects get transformed by this

•Push this matrix•Multiply in B matrix. •Draw House•Pop matrix•Push this matrix•Multiply in D matrix•Draw House•Pop Matrix

[ ][ ]I V

[ ][ ]I V

[ ][ ]I V [ ][ ]V B

[ ][ ]I V

[ ][ ]I V [ ][ ]V D[ ][ ]I V

[ ][ ]I V [ ][ ]I V

[ ][ ]I V

Dra

w H

ouse

Dra

w H

ouse

Draw Scene:

16

31

Lecture5Hierarchical Modeling

Draw House:

•Push matrix•Multiply in M matrix•Draw Prism•Pop matrix•Push matrix•Multiply in N matrix•Draw Cube•Pop matrix

[ ][ ]V B

[ ][ ]I V

[ ][ ]V B

[ ][ ]V B

[ ][ ]I V

[ ][ ][ ]V B M[ ][ ]V B

[ ][ ]I V

Dra

w P

rism

[ ][ ]V B

[ ][ ]I V

[ ][ ]V B

[ ][ ]V B

[ ][ ]I V

[ ][ ][ ]V B N[ ][ ]V B

[ ][ ]I V

[ ][ ]V B

[ ][ ]I V

Dra

w P

rism