Modelling

Splines without Tears (or Jerks)

Why do splines exist at all?

• Sometimes we absolutely need curves
• Example: specifiying fonts for SVG

General piece-wise curves

1. One example is line segments: you have been making them all along.

When you put them in a mesh there is an extra requirement

• They must join at the ends: end of one must be the start of the next
• This is continuity.

Linear splines

1. Blending is the key operation.
3. Get the in-between points using P(t) = P1 + t(P2 - P1) for 0<t<1.

Linear curves necessarily give derivative discontinuities (called C1 continuity)

We can make the discontinuities unimportant by putting the points close enough together

• That is, you give me a curve I can evaluate at any points,
• I can pick points close enough together that linear interpolation between the points produces negilible derivative discontinuities.
• But how do you specify this curve?
• algebraic equation
• OR ???

The usual way is a piecewise continuous non-linear curve, with as much continuitity as you desire at the joins.

Non-linear blending

2. Blend in pairs
• P10(t) = P1 + t (P2 - P1)
• P11(t) = P2 + t (P3 - P2)
3. Blend the blend
• P20(t) = P10(t) + t (P11(t) - P10(t))
4. The result is a quadratic curve

You can take this to as many levels as you want. What does it give you? Continuity. Which is what?

There are many types of continuity

• Algebraic
1. C0
• no break in the curve
• provided by linear splines
• Essence is the following
1. The previous segment P1, P2 is given
2. You want to add a new segment Q1, Q2
3. Continuity requires Q1 = P2
4. User provides Q2
• Interaction is local
• Why is locality important?
• If you change Q1 only two segments change to preserve continuity
• If you change Q2 only two segments change to preserve continuity
2. C1
• Tangent is continuous where segments join.
• direction
• length
• What are the tangents at P3 & Q1?
1. Linear splines
• At t=1, dP(t)/dt = P2 - P1
• At t=0, dQ(t)/dt = Q2 - Q1
• Condition for tangent continuity obviously too stringent!
• No local control
• At t=1,
• dP10(t)/dt = P2 - P1
• dP11(t)/dt = P3 - P2
• dP20(t)/dt = P2 - P1 + P11(1) - P10(1) + 1*(P3 - 2P2 + P1) = 2(P3 - P2)
• At t=0,
• dQ10(t)/dt = Q2 - Q1
• dQ11(t)/dt = Q3 - Q2
• dQ20(t)/dt = Q2 - Q1 + Q11(0) - Q10(0) = 2(Q2 - Q1)
• Two constraints
1. Q1 = P3
2. Q2 = Q1 + P3 - P2 = P3 + (P3 - P2)
• No local control
3. Cubic splines
• blending
• ...
• local control
3. C2
4. etc.
• Geometric
1. G0: same as C0
2. G1: only directions of tangents need to be the same
• For quadratic splines the two constraints are
1. Q1 = P3
2. Q2 - Q1 = a (P3 - P2)

Q2 = P3 + a (P2 - P3)

• Local control for quadratic splines

Can be extended to surfaces

• called `spline patches'
• bilinear interpolation on a quadrilateral grid
• isobaric interpolation on a triangular grid

Splines are good for modelling.

• But modelling what?

Animation

Quite simple, really

• Parameters of the model are functions of time.
• parameters of moving objects
• parameters of camera, including things like depth of field
• The modeller must specify these functions.
• Constraints.
• The functions must be physically `realistic'.
• The functions must be easily specifiable.

`Specifiable': Think splines.

`Realistic': Think continuity.

1. C0 continuity: no teleportation, possible discontinuities in velocity, which violate Newtonian mechanics.
2. C1 continuity: no discontinuities in velocity, possible infinite accelarations.
3. C2 continuity: acceleration continuous, possible infinite jerks.
4. etc.

Most impotant point

Definition of `realistic' varies

1. Between camera and actors
2. As type of actor changes: compare classic Disney animation to live action, which obeys Newtonian dynamics (and other constraints, too)