Lecure 4 Curves and Surfaces II Splne A long flexble srps of meal used by drafspersons o lay ou he surfaces of arplanes, cars and shps Ducks weghs aached o he splnes were used o pull he splne n dfferen drecons The meal splnes had second order connuy //28 Lecure 5 2 B-Splnes (for bass splnes) B-Splnes Anoher polynomal curve for modellng curves and surfaces Consss of curve segmens whose polynomal coeffcens only depend on jus a few conrol pons Local conrol Segmens joned a knos B-splnes The curve does no necessarly pass hrough he conrol pons The shape s consraned o he convex hull made by he conrol pons Unform cubc b-splnes has C2 connuy Hgher han Herme or Bezer curves //28 Lecure 5 Bass Funcons Generang a curve 4 8 2 X() Oppose we see an example of a shape o be generaed. knos We can creae a long curve usng many knos and B-splnes The unweghed cubc B-Splnes have been shown for clary. These are weghed and summed o produce a curve of he desred shape //28 Lecure 5 Here we see he curve agan wh he weghed B-Splnes whch generaed he requred shape. //28 Lecure 5 6
where : The basc one: Unform Cubc B-Splnes Cubc B-splnes wh unform kno-vecor s he mos commonly used form of B-splnes T X ( ) = MQ M = 6 T = 2 ( ), ( ),,) : knos, Q () () 6 4 = ( x for,...,, x ) //28 Lecure 5 7 + Cubc B-Splnes The unweghed splne se of conrol pons, splnes, 4 knos, and bu only 7 nervals. You can see why o 4 s he frs nerval wh a curve snce s he frs wh all four B-Splne funcons. 9 o s he las nerval 6 8 m //28 4 m+ Lecure 5 8 Doman of he funcon Order k, Degree k- Conrol pons P (=,,m) Knos : j, (j=,, k + m) The doman of he funcon k- m+ Below, k = 4, m = 9, doman, Cubc Unform B-Splne 2D example For each 4, here s a kno beween Q - and Q a =. Inal pons a and m+ are also knos. The followng llusraes an example wh conrol pons se P P 9 : Kno. Conrol pon. m+ //28 Lecure 5 Unform Non-raonal B-Splnes. Frs segmen Q s defned by pon P hrough P over he range = o 4 =. So m a leas for cubc splne. Unform Non-raonal B-Splnes. Second segmen Q 4 s defned by pon P hrough P 4 over he range 4 = o 5 = 2. P P Kno. Conrol pon. P P Kno. Conrol pon. Q P Q 4 //28 Lecure 5 //28 Lecure 5 2 2
B-Splne : A more general defnon A Bsplne of order k s a paramerc curve composed of a lnear combnaon of bass B-splnes B,n P (=,,m) he conrol pons Knos: j, j=,, k + m The B-splnes can be defned by p( ) =, < + B,( ) =, oherwse B ( ) = B ( ) + = + k, k, k +, k //28 + k Lecure 5 + k m PB, n( ) B ( ) The shape of he bass funcons B,2 : lnear bass funcons Order = 2, degree = C connuous hp://www.bblo.org/e-noes/splnes/bass.hm //28 Lecure 5 4 The shape of he bass funcons B, : Quadrac bass funcons Order =, degree = 2 C connuous The shape of he bass funcons B,4 : Cubc bass funcons Order = 4, degree = C2 connuous hp://www.bblo.org/e-noes/splnes/bass.hm //28 Lecure 5 5 hp://www.bblo.org/e-noes/splnes/bass.hm //28 Lecure 5 6 Unform / non-unform B-splnes Unform B-splnes The knos are equdsan / non-equdsan The prevous examples were unform B-splnes,, 2,..., m were equdsan, same nerval Paramerc nerval beween knos does no have o be equal. Non-unform B-splnes Non-unform B-splnes. Blendng funcons no longer he same for each nerval. Advanages Connuy a seleced conrol pons can be reduced o C or lower allows us o nerpolae a conrol pon whou sde-effecs. Can nerpolae sar and end pons. Easy o add exra knos and conrol pons. Good for shape modellng! //28
Conrollng he shape of he curves Can conrol he shape hrough Conrol pons Overlappng he conrol pons o make pass hrough a specfc pon Knos Changng he connuy by ncreasng he mulplcy a some kno (non-unform bsplnes) P Conrollng he shape hrough conrol pons Frs kno shown wh 4 conrol pons, and her convex hull. P P //28 Lecure 5 2 P Conrollng he shape hrough conrol pons Frs wo curve segmens shown wh her respecve Cenre Kno mus le n he nersecon of he 2 convex hulls. P Repeaed conrol pon. P Frs wo curve segmens shown wh her respecve The curve s forced o le on he lne ha jons he 2 P P P= //28 Lecure 5 2 //28 Lecure 5 22 P P==P Trple conrol pon. Frs wo curve segmens shown wh her respecve Boh convex hulls collapse o sragh lnes all he curve mus le on hese lnes. //28 Lecure 5 2 Conrollng he shape hrough knos Smoohness ncreases wh order k n B,k Quadrac, k =, gves up o C connuy. Cubc, k = 4 gves up o C 2 connuy. However, we can lower connuy order oo wh Mulple Knos, e. = + = +2 = Knos are concden and so now we have non-unform kno nervals. A kno wh mulplcy p s connuous o he (k--p)h dervave. A kno wh mulplcy k has no connuy a all,.e. he curve s broken a ha kno., < + B,( ) =, oherwse //28 + k Lecure B5, k ( ) = B, k ( ) + B + k + k ( ) 24 +, k 4
B-Splnes a mulple knos Cubc B-splne Mulplces are ndcaed Kno mulplcy Consder he unform cubc (n=4) B-splne curve, ={,,,}, m=9, n=4, 7 segmens Kno mulplcy Double kno a 5, kno ={,,2,,4,5,5,6,7,8,9,,,2} 6 segmens, connuy = Trple kno a 5 kno={,,2,,4,5,5,5,6,7,8,9,,} 5 segmens Kno mulplcy Kno mulplcy Summary of B-Splnes. Quadruple kno a 5 4 segmens Funcons ha can be manpulaed by a seres of conrol pons wh C 2 connuy and local conrol. Don pass hrough her conrol pons, alhough can be forced. Unform Knos are equally spaced n. Non-Unform Knos are unequally spaced Allows addon of exra conrol pons anywhere n he se. //28 Lecure 5 5
Summary con. Do no have o worry abou he connuy a he jon pons For neracve curve modellng B-Splnes are very good. 2 nd Praccal Use OpenGL o draw he eapo You mus exend your code n he frs assgnmen Bonus marks for makng nce Bump mappng Texure mappng Or whaever //28 Lecure 5 Deadlne : h December Readng for hs lecure Foley a al., Chaper, secons.2.,.2.4,.2.9,.2.,. and.5. Inroducory ex, Chaper 9, secons 9.2.4, 9.2.5, 9.2.7, 9.2.8 and 9... //28 Lecure 5 6