R10=[i^1∣j^1∣k^1]
Lengyel Chep 11.1-11.3
Single curve => global scheme
precises curve => local scheme
Explicit
Three ways
y=f(x)
Example: y=cosx
properties
- generative
- Can only represent single-valued functions
f(x,y)=0
Example: x2+y2−z2=0
Properties
- Non-generative
- Can represent multi-valued functions
x(t)=f(t)y(t)=g(t)
where u is independent variable
Example:
x(t)=rcosty(t)=rsintt∈[0,2π]
Properties:
- generative
- Can represent multi-valued functions
- Different parametrization can produce the same path
Monomial Form
f(u)=a0+a1u+a2u2+...+anun
where n=degree of polynomial curve (highest exponent)
y=a0+a1u+a2u2+a3u3=>monomial form
yˉ=aˉ0+aˉ1u+aˉ2u2+aˉ3u3
Example
x(u)=1+6u−9u2+4u3y(u)=−3u2+4u3f(u)=(x(u)y(u))=(10)+(60)u+(−9−3)u2+(44)u3
Derivative
not continuous 不连续
c0自己连续,导数不连续
c1一阶导数连续,后面不连续
c2二阶导数连续,后面不连续
Note: Human visual system cannot distinguish discontinuities greater than to 2
General form (of curve and )
x(u)y(u)z(u)=f(u)=i=0∑nbiBin(u)
Bin(u)=Basis functions of degree n (scalars not matrix)
Monomials: Bin(u)∈{1,u,u2,...,un}
f(u)=b0+b1⋅u
x(u)y(u)z(u)...=f(u)=i=0∑nbiBin(u)
n=1, linear
f(u)=b0(1−u)+b1(u)
n=2, quadratic
f(u)=b0(1−u)2+b12(1−u)+b2u2
n=3, cubic
f(u)=b0(1−u)3+b13u(1−u)2+b13u2(1−u)+b3u3
General Form of Bernstein Polynomials of degree n
Bin(n)=Cin(1−u)n−iui
bi control points
b1, b2: slope
b0, b3: point
让两个 curve 连接处平滑
几何意义:控制点就是这个曲线的 Convex Hull
Review, Lecture 7
monomials
f(u)=c0+c1t+c2t2+c3t3
De Casteljau Algorithm
Computes Bezier curve function f(u) using successive linear interpolation
eg. want to know value of curve at u=0.25
b01=Lerp(b0,b1,u)b11=Lerp(b1,b2,u)b21=Lerp(b2,b3,u)b02=Lerp(b01,b11,u)b12=Lerp(b11,b21,u)b03=Lerp(b02,b12,u)
where, Lerp(a,b,u)=a(1−u)+bu,f(u)=b03
Systolic(收缩) Array – associated with calculation of intermediate control points
Bleft={b0,b01,b02,b03}Bleft={b03,b12,b21,b2}
dudf=f1(u)=i=0∑n−1n(bi+1−bi)Bin−1(u)
case n=3
f1(u)=3(b1−b0)B02(u)+3()...
Therefore,
dudf(0)=3(b1−b0)=S0dudf(1)=3(b3−b2)=S1

