  Syllabus Blank Homework Quizzes Notes Labs Scores Blank

Lecture Notes
Dr. Tong Lai Yu, 2010
 1. Introduction 2. OpenGL Shading Language ( GLSL ) I 3. GLSL II 4. Curve and Surface Design
 5. Modeling Shapes with Polygonal Meshes 6. Texture Mapping 7. Casting Shadows 8. Tools for Raster Display 9. Parsing External Objects

Curves and Surfaces

Hermite Interpolation

1. Consider both derivatives at data points as well as data points themselves; closely related to "Newton divided difference" method.

2. May consider Cubic polynomials; curve passing through 5 points P0, P1,P2,P3,P4, ( a set of data points can be broken down to groups of 5 points )

3. Pk = ( xk, yk, zk ), we can consider each component separately

4. Subinterval (xk, xk+1) can be normalized to ( 0, 1 ) via t = ( x - xk ) / ( xk+1 - xk )

5. The k-th cubic segment of the interpolated curve is given by
xk (t) = ak t3 + bk t2 + ck t + dk       0 ≤ t ≤ 1
so that xk(0) = xk,   xk(1) = xk+1

6. So,
at t = 0:     dk = xk
at t = 1:     ak + bk +ck +dk = xk+1       k = 0, 1, 2, 3

7. The derivatives are
x'k(t) = d xk(t) / dt = 3ak t2 + 2bk t1 + ck

8. Let x'k = x'k(0),   x'k+1 = x'k(1)
at t = 0:     ck = x'k
at t = 1:    3ak + 2bk + ck = x'k+1

9. From f) and h), we can solve the coefficients:
dk = xk
ck = x'k
bk = 3(xk+1- xk) - 2x'k - x'k+1
ak = x'k+1 + x'k - 2(xk+1 - xk)

How to find the derivatives ( slopes ) ?

Consider second derivatives:

x"k(t) = d2xk(t)/dt2 = 6akt + 2bk     ---- (1)

We require the second derivatives to be continuous, i.e. x"k-1(1) = x"k(0), So

3ak-1 + bk-1 = bk       for k = 1, 2, 3, 4     ---- (2)

Substituting ak, and bk of i) into (2), we have

3[x'k + x'k-1 - 2(xk - xk-1)] + 3(xk- xk-1) - 2x'k-1 - x'k = 3(xk+1- xk) - 2x'k - x'k+1

which can be simplified to

x'k-1 + 4 x'k + x'k+1 = 3 ( xk+1 - xk-1 )       for k = 1, 2, 3, 4     ---- (3)

This gives us 4 sets of equations:

 x'0 + 4x'1 + x'2 = 3(x2 - x0) --- (4a) x'1 + 4x'2 + x'3 = 3(x3 - x1) --- (4b) x'2 + 4x'3 + x'4 = 3(x4 - x2) --- (4c)

Now we have 3 equations but 5 unknowns. We need 2 more; so we choose,

x"0(0) = 0
x"4(1) = 0

which gives ( from 1 ),

b0 = 0
3a4 + b4 = 0

Substituting these into i), we have

 2x'0 + x'1 = 3(x1 - x0) --- (4d) 2x'4 + x'3 = 3(x4 - x3) --- (4e)

So we have 5 equations, 4a-4e, and can solve for the 5 unknowns x'i, i = 0, 1, 2, 3, 4