# CS488 - Introduction to Computer Graphics - Lecture 35

## Review

1. Winged edge
2. Splines without tears
3. Animation

## Spline Curves

#### Affine Combinations

1. Line segments
• Two points
• P^1_0(t, u) = uP0 + tP1
• For this to be affine we need u + t = 1
• Three points
• P^1_0(t, u) = uP0 + tP1; P^1_1(t, u) = uP1 + tP2
• P^2_0(t, u) = uP^1_0(t, u) + tP^1_1(t, u) = u^2 P0 + 2ut P1 + t^2 P2
• Notice derivatives at end points are not independent
3. Cubic segments
• Four points
• P^3_0(t, u) = t^3 P0 + 3t^2 u P1 + 3 t u^2 P2 + u^3 P3
• Now the derivatives at the end points are independent
4. etc

This process is called `blending' points.

If we call comb(n,i)u^(n-i) t^i the Bernstein polynomial, B(n, i; t, u), then

• The n'th degree segment is
• sum_i B(n, i; t, u) Pi is the blend
• This is a Bezier curve of degree n.
• Pi: i = 0,...,n are the control points.
• Note. n is not the dimension of the space in which you are working.
• Useful fact:
• sum_i B(n, i; t, u) = (t + u)^n = 1.
• The sum in the blend is necessarily affine (Why is this important?)
• This should remind us strongly of all the stuff we know about binomials: Pascal's triangle and all that.

#### Joining Bezier curves

With C0 continuity

• Q0 = P3
• Interface
1. Place P0, P1, P2, P3
2. Q0 is determined; place Q1, Q2, Q3
3. R0 is determined; place R1, R2, R3
4. etc.

With C1 continuity

• Q0 = P3
• Q1 - Q0 = P3 - P2, or Q1 = 2 P3 - P2
• Interface
1. Place P0, P1, P2, P3
2. Q0, Q1 are determined; place Q2, Q3
3. R0, R1 are determined; place R2, R3
4. etc.

Weaker first order continuity G1

• Q0 = P3
• Q1 - Q0 = a(P3 - P2), or Q1 = (a+1) P3 - a P2 a > 0 (Why?)
• Interface
1. Place P0, P1, P2, P3
2. Q0 is determined; choose a, place Q2, Q3
3. R0 is determined; choose b, place R2, R3
4. etc.

With C2 continuity

• Q0 = P3
• Q1 - Q0 = P3 - P2, or Q1 = 2 P3 - P2
• Q2 = linear combination of P1, P2, P3 (Calculation an exercise for the reader.)
• Interface
1. Place P0, P1, P2, P3
2. Q0, Q1, Q2 are determined, place Q3
3. etc.