CS-184: Computer GraphicsLecture #13: Natural Splines, B-Splines, and NURBS Prof. James O’BrienUniversity of California, BerkeleyV2008-S-13-1.01Natural SplinesDraw a “smooth” line through several points2A real draftsman’sspline.Image from Carl de Boor’s webpage.2Natural Cubic SplinesGiven pointsGenerate a curve with segmentsCurves passes through pointsCurve is continuousUse cubics because lower order is better...3n + 1nC23Natural Cubic Splines4u = 0u = 1u = 2u = 3u = nu = n − 1s1s2s3snsn−1x(u) =s1(u) if 0 ≤ u < 1s2(u − 1) if 1 ≤ u < 2s3(u − 2) if 2 ≤ u < 3...sn(u − (n − 1)) if n − 1 ≤ u ≤ n4Natural Cubic Splines5u = 0u = 1u = 2u = 3u = nu = n − 1s1s2s3snsn−1si(0) = pi−1i = 1 . . . nsi(1) = pii = 1 . . . ns"i(1) = s"i+1(0) i = 1 . . . n − 1s""i(1)= s""i+1(0) i = 1 . . . n − 1s""1(0)= s""n(1) = 05Natural Cubic Splines5u = 0u = 1u = 2u = 3u = nu = n − 1s1s2s3snsn−1si(0) = pi−1i = 1 . . . nsi(1) = pii = 1 . . . ns"i(1) = s"i+1(0) i = 1 . . . n − 1s""i(1)= s""i+1(0) i = 1 . . . n − 1s""1(0)= s""n(1) = 0← n constraints← n constraints← n-1 constraints← n-1 constraints←2 constraintsTotal 4n constraints5Natural Cubic Splines6Interpolate data pointsNo convex hull propertyNon-local supportConsider matrix structure... using cubic polynomialsC26B-SplinesGoal: cubic curves with local supportGive up interpolation Get convex hull propertyBuild basis by designing “hump” functions7C27B-Splines8b(u) =b−2(u) if u−2≤ u <u−1b−1(u) if u−1≤ u <u0b+1(u) if u0≤ u <u+1b+2(u) if u+1≤ u ≤u+2b!!−2(u−2) = b!−2(u−2) = b−2(u−2) = 0b!!+2(u+2) = b!+2(u+2) = b+2(u+2) = 0b−2(u−1)= b−1(u−1)b−1(u0) = b+1(u0)b+1(u+1)= b+2(u+1)8B-Splines8b(u) =b−2(u) if u−2≤ u <u−1b−1(u) if u−1≤ u <u0b+1(u) if u0≤ u <u+1b+2(u) if u+1≤ u ≤u+2b!!−2(u−2) = b!−2(u−2) = b−2(u−2) = 0b!!+2(u+2) = b!+2(u+2) = b+2(u+2) = 0b−2(u−1)= b−1(u−1)b−1(u0) = b+1(u0)b+1(u+1)= b+2(u+1)Repeat for and←3 constraintsTotal 15 constraints ...... need one more←3 constraints←3×3=9 constraintsb!b!![8B-Splines9b(u) =b−2(u) if u−2≤ u <u−1b−1(u) if u−1≤ u <u0b+1(u) if u0≤ u <u+1b+2(u) if u+1≤ u ≤u+2b!!−2(u−2) = b!−2(u−2) = b−2(u−2) = 0b!!+2(u+2) = b!+2(u+2) = b+2(u+2) = 0b−2(u−1)= b−1(u−1)b−1(u0) = b+1(u0)b+1(u+1)= b+2(u+1)Repeat for and←3 constraintsTotal 16 constraints ←3 constraints←3×3=9 constraintsb!b!![b−2(u−2) + b−1(u−1) + b+1(u0) + b+2(u+1) = 1←1 constraint (convex hull)9B-Splines1010B-Splines1111B-Splines1212B-Splines1313B-Splines14Example with end knots repeated14B-SplinesBuild a curve w/ overlapping bumpsContinuityInside bumps Bumps “fade out” with continuityBoundariesCircularRepeat end pointsExtra end points15C2C215B-SplinesNotationThe basis functions are the “Hump” functions are the concatenated functionSometimes the humps are called basis... can be confusingThe are the knot locationsThe weights on the hump/basis functions are control points16uibi(u)16B-SplinesSimilar construction method can give higher continuity with higher degree polynomialsRepeating knots drops continuityLimit as knots approach each otherStill cubics, so conversion to other cubic basis is just a matrix multiplication1717B-SplinesGeometric constructionDue to Cox and de Boor My own notation, beware if you compare w/ textLet hump centered on be 18Ni,4(u)uiCubic is order 4Ni,k(u)Is order hump, centered atkuiNote: is integer if is even else is integerik(i + 1/2)18B-Splines19192020Nonuniform Rational B-SplinesBasically B-Splines using homogeneous coordinatesTransform under perspective projectionA bit of extra control21NURBS21NURBSNon-linear in the control pointsThe are sometimes called “weights”22pi=pixpiypizpiwx(u)
View Full Document