260 likes | 589 Views
Graphics II 91.547 B-Splines NURBS. Session 3A. B-splines. Suppose you wanted C 0 , C 1 and C 2 continuity at curve boundaries. Use all four control points to determine boundary continuities and only require that the curve pass “close” to the points. B-splines: Sharing of Control Points.
E N D
Graphics II 91.547B-SplinesNURBS Session 3A
B-splines Suppose you wanted C0, C1 and C2continuity at curve boundaries. Use all four control points to determine boundary continuities and only require that the curve pass “close” to the points.
B-splines: Using continuity requirements tocompute geometry matrix/blending functions C0 continuity here requires:
B-splines: Using continuity requirements tocompute geometry matrix/blending functions
B-splines: Using continuity requirements tocompute geometry matrix/blending functions Similarly, the C1 and C2 continuity conditions give:
B-splines:Recursively defined basis functions Order i For any “knot vector”:
Knot Vectors Only Requirement: Image: David Rogers
Definition of B Spline Curve Order of the spline Number of control points Number of knots in knot vector * * Notation according to D.F. Rogers
Knot Vectors:Open, Uniform Result: spline passes through end control vertices Image: David Rogers
Building Up Basis Functions Image: David Rogers
Methods of Control • Change number and/or position of control vertices • Change order k • Change type of knot vector • Open uniform • Open non uniform • Use multiple coincident control vertices • Use multiple internal knot values Image: David Rogers
Control: Change Order Image: David Rogers
Control: Non Uniform Knot Vectors Image: David Rogers
Control: Knot Vector Type Image: David Rogers
Control:Multiple Coincident Vertices Image: David Rogers
Control: Duplicate Knot Values Image: David Rogers
Rational B-Splines (NURBS) Equivalency between Homogeneous representations: Doing the perspective division gives: Interpreted as “weighting factor” for control vertices
NURBSEffect of weighting factor Image: David Rogers
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 of using the glu NURBS interface
NURBS:Code Example 120 goto 120
Extending from Curves to Surfaces • Cartesian product of B-Spline basis functions • Order can be different for u and v directions