CS 445 / 645 Introduction to Computer GraphicsSplines – Old SchoolRepresentations of CurvesSpecifying Curves (hyperlink)Parametric CurvesCubic PolynomialsAnother nice feature of curvesSlide 8Piecewise Curve SegmentsParametric ContinuityGeometric ContinuityParametric Cubic CurvesParametric Cubic SplinesCoefficientsSlide 15Slide 16Hermite Cubic SplinesSlide 18Slide 19Hermite Cubic SplineSlide 21Slide 22Slide 23Slide 24Hermite SpecificationSolve Hermite MatrixSpline and Geometry MatricesResulting Hermite Spline EquationDemonstrationSample Hermite CurvesBlending FunctionsHermite Blending FunctionsSlide 33CS 445 / 645Introduction to Computer GraphicsLecture 22Lecture 22Hermite SplinesHermite SplinesLecture 22Lecture 22Hermite SplinesHermite SplinesSplines – Old SchoolDuckDuckDuckDuckSplineSplineSplineSplineRepresentations of CurvesUse a sequence of points…Use a sequence of points…•Piecewise linear - does not accurately model a smooth linePiecewise linear - does not accurately model a smooth line•Tedious to create list of pointsTedious to create list of points•Expensive to manipulate curve because all points must be Expensive to manipulate curve because all points must be repositionedrepositionedInstead, model curve as piecewise-polynomialInstead, model curve as piecewise-polynomial•x = x(t), y = y(t), z = z(t) x = x(t), y = y(t), z = z(t) –where x(), y(), z() are polynomials where x(), y(), z() are polynomials Use a sequence of points…Use a sequence of points…•Piecewise linear - does not accurately model a smooth linePiecewise linear - does not accurately model a smooth line•Tedious to create list of pointsTedious to create list of points•Expensive to manipulate curve because all points must be Expensive to manipulate curve because all points must be repositionedrepositionedInstead, model curve as piecewise-polynomialInstead, model curve as piecewise-polynomial•x = x(t), y = y(t), z = z(t) x = x(t), y = y(t), z = z(t) –where x(), y(), z() are polynomials where x(), y(), z() are polynomialsSpecifying Curves (hyperlink)Control PointsControl Points•A set of points that influence the A set of points that influence the curve’s shapecurve’s shapeKnotsKnots•Control points that lie on the curveControl points that lie on the curveInterpolating SplinesInterpolating Splines•Curves that pass through the control Curves that pass through the control points (knots)points (knots)Approximating SplinesApproximating Splines•Control points merely influence shapeControl points merely influence shapeControl PointsControl Points•A set of points that influence the A set of points that influence the curve’s shapecurve’s shapeKnotsKnots•Control points that lie on the curveControl points that lie on the curveInterpolating SplinesInterpolating Splines•Curves that pass through the control Curves that pass through the control points (knots)points (knots)Approximating SplinesApproximating Splines•Control points merely influence shapeControl points merely influence shapeParametric CurvesVery flexible representationVery flexible representationThey are not required to be functionsThey are not required to be functions•They can be multivalued with respect to any dimensionThey can be multivalued with respect to any dimensionVery flexible representationVery flexible representationThey are not required to be functionsThey are not required to be functions•They can be multivalued with respect to any dimensionThey can be multivalued with respect to any dimensionCubic Polynomialsx(t) = ax(t) = axxtt33 + b + bxxtt22 + c + cxxt + dt + dxx•Similarly for y(t) and z(t)Similarly for y(t) and z(t)Let t: (0 <= t <= 1)Let t: (0 <= t <= 1)Let T = [tLet T = [t33 t t22 t 1] t 1]Coefficient Matrix CCoefficient Matrix C Curve: Q(t) = T*CCurve: Q(t) = T*Cx(t) = ax(t) = axxtt33 + b + bxxtt22 + c + cxxt + dt + dxx•Similarly for y(t) and z(t)Similarly for y(t) and z(t)Let t: (0 <= t <= 1)Let t: (0 <= t <= 1)Let T = [tLet T = [t33 t t22 t 1] t 1]Coefficient Matrix CCoefficient Matrix C Curve: Q(t) = T*CCurve: Q(t) = T*C zzyyxxzyxzyxdcdcdcbbbaaattt 123Another nice feature of curvesDerivativesDerivatives•Very useful for lighting equationsVery useful for lighting equations•Useful for automatic feature detectionUseful for automatic feature detectionDerivativesDerivatives•Very useful for lighting equationsVery useful for lighting equations•Useful for automatic feature detectionUseful for automatic feature detectionParametric CurvesHow do we find the tangent to a curve?How do we find the tangent to a curve?•If f(x) =If f(x) =–tangent at (x=3) istangent at (x=3) isHow do we find the tangent to a curve?How do we find the tangent to a curve?•If f(x) =If f(x) =–tangent at (x=3) istangent at (x=3) isDerivative of Q(t) is the tangent vector at t:Derivative of Q(t) is the tangent vector at t:Derivative of Q(t) is the tangent vector at t:Derivative of Q(t) is the tangent vector at t:f0 x x ¡ ¡ f0 x x ¡ ¡ f x x¡ f x x¡ ddtQt Q0 t ddtTC t t CddtQt Q0 t ddtTC t t CddtQt Q0 t ddtT ¢C t t ¢CddtQt Q0 t ddtT ¢C t t ¢CPiecewise Curve SegmentsOne curve constructed by connecting many One curve constructed by connecting many smaller segments end-to-endsmaller segments end-to-end•Must have rules for how the segments are joinedMust have rules for how the segments are joinedContinuity describes the jointContinuity describes the joint•Parametric continuityParametric continuity•Geometric continuityGeometric continuityOne curve constructed by connecting many One curve constructed by connecting many smaller segments end-to-endsmaller segments end-to-end•Must have rules for how the segments are joinedMust have rules for how the segments are joinedContinuity describes the jointContinuity describes the joint•Parametric continuityParametric continuity•Geometric continuityGeometric continuityParametric Continuity•CC11 is tangent continuity (velocity) is tangent continuity (velocity)•CC22 is 2 is 2ndnd derivative continuity (acceleration) derivative continuity (acceleration)•Matching direction and magnitude
View Full Document