SlideShare a Scribd company logo
2IV60 Computer graphics
set 9: Splines
Jack van Wijk
TU/e
Classic problem: How to draw smooth curves?
Spline curve: smooth curve that is defined by a
sequence of points
Requirements:
• …
Splines...
H&B 8-8:420-425
Splines 1
H&B 8-8:420-425
Spline curve: smooth curve that is defined by a
sequence of points
Interpolating spline Approximating spline
Splines 2
H&B 8-8:420-425
Convex hull: Smallest polygon that encloses all points
Interpolating spline Approximating spline
Convex hull
Splines 3
H&B 8-8:420-425
Control graph: polyline through sequence of points
Interpolating spline Approximating spline
Control graph
Splines 4
H&B 8-8:420-425
Splines in computer graphics:
Piecewise cubic splines
Segments
Splines 5
H&B 8-8:420-425
Segments have to match ‘nicely’.
Given two segments P(u) en Q(v).
We consider the transition of P(1) to Q(0).
Zero-order parametric continuity
C0: P(1) = Q(0).
Endpoint of P(u) coincides with startpoint Q(v).
P(u) Q(v)
Splines 6
H&B 8-8:420-425
Segments have to match ‘nicely’.
Given two segments P(u) en Q(v).
We consider the transition of P(1) to Q(0).
First order parametric continuity
C1: dP(1)/du = dQ(0)/dv.
Direction of P(1) coincides with direction of Q(0).
P(u) Q(v)
Splines 7
H&B 8-8:420-425
First order parametric continuity gives a smooth
curve. Sometimes good enough, sometimes not.
line segment circle arc
Suppose that you are bicycling over the curve.
What to do with the steering rod at the transition?
Turn around! Discontinuity in the curvature!
Splines 8
H&B 8-8:420-425
Given two segments P(u) and Q(v).
We consider the transition of P(1) to Q(0).
Second order parametric continuity
C2: d2P(1)/du2 = d2Q(0)/dv2.
Curvatures in P(1) and Q(0) are equal.
P(u) Q(v)
Splines 9
H&B 8-8:420-425
So far: considered parametric continuity.
Here the vectors are exactly equal.
It suffices to require that the directions are the same:
geometric continuity.
P(u) Q(v) P(u) Q(v)
Splines 10
H&B 8-8:420-425
Given two segments P(u) en Q(v).
We consider the transition of P(1) to Q(0).
First order geometric continuity:
G1: dP(1)/du =  dQ(0)/dv with  >0.
Direction of P(1) coincides with direction Q(0).
P(u) Q(v)
Representation cubic spline 1
H&B 8-8:420-425
U: Powers of u C: Coefficient matrix
Representation cubic spline 2
H&B 8-8:420-425
Matrix Mspline :’translates’ geometric info to coefficients
Control points or
Control vectors
Representation cubic spline 3
H&B 8-8:420-425
Representation cubic spline 4
H&B 8-8:420-425
Representatie cubic spline 5
H&B 8-8:420-425
Puzzle: Describe a line segment between the points P0 en P1
with those three variants.
P0
P1
u
u=0
u=1
Representation cubic spline 6
H&B 8-8:420-425
P0
P1
u
u=0
Representation cubic spline 7
H&B 8-8:420-425
P0
P1
u
u=0
Representation cubic spline 8
H&B 8-8:420-425
P0
P1
u
u=0
Spline surface 1
H&B 8-8:420-425
P00
P03
P30
P33
P10
P20
Spline surface 2
H&B 8-8:420-425
Spline surface 2
H&B 8-8:420-425
P00
P03
P30
P33
P10
P20
Spline surface 3
H&B 8-8:420-425
v
u
Spline surface 4
H&B 8-8:420-425
v
u
du := 1/nu; // nu: #facets u-direction
dv := 1/nv; // nv: #facets v-direction
for i := 0 to nu1 do
u := i*du;
for j := 0 to nv  1 do
v := j*dv;
DrawQuad(P(u,v), P(u+du, v), P(u+du, v+dv), P(u, v+dv))
Spline surface 5
H&B 8-8:420-425
v
u
// Alternative: calculate points first
for i := 0 to nu do
for j := 0 to nv do
Q[i, j] := P(i/nu, j/nv);
for i := 0 to nu  1 do
for j := 0 to nv  1 do
DrawQuad(Q[i, j], Q[i+1, j], Q[i+1, j+1], Q[i, j+1])
// Alternative: calculate points first,
// triangle version
for i := 0 to nu do
for j := 0 to nv do
Q[i, j] := P(i/nu, j/nv);
for i := 0 to nu  1 do
for j := 0 to nv  1 do
DrawTriangle(Q[i, j], Q[i+1, j], Q[i+1, j+1]);
DrawTriangle(Q[i, j], Q[i+1, j+1], Q[i, j+1]);
Spline surface 6
H&B 8-8:420-425
v
u
// Alternative: calculate points first,
// triangle variant, triangle strip
for i := 0 to nu do
for j := 0 to nv do
Q[i, j] := P(i/nu, j/nv);
for i := 0 to nu  1 do
glBegin(GL_TRIANGLE_STRIP);
for j := 0 to nv  1 do
glVertex(Q[i, j]);
glVertex(Q[i, j+1]);
glEnd;
Spline surface 7
H&B 8-8:420-425
v
u
Bézier spline curves 1
H&B 8-10:432-441
Bézier spline curves 2
H&B 8-10:432-441
P0
P1
Bézier spline curves 3
H&B 8-10:432-441
P0
P1 P2
Bézier spline curves 4
H&B 8-10:432-441
P0
P3
P1
P2
Bézier spline curves 5
H&B 8-10:432-441
P0
P3
P1
P2
Bézier spline curves 6
H&B 8-10:432-441
P0
P3
P1
P2
Bézier spline curves 7
H&B 8-10:432-441
P0
P3
P1
P2
Bézier spline curves 8
H&B 8-10:432-441
P0
P3
P1
P2
Q3
Q0
Q2
Q1
Bézier spline curves 8
H&B 8-10:432-441
P0
P3
P1
P2
Q3
Q0
Q2
Q1
Bézier spline curves 9
H&B 8-10:432-441
P0
P3
P1
P2
Q3
Q0
Q2
Q1
Bézier spline curves 9
H&B 8-10:432-441
P0
P3
P1
P2
Q3
Q0
Q2
Q1
Bézier spline curves 10
H&B 8-10:432-441
Bézier surface 1
H&B 8-10:432-441
P00
P03
P30
P33
P10
P20
Bézier surface 2
H&B 8-10:432-441
P00
P03
P30
P33
Q00
Q30
Q33
Q03
Bézier surface 2
H&B 8-10:432-441
P00
P03
P30
P33
Q00
Q30
Q33
Q03
Bézier surface 3
H&B 8-10:432-441
P00
P03
P30
P33
Q00
Q30
Bézier surface 3
H&B 8-10:432-441
P03
P33
Q00
Q30
P00
P30
Bézier surface 3
H&B 8-10:432-441
P03
P33
Q00
Q30
P00
P30
Finally…
The world is full of all kind of objects:
Trees, people, cars, housed, clouds, rocks, waves,
pencil sharpeners, fire, mountains, plants, …
How can we describe these, such that they are
- easy to enter;
- easy to process;
- easy to display?
Complex problem, HUGE topic!
Finally…
Many other ways to model shapes:
– Sweep representations
– Fractal-Geometry methods
– Shape Grammars
– Procedurally defined objects
– Constructive Solid Geometry
– Subdivision surfaces
– Custom methods for hair, water, fire, etc.
Next…
• We now know how to model curved objects
• But they still look somewhat dull, …

