CLICK HERE TO DOWNLOAD PPT ON Splines and Bezier Curves
Splines and Bezier Curves Presentation Transcript
1.Computer Graphics for Scientists and Engineers
2.Introduction
Representing Curves
A number of small line-segments joined
Interpolation
Parametric equations
Types of curve we study
Natural Cubic Splines and Bezier Curves
Derivation
Implementation
Representing Curves
A number of small line-segments joined
Interpolation
Parametric equations
Types of curve we study
Natural Cubic Splines and Bezier Curves
Derivation
Implementation
3.“Computers can’t draw curves.”
4.Why have curves ?
Representation of “irregular surfaces”
Example: Auto industry (car body design)
Artist’s representation
Clay / wood models
Digitizing
Surface modeling (“body in white”)
Scaling and smoothening
Tool and die Manufacturing
Representation of “irregular surfaces”
Example: Auto industry (car body design)
Artist’s representation
Clay / wood models
Digitizing
Surface modeling (“body in white”)
Scaling and smoothening
Tool and die Manufacturing
5.Curve representation
Problem: How to represent a curve easily and efficiently
“Brute force and ignorance” approaches:
storing a curve as many small straight line segments
doesn’t work well when scaled
inconvenient to have to specify so many points
need lots of points to make the curve look smooth
working out the equation that represents the curve
difficult for complex curves
moving an individual point requires re-calculation of the entire curve
Problem: How to represent a curve easily and efficiently
“Brute force and ignorance” approaches:
storing a curve as many small straight line segments
doesn’t work well when scaled
inconvenient to have to specify so many points
need lots of points to make the curve look smooth
working out the equation that represents the curve
difficult for complex curves
moving an individual point requires re-calculation of the entire curve
6.Solution - Interpolation
Define a small number of points
Define a small number of points
7.The need for smoothness
So far, mostly polygons
Can approximate any geometry, but
Only approximate
Need lots of polygons to hide discontinuities
Storage problems
Math problems
Normal direction
Texture coordinates
Not very convenient as modeling tool
Gets even worse in animation
Almost always need smooth motion
So far, mostly polygons
Can approximate any geometry, but
Only approximate
Need lots of polygons to hide discontinuities
Storage problems
Math problems
Normal direction
Texture coordinates
Not very convenient as modeling tool
Gets even worse in animation
Almost always need smooth motion
8.Geometric modeling
Representing world geometry in the computer
Discrete vs. continuous again
At least some part has to be done by a human
Will see some automatic methods soon
Reality: humans are discrete in their actions
Specify a few points, have computer create something which “makes sense”
Examples: goes through points, goes “near” points
Representing world geometry in the computer
Discrete vs. continuous again
At least some part has to be done by a human
Will see some automatic methods soon
Reality: humans are discrete in their actions
Specify a few points, have computer create something which “makes sense”
Examples: goes through points, goes “near” points
9.Requirements
Want mathematical smoothness
Some number of continuous derivatives of P
Local control
Local data changes have local effect
Continuous with respect to the data
No wiggling if data changes slightly
Low computational effort
Want mathematical smoothness
Some number of continuous derivatives of P
Local control
Local data changes have local effect
Continuous with respect to the data
No wiggling if data changes slightly
Low computational effort
10.A solution
Use SEVERAL polynomials
Complete curve consists of several pieces
All pieces are of low order
Third order is the most common
Pieces join smoothly
This is the idea of spline curves
or just “splines”
Use SEVERAL polynomials
Complete curve consists of several pieces
All pieces are of low order
Third order is the most common
Pieces join smoothly
This is the idea of spline curves
or just “splines”
11.Parametric Equations - linear
12.Let us just confirm that
13.Why use parametric equations?
One, two, three or n-dimensional representation is possible
Can handle “infinite slope” of tangents
Can represent multi-valued functions
One, two, three or n-dimensional representation is possible
Can handle “infinite slope” of tangents
Can represent multi-valued functions
14.Natural Cubic Spline
Bezier Curves
Bezier Curves
15.Splines
16.Hermite Spline
17.Hermite Spline
A Hermite spline is a curve for which the user provides:
The endpoints of the curve
The parametric derivatives of the curve at the endpoints
The parametric derivatives are dx/dt, dy/dt, dz/dt
That is enough to define a cubic Hermite spline, more derivatives are required for higher order curves
A Hermite spline is a curve for which the user provides:
The endpoints of the curve
The parametric derivatives of the curve at the endpoints
The parametric derivatives are dx/dt, dy/dt, dz/dt
That is enough to define a cubic Hermite spline, more derivatives are required for higher order curves
18.Hermite curves in 2D and 3D
19.Basis Functions
A point on a Hermite curve is obtained by multiplying each control point by some function and summing
The functions are called basis functions
A point on a Hermite curve is obtained by multiplying each control point by some function and summing
The functions are called basis functions
20.Spline Interpolation
21.Deriving Natural Cubic Splines
22.Bezier Curves
An alternative to splines
M. Bezier was a French mathematician who worked for the Renault motor car company.
He invented his curves to allow his firm’s computers to describe the shape of car bodies.
An alternative to splines
M. Bezier was a French mathematician who worked for the Renault motor car company.
He invented his curves to allow his firm’s computers to describe the shape of car bodies.
23.Bezier Approximation
24.De Casteljau algorithm
Can compute any point on the curve in a few iterations
No polynomials, pure geometry
Repeated linear interpolation
Repeated order of the curve times
The algorithm can be used as definition of the curve
Can compute any point on the curve in a few iterations
No polynomials, pure geometry
Repeated linear interpolation
Repeated order of the curve times
The algorithm can be used as definition of the curve
25.De Casteljau algorithm
26.Bezier Curves - properties
27.Convex Hull property
28.Bezier Curve Properties
The first and last control points are interpolated
The tangent to the curve at the first control point is along the line joining the first and second control points
The tangent at the last control point is along the line joining the second last and last control points
The curve lies entirely within the convex hull of its control points
The first and last control points are interpolated
The tangent to the curve at the first control point is along the line joining the first and second control points
The tangent at the last control point is along the line joining the second last and last control points
The curve lies entirely within the convex hull of its control points
29.Invariance
Translational invariance means that translating the control points and then evaluating the curve is the same as evaluating and then translating the curve
Rotational invariance means that rotating the control points and then evaluating the curve is the same as evaluating and then rotating the curve
These properties are essential for parametric curves used in graphics
It is easy to prove that Bezier curves, Hermite curves and everything else we will study are translation and rotation invariant
Translational invariance means that translating the control points and then evaluating the curve is the same as evaluating and then translating the curve
Rotational invariance means that rotating the control points and then evaluating the curve is the same as evaluating and then rotating the curve
These properties are essential for parametric curves used in graphics
It is easy to prove that Bezier curves, Hermite curves and everything else we will study are translation and rotation invariant
30.Longer Curves
A single cubic Bezier or Hermite curve can only capture a small class of curves
At most 2 inflection points
One solution is to raise the degree
Allows more control, at the expense of more control points and higher degree polynomials
Control is not local, one control point influences entire curve
Alternate, most common solution is to join pieces of cubic curve together into piecewise cubic curves
Total curve can be broken into pieces, each of which is cubic
Local control: Each control point only influences a limited part of the curve
Interaction and design is much easier
A single cubic Bezier or Hermite curve can only capture a small class of curves
At most 2 inflection points
One solution is to raise the degree
Allows more control, at the expense of more control points and higher degree polynomials
Control is not local, one control point influences entire curve
Alternate, most common solution is to join pieces of cubic curve together into piecewise cubic curves
Total curve can be broken into pieces, each of which is cubic
Local control: Each control point only influences a limited part of the curve
Interaction and design is much easier
31.Achieving Continuity
For Hermite curves, the user specifies the derivatives, so C1 is achieved simply by sharing points and derivatives across the knot
For Hermite curves, the user specifies the derivatives, so C1 is achieved simply by sharing points and derivatives across the knot
32.DOF and Locality
The number of degrees of freedom (DOF) can be thought of as the number of things a user gets to specify
If we have n piecewise Bezier curves joined with C0 continuity, how many DOF does the user have?
If we have n piecewise Bezier curves joined with C1 continuity, how many DOF does the user have?
Locality refers to the number of curve segments affected by a change in a control point
Local change affects fewer segments
How many segments of a piecewise cubic Bezier curve are affected by each control point if the curve has C1 continuity?
What about C2?
The number of degrees of freedom (DOF) can be thought of as the number of things a user gets to specify
If we have n piecewise Bezier curves joined with C0 continuity, how many DOF does the user have?
If we have n piecewise Bezier curves joined with C1 continuity, how many DOF does the user have?
Locality refers to the number of curve segments affected by a change in a control point
Local change affects fewer segments
How many segments of a piecewise cubic Bezier curve are affected by each control point if the curve has C1 continuity?
What about C2?
33.Geometric Continuity
Derivative continuity is important for animation
If an object moves along the curve with constant parametric speed, there should be no sudden jump at the knots
For other applications, tangent continuity might be enough
Requires that the tangents point in the same direction
Referred to as G1 geometric continuity
Curves could be made C1 with a re-parameterization
The geometric version of C2 is G2, based on curves having the same radius of curvature across the knot
What is the tangent continuity constraint for a Bezier curve?
Derivative continuity is important for animation
If an object moves along the curve with constant parametric speed, there should be no sudden jump at the knots
For other applications, tangent continuity might be enough
Requires that the tangents point in the same direction
Referred to as G1 geometric continuity
Curves could be made C1 with a re-parameterization
The geometric version of C2 is G2, based on curves having the same radius of curvature across the knot
What is the tangent continuity constraint for a Bezier curve?
34.Problem with Bezier Curves
To make a long continuous curve with Bezier segments requires using many segments
Maintaining continuity requires constraints on the control point positions
The user cannot arbitrarily move control vertices and automatically maintain continuity
The constraints must be explicitly maintained
It is not intuitive to have control points that are not free
To make a long continuous curve with Bezier segments requires using many segments
Maintaining continuity requires constraints on the control point positions
The user cannot arbitrarily move control vertices and automatically maintain continuity
The constraints must be explicitly maintained
It is not intuitive to have control points that are not free
35.Bezier Curves in OpenGL
OpenGL supports Beziers through mechanism called evaluators used to compute the blending functions, bi (u), of any degree.
OpenGL supports Beziers through mechanism called evaluators used to compute the blending functions, bi (u), of any degree.
36.Evaluators
37.Evaluating 1-D Evaluator
38.Two-Dimensional Evaluators
Everything is similar to the one-dimensional case, except that all the commands must take two parameters, u and v, into account
Everything is similar to the one-dimensional case, except that all the commands must take two parameters, u and v, into account
39.Grid and Its Evaluation
0 comments