lecture 10 - cubic curves - cubic splines - bicubic surfaces We - - PowerPoint PPT Presentation

lecture 10 cubic curves cubic splines bicubic surfaces we
SMART_READER_LITE
LIVE PREVIEW

lecture 10 - cubic curves - cubic splines - bicubic surfaces We - - PowerPoint PPT Presentation

lecture 10 - cubic curves - cubic splines - bicubic surfaces We want to define smooth curves: - for defining paths of cameras or objects - for defining 1D shapes of objects We want to define smooth surfaces too. Parametric Equation of a


slide-1
SLIDE 1

lecture 10

  • cubic curves
  • cubic splines
  • bicubic surfaces
slide-2
SLIDE 2

We want to define smooth curves:

  • for defining paths of cameras or objects
  • for defining 1D shapes of objects

We want to define smooth surfaces too.

slide-3
SLIDE 3

Parametric Equation of a Line The curve is a linear combination of two points. How to generalize this?

slide-4
SLIDE 4

The curve will be a linear combination of the points. How ?

slide-5
SLIDE 5

Cubic Curves

Each is a polynomial of degree 3 and defined over all t.

slide-6
SLIDE 6

Choosing the coefficients gives us a curve, but how do we choose the coefficients ?

slide-7
SLIDE 7

Fitting a cubic function.

(Why are 4 points needed ?)

slide-8
SLIDE 8
slide-9
SLIDE 9

Multiplying by B gives solution for coefficients a, b, c, d.

slide-10
SLIDE 10

We apply the same technique for y(t) and z(t) . I will walk through the derivation again, but this time solve for all x(t), y(t), z(t). Trying to solve for this.

slide-11
SLIDE 11
slide-12
SLIDE 12

Now what ?

slide-13
SLIDE 13

This gives us the 4x4 coefficient matrix (a,b,c,d).

slide-14
SLIDE 14

geometry blending

slide-15
SLIDE 15

A blending matrix is 4 x 1. Each row is a polynomial of degree 3 in t. The blending matrix B is independent of the geometry matrix ! It can be precomputed once and stored.

slide-16
SLIDE 16

Suppose we are given n >> 4 points and we would like a smooth curve through them in given order. How?

slide-17
SLIDE 17

We could take [ p0, p1, p2, p3 ] [ p3, p4, p5, p6 ] [ p6, p7, p8, p9 ] and make cubic curve segments for each, and put them together at "knot" points. Q: Does that work ? A: No, we might have tangent discontinuities.

slide-18
SLIDE 18

There is no reason why the resulting curve should be smooth at the knots.

slide-19
SLIDE 19

Splines

In general, curves used for interpolating between points are called ’splines’.

slide-20
SLIDE 20

In mathematics, a spline is a piecewise polynomial function. It should satisfy some continuity condition at the places (called "knots") where the polynomial pieces join. An example is that the "tangent" is continuous ...

slide-21
SLIDE 21

Tangent Vector

slide-22
SLIDE 22

How to reformulate the problem to consider tangents?

slide-23
SLIDE 23

How can we use these data to choose matrices as follows ?

Hermite Curve

http://en.wikipedia.org/wiki/Charles_Hermite

Given this:

slide-24
SLIDE 24

Hermite Curve

http://en.wikipedia.org/wiki/Charles_Hermite

slide-25
SLIDE 25

Multiply both sides by the following. This gives us the coefficient matrix.

slide-26
SLIDE 26
slide-27
SLIDE 27

Q: What are the weights at time t = 0, 1 ? A:

slide-28
SLIDE 28

Hermite Cubic Spline

How do we fit a curve to n point + tangent pairs ?

slide-29
SLIDE 29

The tangents are equal at the knots (good).

slide-30
SLIDE 30

Bézier Curve

slide-31
SLIDE 31
slide-32
SLIDE 32

"Bernstein polynomials" for t in [0, 1], they lie in [0,1] and they sum to 1. (convexity property)

slide-33
SLIDE 33

Convexity property can be useful for clipping and intersections e.g. bounding volume.

slide-34
SLIDE 34

Catmull-Rom Spline (Motivation)

With Bezier, we avoided specifying tangent vectors but now the curve passes through only half the points. (Essentially, we are still specifying tangents.) We would like to interpolate ALL points (unlike Bezier !) but also have the nice Hermite property of continuous tangent vector at knots.

slide-35
SLIDE 35

Catmull-Rom Spline

Exercise: what are the geometry and blending matrices?

slide-36
SLIDE 36

lecture 10

  • cubic curves
  • bicubic surfaces
slide-37
SLIDE 37

Suppose we are given a 4x4 "grid" of 3D points. We would like to interpolate a surface. How ?

slide-38
SLIDE 38

Start by fitting 4 cubic curves, corresponding to s = 0, 1, 2, 3. Use the vanilla method at start of lecture. Then, for each t, fit a cubic curve as a function of s.

slide-39
SLIDE 39

The solution is:

... and similarly for y(s,t) and z(s,t). I will derive it over the next several slides.

slide-40
SLIDE 40

For each s = 0, 1, 2, 3

slide-41
SLIDE 41

Stacking them gives:

slide-42
SLIDE 42

For any t, we have four points which we write as a row vector. This gives us our vanilla problem. Note: We’re only keeping track of x values here, but there are y and z values too.

slide-43
SLIDE 43

For any t, we fit a cubic of parameter s.

slide-44
SLIDE 44

Taking the transpose... ... and replacing the right column with ... ... gives the answer.

slide-45
SLIDE 45

Surface tangents and surface normals

slide-46
SLIDE 46

surface tangents

Any linear combination of these is also a tangent.

slide-47
SLIDE 47

surface normal surface tangents

slide-48
SLIDE 48

Summary

  • cubic curve vs cubic spline
  • ’vanilla’, Hermite, Bézier, Catmull-Rom
  • geometry (control points) versus

blending

  • defining tangents in terms of

differences of point positions

  • lots of algebra that you should

understand but not memorize