12/9/2016 02:28 uml graphics ii 91.547 b-splines nurbs session 3a

Post on 18-Jan-2018

228 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

32/9/ :28 UML B-splines: Sharing of Control Points

TRANSCRIPT

105/03/23 21:58

UML

Graphics II 91.547

B-SplinesNURBS

Session 3A

205/03/23 21:58

UML

B-splines

Suppose you wanted C0, C1 and C2 continuity at curve boundaries.

pi

pi3

pi1 pi2

Ci

Use all four control points to determine boundary continuitiesand only require that the curve pass “close” to the points.

C p bi i kk

ku u( ) ( )

0

3

305/03/23 21:58

UML

B-splines: Sharing of Control Points

pi

pi3

pi1 pi2

Ci

Ci1pi4

405/03/23 21:58

UML

B-splines: Using continuity requirements tocompute geometry matrix/blending functions

pi

pi3

pi1 pi2

Ci

Ci1pi4

C p b C p bi i kk

k i i kk

k( ) ( ) ( ) ( )1 1 0 00

3

1 10

3

C0 continuity here requires:

505/03/23 21:58

UML

B-splines: Using continuity requirements tocompute geometry matrix/blending functions

pi

pi3

pi1 pi2

Ci

Ci1pi4

bb bb bb b

b

0

1 0

2 1

3 2

3

1 01 01 01 0

0 0

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

( )

605/03/23 21:58

UML

B-splines: Using continuity requirements tocompute geometry matrix/blending functions

bb bb bb b

b

0

1 0

2 1

3 2

3

1 01 01 01 0

0 0

'( )'( ) '( )'( ) '( )'( ) '( )

'( )

bb bb bb b

b

0

1 0

2 1

3 2

3

1 01 01 01 0

0 0

"( )"( ) "( )"( ) "( )"( ) "( )

"( )

Similarly, the C1 and C2 continuity conditions give:

705/03/23 21:58

UML

B-spline blending functions

b0b3

b1 b2

b u u ub u ub u u ub u

016

2 3

116

2 3

216

2 3

316

3

1 3 34 6 31 3 3 3

( )( )( )

23

0 1

M BS

16

1 4 1 03 0 3 0

3 6 3 01 3 3 1

805/03/23 21:58

UML

B-splines:Local versus global parameter

Ci Ci1 Ci2Ci 1

pi pi1 pi2 pi3 pi4

905/03/23 21:58

UML

B-splines:Recursively defined basis functions

]...[

)()(

otherwise0 if1

321

1

1,1

1

1,,

11,

k

iki

kiki

iki

kiiki

iii

tttt

ttuBut

ttuBtu

uB

tutuB

For any “knot vector”:

Order i

1005/03/23 21:58

UML

First order basis functions:

1105/03/23 21:58

UML

Second order basis functions:

1205/03/23 21:58

UML

Knot Vectors

Only Requirement:

Image: David Rogers

1305/03/23 21:58

UML

Definition of B Spline Curve

1

1

)()(n

iiik uBu pp

k Order of the spline

1n Number of control points

1 nk Number of knots in knot vector *

* Notation according to D.F. Rogers

1405/03/23 21:58

UML

Knot Vectors:Open, Uniform

Result: spline passes through end control vertices

Image: David Rogers

1505/03/23 21:58

UML

Building Up Basis Functions

Image: David Rogers

1605/03/23 21:58

UML

Methods of Control

0 Change number and/or position of control vertices0 Change order k0 Change type of knot vector

- Open uniform- Open non uniform

0 Use multiple coincident control vertices0 Use multiple internal knot values

Image: David Rogers

1705/03/23 21:58

UML

Control: Change Order

Image: David Rogers

1805/03/23 21:58

UML

Control: Non Uniform Knot Vectors

Image: David Rogers

1905/03/23 21:58

UML

Control: Knot Vector Type

Image: David Rogers

2005/03/23 21:58

UML

Control:Multiple Coincident Vertices

Image: David Rogers

2105/03/23 21:58

UML

Control: Duplicate Knot Values

Image: David Rogers

2205/03/23 21:58

UML

Rational B-Splines (NURBS)

i

ii

ii

ii

i

i

i

hzhyhxh

zyx

1

Equivalency betweenHomogeneous representations:

1

1

1

1

)(

)()( n

iiik

n

iiiik

huB

xhuBuxDoing the perspective

division gives:

Interpreted as “weighting factor” for control verticesih

2305/03/23 21:58

UML

NURBSEffect of weighting factor

Image: David Rogers

2405/03/23 21:58

UML

Drawing NURBS in OpenGL

GLUnurbsObj *curveName;

curveName = gluNewNurbsRenderer();gluBeginCurve (curveName);gluNurbsCurve (curveName, nknots, *knotVector,

stride, *ctrlPts, degParam, GL_MAP1_VERTEX_3);gluEndCurve (curveName);

See OpenGL Programming Guide Ch. 12 for details ofusing the glu NURBS interface

2505/03/23 21:58

UML

NURBS:Code Example

120 goto 120

2605/03/23 21:58

UML

Extending from Curves to Surfaces

)()(),(1

1

1

1,

vBuBvuvv

u

u

v

vuuvu dk

n

k

n

kdkkk

pP

•Cartesian product of B-Spline basis functions

•Order can be different for u and v directions

top related