More Related Content

Similar to 2IV60_9_splines.ppt

Tarea unidad 1 veronica garcía
Tarea unidad 1 veronica garcíaTarea unidad 1 veronica garcía
Tarea unidad 1 veronica garcía
Vero García
 
On Resolution Proofs for Combinational Equivalence
On Resolution Proofs for Combinational EquivalenceOn Resolution Proofs for Combinational Equivalence
On Resolution Proofs for Combinational Equivalence
satrajit
 

Similar to 2IV60_9_splines.ppt (20)

CS6491Project4
CS6491Project4CS6491Project4
CS6491Project4
 
Curve modeling bezier curves
Curve modeling bezier curvesCurve modeling bezier curves
Curve modeling bezier curves
 
Directed Acyclic Graph
Directed Acyclic Graph Directed Acyclic Graph
Directed Acyclic Graph
 
2-Vector.pptx
2-Vector.pptx2-Vector.pptx
2-Vector.pptx
 
E field dipole
E field dipoleE field dipole
E field dipole
 
Write a program to draw a cubic Bezier curve.
Write a program to draw a cubic Bezier curve. Write a program to draw a cubic Bezier curve.
Write a program to draw a cubic Bezier curve.
 
Signals and Systems Assignment Help
Signals and Systems Assignment HelpSignals and Systems Assignment Help
Signals and Systems Assignment Help
 