ti: the knots of spline
N: # of curve segments
n: degree of the curve segments
m=N+1=number of points
Given
- a set of points {p0,p1,p2,...,pN}
- basis function polynomials of degree {B0n,B1n,…,Bnn} n
find the coefficient bi for the jth curve segment of the spline
fj(t)=x(t)y(t)z(t)=i=0∑nbiBin(u)where,u=tj+1−tjt−tj,j∈[0,N−1]
Centrol point: slope between two segment is same
C1 continuity
Use Bezier curves for each segment j
Cubic splines (n=3)
fj(t)=b0B03(u)+b1B13(u)+b2B23(u)+b3B33(u)
Control Point Array
Collect all the control points for spline into an array C
C=[b0,b1,b2,b3b0,b1,b2,b3b0,b1,b2,b3]fj(t)=j=0∑nC(n+1)j+iBjn(u)
Computing control points for each curve segments (n=3, case)
b0=Pjb1=b0+31S0b2=b3−31S1b3=Pj+1
平均值 assume Δt=1
S0=2Pi+1−Pi−1S1=2Pi+2−Pi
对于左右端点,特别的定义
to evaluate curve segment's particular point value in time t, need to compute B
- Compute u, u=tj+1−tjt−tj
- Use Bernstein polys to evaluate B
- B03(u)=(1−u)3
- B13(u)=3u(1−u)2
or
De Casteljau Algorithm
m the Monomial form
f(u)=a0+a1u+a2u2+a3u3=[]f(u)=GmonMmonU
f(u)=b0+(3b1−3b0)u+(3b2−4b1+3b0)u2+(b3−3b2+3b1−b0)u3=[b0∣b1∣b2∣b3]1000−33003−630−13−311uu2u3=GBezMBezU
What if I give the monomial coefficients () and value of
GBez=GMonMMon(MBez)−1
reworked Bezier curves
h(u)=p0H03(u)+p1H33(u)+p0′H13(u)+p1′H23(u)
- p0: left side of curve
- p1: right side of curve
- p1′: slope of left side of curve
- p2′: slope of right side of curve
What is the basis functions H
Bezier curve derivatives
f(u)=S0=dudf(0)=3(b1−b0)
h(u)=f(u)=b0B03+(b0+31S0)B13+(b3−31S1)B23+b3B33
C2 continuity
General Case
fj(u)=hj(u)=pjH03(u)+pj+1H33(u)+pj′H13(u)+pj+1′H23(u)
1st Derivative:
dudf=f′=h′=pj(6u2−6u)+pj+1(−6u2+6u)+
2nd Derivative:
h′′=
To have continuous 2nd derivative between segments
hj′′(1)=hj+1′′(0)
Constraint
pj′+4pj+1′+pj+2′=3(pj+2−pj)
AC=D, C=A^{-1}D
Clamped Endpoint Conditions
S0, sn
natural spline
left and right side of curve 2nd derivative = 0
Interpolating Quaternion
∥p∥=1
p=aq1+bq2 linear combination of q1, q2
q1⋅q2=cosΩ
q1⋅p=cosθ=q1⋅(aq1+bq2)=a+bcosΩ
p⋅p=(aq1+bq2)⋅(aq1+bq2)=a2+2abcosΩ+b2=1
=>
a=sinΩsin(Ω−θ)b=sinΩsinθ
let θ=uΩ,u∈[0,1],θ=cos−1(q1⋅q2)
p=sinΩsin((1−u)Ω)q1+sinΩsin(uΩ)q2=Slerp(q1,q2,u)
Cutmal-Rom
use de Casteljau to evaluate spline at a given u
Assume want the equivalent of a Catmull-Rom spline
bezier
Geometric Interpretation of slope
Introduce 3
- Double(a,b)=2∗diff=a+2(b−a)
- Bisect(a,b)=2(a+b)
- lerp(a,b,u)=(1−u)a+ub
left slope
pj+1d=Double(pj−1,pj)pj+1b=Bisect(pj+1,pj+1d)
=>
S0=pj+1b−pj=3(b1−b0)=3(b1−pj)b1=31pj+1b+32pj=lerp(pj,pj+1b,31)
right slope
pjD=Double(pj+2,pj+1)pjB=Bisect(pj,pjD)
=>
S1=pj+1−pjB=3(b3−b2)=3(pj+1−b2)b2=xxx
- SBisect(a,b)=∥a+b∥a+b
- SDouble(a,b)=2(a⋅b)b−a
- Slerp(a,b,u)=
Cubic Splines
b0b1b2b3=qj=slerp(qj,qj+1B,31)=slerp(qj+1,qjB,31)=qj+1
where
qib=SBisect(qi,qid)qid=SDouble(qi+2,qi+1)qi+1b=SBisect(qi+1d,qi+1)qi+1d=SDouble(qi−1,qi)
edge case
Cubic Quaternion Catmul-Rom Splines
de Casteljau algorithm
b03=slerp(b02,b12,u)
surface
(u,v)
two tengant
normal: ×
2D linear interpolation
General form of Bilinear interpolation
f(u,v)=∑i=01∑j=01Bi1(u)Bj1(v)bij
f(u,v)=∑i=03∑j=03Bi3(u)Bj3(v)bij
(p−p0)=f(u,v,w)=
Jaccob matrix