Computer Graphics Week 10 Lecture 2 Approximation Splines

  • Slides: 25
Download presentation
Computer Graphics Week 10 Lecture 2

Computer Graphics Week 10 Lecture 2

Approximation Splines

Approximation Splines

Interpolation and Approximation Interpolation Approximation When polynomial sections are fitted such that all control

Interpolation and Approximation Interpolation Approximation When polynomial sections are fitted such that all control points are connected When a polynomial curve is fitted such that some or all the control points are not on the generated curve The control points specify the general path of the curve

Example

Example

Some approximation Methods • • • Bezier curves B-Splines Beta-Splines

Some approximation Methods • • • Bezier curves B-Splines Beta-Splines

Bezier Curve ● Developed by French Automobile Engineer , Pierre Bezier , Who worked

Bezier Curve ● Developed by French Automobile Engineer , Pierre Bezier , Who worked for Renault ● Used widely ● Very Conveniant to Calculate and use

Bezier Curve • Most conveniently specified by blending functions • For n+1 control points,

Bezier Curve • Most conveniently specified by blending functions • For n+1 control points, the Bezier curve technique produces a polynomial of order n • Let pk represent control points & P(u) be the equation of desired Bezier curve, then where,

BEZ are called Bernstein Polynomials

BEZ are called Bernstein Polynomials

Examples

Examples

Some terminologies • • Convex Hull : Boundary of space formed by a set

Some terminologies • • Convex Hull : Boundary of space formed by a set of control points Bounded space should be a convex polygon Imagine a rubber band being strecthed out on control points. Some control points will lie on boundary and some inside.

Contd. . . Control graph: A polyline connecting the control points in sequence. It

Contd. . . Control graph: A polyline connecting the control points in sequence. It tell’s us the approximate shape of the curve.

➔The starting and the ending point of Bezier curve is same as the first

➔The starting and the ending point of Bezier curve is same as the first and the last control point respectively. i. e. P(0)=p 0 and P(1)=pn ➔The Parametric derivatives at the endpoints of curve are Properties of Bezier Curve ➔From above we can see that the gradient of the curve at the beginning is along the line joining the first and second control point and the gradient of the curve at the end is along the line joining the last two control points ➔The Bezier Curve always lie within its convex hull. This is because curve is a weighted sum of control points. And sum of weights =1 (weights are all +ve)

➔ The second parametric derivative of curve at control points is: Properties of Bezier

➔ The second parametric derivative of curve at control points is: Properties of Bezier Curve ➔ Does not allow for local control (more on this on Cubic Bezier curves)

➔If first and last control points are same then curve forms a close loop

➔If first and last control points are same then curve forms a close loop Design Techniques➔Since the Bezier curve is a weighted sum of control points for so specifying 2 control points at the same position will give that point more weight (importance). Curve will bend towards it Bezier Curve ➔For making complicated curves , instead of making one large Bezier curve we piece together several smaller curves (How to do this → on board) ➔We mostly piece together cubic Bezier Curves

Cubic Bezier Curves The blending functions for the cubic Bezier Curves comes out to

Cubic Bezier Curves The blending functions for the cubic Bezier Curves comes out to be : The blending functions are weights of control points

Contd. .

Contd. .

Example For a Bezier Curve with control points p 0(1, 1), p 1(2, 3)

Example For a Bezier Curve with control points p 0(1, 1), p 1(2, 3) , p 2(3, 1) , p 3(4, 3) Find parametric equation of the curve. Find values at u = 0. 15 and 0. 35

Ans x(u) = (1 -u)3 + 6 u * (1 -u)2 + 9 u

Ans x(u) = (1 -u)3 + 6 u * (1 -u)2 + 9 u 2 * (1 -u) + 4*u 3 y(u) = (1 -u)3 + 9 u * (1 -u)2 + 3 u 2 * (1 -u) + 3*u 3 x(0. 15) = 1. 45 , y(0. 15) =1. 657 x(0. 35) = 2. 05 , y(0. 35) =1. 973

Pseudo code

Pseudo code

The End

The End

Text

Text

Text

Text

Text –Johnny Appleseed

Text –Johnny Appleseed