Tarea unidad 1 veronica garcía
Tarea unidad 1 veronica garcíaTarea unidad 1 veronica garcía
Tarea unidad 1 veronica garcía
 
Tarea unidad 1
Tarea unidad 1Tarea unidad 1
Tarea unidad 1
 
Embedding and np-Complete Problems for 3-Equitable Graphs
Embedding and np-Complete Problems for 3-Equitable GraphsEmbedding and np-Complete Problems for 3-Equitable Graphs
Embedding and np-Complete Problems for 3-Equitable Graphs
 
2IV60_4_3D_transformations.ppt
2IV60_4_3D_transformations.ppt2IV60_4_3D_transformations.ppt
2IV60_4_3D_transformations.ppt
 
Block diagrams.ppt
Block diagrams.pptBlock diagrams.ppt
Block diagrams.ppt
 
Rendering Curves and Surfaces
Rendering Curves and SurfacesRendering Curves and Surfaces
Rendering Curves and Surfaces
 
3 d rotation about an arbitary axix
3 d rotation about an arbitary axix3 d rotation about an arbitary axix
3 d rotation about an arbitary axix
 
vertical-curves
vertical-curvesvertical-curves
vertical-curves
 
On Resolution Proofs for Combinational Equivalence
On Resolution Proofs for Combinational EquivalenceOn Resolution Proofs for Combinational Equivalence
On Resolution Proofs for Combinational Equivalence
 
7-2.Nyquist Stability Criterion.ppt
7-2.Nyquist Stability Criterion.ppt7-2.Nyquist Stability Criterion.ppt
7-2.Nyquist Stability Criterion.ppt
 
A tabu search algorithm for the min max k-chinese postman problem
A tabu search algorithm for the min max k-chinese postman problemA tabu search algorithm for the min max k-chinese postman problem
A tabu search algorithm for the min max k-chinese postman problem
 
A sweepline algorithm for Voronoi Diagrams
A sweepline algorithm for Voronoi DiagramsA sweepline algorithm for Voronoi Diagrams
A sweepline algorithm for Voronoi Diagrams
 
Unit 2: All
Unit 2: AllUnit 2: All
Unit 2: All
 

Recently uploaded

Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
mbmh111980
 

Recently uploaded (20)

GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product UpdatesGraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
GraphSummit Stockholm - Neo4j - Knowledge Graphs and Product Updates
 
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdfImplementing KPIs and Right Metrics for Agile Delivery Teams.pdf
Implementing KPIs and Right Metrics for Agile Delivery Teams.pdf
 
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdfMastering Windows 7 A Comprehensive Guide for Power Users .pdf
Mastering Windows 7 A Comprehensive Guide for Power Users .pdf
 
GraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysisGraphAware - Transforming policing with graph-based intelligence analysis
GraphAware - Transforming policing with graph-based intelligence analysis
 
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdfA Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
A Comprehensive Appium Guide for Hybrid App Automation Testing.pdf
 
How to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabberHow to install and activate eGrabber JobGrabber
How to install and activate eGrabber JobGrabber
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
KLARNA -  Language Models and Knowledge Graphs: A Systems ApproachKLARNA -  Language Models and Knowledge Graphs: A Systems Approach
KLARNA - Language Models and Knowledge Graphs: A Systems Approach
 
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
A Python-based approach to data loading in TM1 - Using Airflow as an ETL for TM1
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?
 
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
Abortion ^Clinic ^%[+971588192166''] Abortion Pill Al Ain (?@?) Abortion Pill...
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf10 Essential Software Testing Tools You Need to Know About.pdf
10 Essential Software Testing Tools You Need to Know About.pdf
 
Crafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM IntegrationCrafting the Perfect Measurement Sheet with PLM Integration
Crafting the Perfect Measurement Sheet with PLM Integration
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
How To Build a Successful SaaS Design.pdf
How To Build a Successful SaaS Design.pdfHow To Build a Successful SaaS Design.pdf
How To Build a Successful SaaS Design.pdf
 
Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024Top Mobile App Development Companies 2024
Top Mobile App Development Companies 2024
 
A Guideline to Gorgias to to Re:amaze Data Migration
A Guideline to Gorgias to to Re:amaze Data MigrationA Guideline to Gorgias to to Re:amaze Data Migration
A Guideline to Gorgias to to Re:amaze Data Migration
 
iGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by SkilrockiGaming Platform & Lottery Solutions by Skilrock
iGaming Platform & Lottery Solutions by Skilrock
 

2IV60_9_splines.ppt