The document discusses splines and Bézier curves, which are smooth curves defined by a sequence of control points. Splines allow drawing smooth curves by ensuring continuity between curve segments. Continuity is evaluated based on parameters like tangent/direction matching (C1 continuity) and curvature matching (C2 continuity). Piecewise cubic splines and Bézier splines are commonly used in computer graphics. Bézier surfaces extend these concepts to 2D surfaces in 3D space using a grid of control points. The document explores various representations and algorithms for evaluating and rendering spline curves and surfaces.
2. 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
3. Splines 1
H&B 8-8:420-425
Spline curve: smooth curve that is defined by a
sequence of points
Interpolating spline Approximating spline
4. Splines 2
H&B 8-8:420-425
Convex hull: Smallest polygon that encloses all points
Interpolating spline Approximating spline
Convex hull
7. 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)
8. 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)
9. 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!
10. 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)
11. 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)
12. 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)
17. 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
25. 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 nu1 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))
26. 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])
27. // 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
28. // 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
47. 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!
48. 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.
49. Next…
• We now know how to model curved objects
• But they still look somewhat dull, …