CS488 - Introduction to Computer Graphics - Lecture 31
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
- 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
- Blending is the key operation.
- Start with two points P1, P2
- 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
- Start with three points P1, P2, P3
- Blend in pairs
- P10(t) = P1 + t (P2 - P1)
- P11(t) = P2 + t (P3 - P2)
- Blend the blend
- P20(t) = P10(t) + t (P11(t) - P10(t))
- 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
- C0
- no break in the curve
- provided by linear splines
- Essence is the following
- The previous segment P1, P2 is given
- You want to add a new segment Q1, Q2
- Continuity requires Q1 = P2
- 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
- C1
- Tangent is continuous where segments join.
- What are the tangents at P3 & Q1?
- 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
- Quadratic splines
- 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
- Q1 = P3
- Q2 = Q1 + P3 - P2 = P3 + (P3 - P2)
- No local control
- Cubic splines
- blending
- ...
- local control
- C2
- etc.
- Geometric
- G0: same as C0
- G1: only directions of tangents need to be the same
- For quadratic splines the two constraints are
- Q1 = P3
- 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.
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.
- C0 continuity: no teleportation, possible discontinuities in velocity,
which violate Newtonian mechanics.
- C1 continuity: no discontinuities in velocity, possible infinite
accelarations.
- C2 continuity: acceleration continuous, possible infinite jerks.
- etc.
Most impotant point
Definition of `realistic' varies
- Between camera and actors
- As type of actor changes: compare classic Disney animation to live
action, which obeys Newtonian dynamics (and other constraints, too)
Return to: