fundamentals of computer graphics lecture 3 parametric ... · cn curve continuity...
TRANSCRIPT
![Page 1: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/1.jpg)
《Fundamentals of Computer Graphics》
Lecture 3 Parametric curve and surface
Yong-Jin Liu
![Page 2: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/2.jpg)
Smooth curve and surface
![Page 3: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/3.jpg)
Design criteria of smooth curve and
surface
• Smooth and continuity
• Ability to control the local shape
• Stability
• Is it easy to draw
![Page 4: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/4.jpg)
Smooth and continuity
• Regard the curve as the orbit of point changing with its
parameter u
• Regard the differential of one point as the its speed
along the orbit, the direction of speed is the tangent
direction of this point
2
0 1 2( )
( ) ( )
( )
n
nx u a a u a u a u
C u y u
z u
1
1 2( ) 2
( ) ( )
( )
n
nx u a a u na u
C u y u
z u
![Page 5: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/5.jpg)
![Page 6: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/6.jpg)
Cn metric of curve smooth
• Differentiability of function:if parametric curve has
continuous derivative until n order at any point in the
interval [a, b],i.e. n order continuous differentiable,
then the curve is n order parametric continuous in the
interval [a, b].
• Polynomial curve has infinite order parametric
continuous C。
Polynomial curve of n order pn(x)=a0+a1x+a2x2+anx
n
![Page 7: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/7.jpg)
Consider two curves with a common point
• Differentiability of function:if parametric curve has
continuous derivative until n order at any point in the
interval [a, b],i.e. n order continuous differentiable,
then the curve is n order parametric continuous in the
interval [a, b].
C0 continuous C1 continuous
![Page 8: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/8.jpg)
Cn curve continuity
• Differentiability of function:if combined parametric
curve has continuous derivative until n order at the
joint point, it is called Cn or n-order parametric
continuous.
• Is there any thing wrong?
• The same curve can have different parameters.
2
2
2
1( )
( ) cos( ) 1 or ( ) sin( ) 2
( )1
tx t
x u u t
y u u ty t
t
circle:
![Page 9: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/9.jpg)
Different parameters will get different
derivative vector!
)2,0()1(
)1(2,
)1(
4))(),((
)1,0())cos(),sin(())(),((
22
2
22
t
t
t
ttytx
uuuyux
![Page 10: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/10.jpg)
C(u), u [a, b]
C(t), t [0, 1], ab
aut
( ) ( ) 1 ( ) 1( ) ( )
dC u dC t dt dC tC u C t
du dt du b a dt b a
![Page 11: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/11.jpg)
Two continuity definitions
• Differentiability of function:if combined parametric
curve has continuous derivative until n order at the
joint,i.e. n order continuous differentiable, such
smooth is called Cn or n order parametric continuous.
• Geometry continuity:if the direction of
derivative vector of combined curve at the joint is
equal, then it is n order geometry continuous,
denoted by Gn.
![Page 12: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/12.jpg)
If require G0 or C0 continuous at the joint,
that is to say two curves are continuous at the
joint.
If require G1 continuous at the joint,that is
to say two curves are G0 continuous at the
joint, and have the common derivative vector
P’(1)=aQ’(0).
when a=1,G1 continuous is also C1 continuous
If require G2 continuous at the joint,that is
to say two curves are G1 continuous at the
joint, and have common curvature vector.
![Page 13: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/13.jpg)
This equation can be wrote as :
a, b is arbitrary constant.
When a=1,b=0,G2 continuous is also C2 continuous.
3 3
(1) (1) (0) (0)Curvature formula
(1) (0)
P P Q Q
P Q
2(0) (1) (1)Q a P bP
)(tP
)(tQ
)0(P
)1(P
)0(Q
)1(Q
Figure 3.1.7 continuous of two curves
![Page 14: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/14.jpg)
Arc length parameterization of curve
• The same curve can have different parameter
• If u(s) is a monotonic function,then
C(s)=C(u(s)) is a new parameterization about s
of the curve
• Compute the length L(u) of curve C(u)
• If there exists parameter s,
so that L(s)=s, s 0? s = 0
Parameter s
Length L(s)
Curve C(s)
![Page 15: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/15.jpg)
0
1
Let | ( ) |
| ( ) | ( )
( ) ( )
u
dsC u
du
s C u du L u
u s L s
Arc length parameterization of curve
( ) ( ( )) 1( ) ( )
| ( ) |
dC s dC u s duv s C u
ds du ds C u
| ( ) | 1v s
![Page 16: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/16.jpg)
![Page 17: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/17.jpg)
Design criteria of smooth curve and
surface
• Smooth and continuity
• Ability to control the local shape
• Stability
• Is it easy to draw
![Page 18: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/18.jpg)
Power based representation of polynomial curve
•
•
•
0
( ) ( ( ), ( ), ( ))n
i
i
i
C u x u y u z u u
a
( , , )i i i ix y za
0 1
1
( )T
n i i
n
uC u u
u
a a a a
n order polynomial curve Cn(u)=a0+a1u+a2u
2++anun
![Page 19: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/19.jpg)
1 order polynomial curve:
a1u+a0
a0
a1+a0
n order polynomial curve Cn(u)=a0+a1u+a2u
2++anun
See from the aspect of human
computer interaction…
![Page 20: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/20.jpg)
2 order polynomial curve:
a2u2+a1u+a0
a0
a1
a2+a1+a0
2a2+a1
Parabola, ellipse, hyperbola?
n order polynomial curve Cn(u)=a0+a1u+a2u
2++anun
![Page 21: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/21.jpg)
3 order polynomial curve:
a3u3+a2u
2+a1u+a0
n order polynomial curve Cn(u)=a0+a1u+a2u
2++anun
![Page 22: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/22.jpg)
Power based representation of polynomial curve
•
• The representation and control ability is very bad
Bernstein based representation of polynomial
curve
n order polynomial curve Cn(u)=a0+a1u+a2u
2++anun
,
0
,
( ) ( )
!( ) (1 )
!( )!
n
i i n
i
i n i
i n
C u B u
nB u u u
i n i
pBeizer curve
Bernstien polynomial
![Page 23: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/23.jpg)
1
u
u2
a0 a1
a2
2
210)( uauaauf
B0,2
B1,2
B2,2
p0 p1
p2
2,222,112,00)()( BpBpBpuCuf
![Page 24: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/24.jpg)
Bernstein based representation of polynomial curve
• have clear geometry meaning
, ,
0 0
( ) ( ) ( )n n
i i n i n i
i i
C u B u B u
p p
![Page 25: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/25.jpg)
Bernstein based representation of polynomial curve
• Have clear geometry meaning
• Interpolation of endpoints
, ,
0 0
( ) ( ) ( ) , [0,1]n n
i i n i n i
i i
C u B u B u u
p p
,
!( ) (1 ) , [0, 1]
!( )!
i n i
i n
nB u u u u
i n i
, 0
0
,
0
(0) (0)
(1) (1)
n
i i n
i
n
i i n n
i
C B
C B
p p
p p
![Page 26: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/26.jpg)
Bernstein based representation of polynomial curve
• Have clear geometry meaning
• Why there exists control polygon effect when use
Bernstein based representation?
![Page 27: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/27.jpg)
, 0,1 0 1,1 1
0
,
( ) ( ) ( ) ( )
!( ) (1 ) , [0, 1]
!( )!
n
i n i
i
i n i
i n
C u B u B u B u
nB u u u u
i n i
p p p
1 order Bezier curve
u=0 u=1
![Page 28: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/28.jpg)
, 0,2 0 1,2 1 2,2 2
0
,
( ) ( ) ( ) ( ) ( )
!( ) (1 ) , [0, 1]
!( )!
n
i n i
i
i n i
i n
C u B u B u B u B u
nB u u u u
i n i
p p p p
2 order Bezier curve
u=0 u=1
![Page 29: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/29.jpg)
, 0,3 0 1,3 1 2,3 2 3,3 3
0
,
( ) ( ) ( ) ( ) ( ) ( )
!( ) (1 ) , [0, 1]
!( )!
n
i n i
i
i n i
i n
C u B u B u B u B u B u
nB u u u u
i n i
p p p p p
3 order Bezier curve
u=0 u=1
![Page 30: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/30.jpg)
9
,
0
,
( ) ( )
!( ) (1 ) , [0, 1]
!( )!
i n i
i
i n i
i n
C u B u
nB u u u u
i n i
p
9 order Bezier curve
u=0 u=1 u=0.5
![Page 31: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/31.jpg)
Properties of Bezier curve and Bernstein base
1. Bi,n(u) 0, for all i, n and 0 u 1
2. Partition of unity ni=0Bi,n(u) = 1, 0 u 1
3. B0,n(0) = Bn,n(1) = 1
4. Bi,n(u) has and only has a maximum value
in the interval [0,1] , it is at u=i/n
5. Base set {Bi,n(u)} is symmetry about u=1/2
,
!( ) (1 ) , [0, 1]
!( )!
i n i
i n
nB u u u u
i n i
![Page 32: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/32.jpg)
Computation method of Bezier curve
• Method 1:
• Method 2:geometry drawing
9
,
0
,
( ) ( )
!( ) (1 ) , [0, 1]
!( )!
i n i
i
i n i
i n
C u B u
nB u u u u
i n i
p
![Page 33: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/33.jpg)
Computation method of Bezier curve
• Method 2 (geometry drawing, ruler drawing):
• example 2 order Bezier curve
2
,2
0
2 2
0 1 2
0 1 1 2
( ) ( )
(1 ) 2 (1 )
(1 )((1 ) ) ((1 ) )
i i
i
C u B u
u u u u
u u u u u u
P
P P P
P P P P
![Page 34: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/34.jpg)
![Page 35: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/35.jpg)
![Page 36: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/36.jpg)
2
,2
0
2 2
0 1 2
0 1 1 2
( ) ( )
(1 ) 2 (1 )
(1 )((1 ) ) ((1 ) )
i i
i
C u B u
u u u u
u u u u u u
P
P P P
P P P P
Is this property general?
2 order Bezier curve
![Page 37: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/37.jpg)
,
!( ) (1 ) , [0, 1]
!( )!
i n i
i n
nB u u u u
i n i
Properties of Bezier curve and Bernstein base
6. recursive definition:
Bi,n(u) = (1u)Bi,n1(u) +uBi1,n1(u)
with Bi,n(u) 0, if i < 0 or i > n
7. derivative:
B’i,n(u) = dBi,n(u) /du = n(Bi1,n1(u) Bi,n1(u) )
with B1,n1(u) Bn,n1(u) 0
![Page 38: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/38.jpg)
Denote n order Bezier curve as
Cn(P0,,Pn), then we have
Cn(P0,,Pn)=(1u)Cn1(P0,,Pn-1)+uCn1(P1,,Pn)
![Page 39: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/39.jpg)
![Page 40: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/40.jpg)
![Page 41: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/41.jpg)
Geometry drawing algorithm
n order Bezier curve has
denote Pi as P0,i
Cn(P0,,Pn)=(1u)Cn1(P0,,Pn-1)+uCn1(P1,,Pn)
Pk,i(u)=(1u)Pk1,i(u)+uPk1,i+1(u)
k = 1,,n
i = 0,,nk deCasteljau algorithm
![Page 42: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/42.jpg)
Smooth curve and surface in 3D space
![Page 43: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/43.jpg)
1D to 2D
• Regard the curve as the orbit of point
changing with its parameter u
2
0 1 2( )
( ) ( )
( )
n
nx u a a u a u a u
C u y u
z u
![Page 44: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/44.jpg)
Tensor product surface
• Tensor product surfaces
• Point S(u0, v0)
• Isoparametric lines C(u) = S(u, v0) and
C(v) = S(u0, v)
,
0 0
,
( , ) ( ( , ), ( , ), ( , ))
( ) ( )
[ ( )] [ ][ ( )]
n m
i j i j
i j
T
i i j j
S u v x u v y u v z u v
f u g v
f u g v
b
b
Base function
Geometry coefficient
![Page 45: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/45.jpg)
![Page 46: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/46.jpg)
Tensor product Bezier surface
• Point S(u0, v0)
• Isoparametric lines C(u) = S(u, v0) and C(v) = S(u0, v)
, , ,
0 0
( , ) ( ) ( )n m
i n j m i j
i j
S u v B u B v
P
![Page 47: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/47.jpg)
![Page 48: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/48.jpg)
![Page 49: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/49.jpg)
, , ,
0 0
( , ) ( ) ( )n m
i n j m i j
i j
S u v B u B v
P
2D Bernstein base
![Page 50: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/50.jpg)
Computation method of Bezier curve
• Geometry drawing algorithm
• deCasteljau algorithm
![Page 51: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/51.jpg)
Computation method of Bezier curve
• deCasteljau algorithm
, , ,
0 0
, , ,
0 0
,
0
( , ) ( ) ( )
( ) ( )
( )
n m
i n j m i j
i j
n m
i n j m i j
i j
n
i n i
i
S u v B u B v
B u B v
B u
P
P
Q u
v
![Page 52: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/52.jpg)
![Page 53: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/53.jpg)
Design criteria of smooth curve and
surface
• Smooth and continuity
• Ability to control the local shape
• Stability
• Is it easy to draw
• Is Bezier curve perfect?
![Page 54: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/54.jpg)
![Page 55: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/55.jpg)
Beizer curve
• The representation and control ability of local
shape is bad
• if interpolate many (n+1) discrete point s,
then require a high order (n) Bezier curve.
How to improve?
• Splicing many Bezier curve segments
n order polynomial curve Cn(u)=a0+a1u+a2u
2++anun
![Page 56: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/56.jpg)
Design of B-spline curve
• Determine the order of continuity p
• Determine node vector U = {u0, u1, , um};
• Determine a set of control points {P0, P1, ,
Pn};
• The form of B-spline curve is
,
0
( ) ( )n
i p i
i
C u N u
P
![Page 57: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/57.jpg)
B-spline surface
• Tensor product surface
, , ,
0 0
( , ) ( ) ( )n m
i p j q i j
i j
S u v N u N v
P
1
1 1
11
1
1 1
11
{0, ,0, , , ,1, ,1}
{0, ,0, , , ,1, ,1}
r
p r p
pp
s
q s q
U u u
V u u
1 and 1r n p s m q
![Page 58: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/58.jpg)
![Page 59: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/59.jpg)
Ability of local shape change
![Page 60: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/60.jpg)
Ability of local shape change
![Page 61: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/61.jpg)
The reason is the local scope of basic function
, , ,
0 0
( , ) ( ) ( )n m
i p j q i j
i j
S u v N u N v
P
, , , 1 1( ) ( ) [ , ) [ , )i j i p j q i i p j j qN u N v u u v v P
![Page 62: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/62.jpg)
![Page 63: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/63.jpg)
Some extensions of NURBS curve and surface
• Free form deformation (FFD)
• Subdivision surface
![Page 64: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/64.jpg)
Free deformation of parametric curve and
surface (FFD)
• 1D curve
• 2D surface
• 3D solid
,
0
( ) ( )n
i p i
i
C u N u
P
1
1 1
11
{0, ,0, , , ,1, ,1}
m
p m p
pp
U u u
![Page 65: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/65.jpg)
Free deformation of parametric curve
and surface (FFD)
• 1D curve
• 2D surface
• 3D solid
, , ,
0 0
( , ) ( ) ( )n m
i p j q i j
i j
S u v N u N v
P
1
1 1
11
1
1 1
11
{0, ,0, , , ,1, ,1}
{0, ,0, , , ,1, ,1}
r
p r p
pp
s
q s q
U u u
V u u
![Page 66: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/66.jpg)
Free deformation of parametric curve and
surface (FFD)
• 1D curve
• 2D surface
• 3D solid
1
1 1
11
1
1 1
11
1
1 1
11
{0, ,0, , , ,1, ,1}
{0, ,0, , , ,1, ,1}
{0, ,0, , , ,1, ,1}
o
p r p
pp
s
q s q
t
r t r
rr
U u u
V u u
W u u
, , , , ,
0 0 0
( , , ) ( ) ( ) ( )n m l
i p j q k r i j k
i j k
S u v w N u N v N v
P
![Page 67: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/67.jpg)
![Page 68: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/68.jpg)
![Page 69: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/69.jpg)
![Page 70: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/70.jpg)
Free deformation of parametric curve
and surface (FFD)
•1D curve
•2D surface
•3D solid
•Further expansion?
![Page 71: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/71.jpg)
![Page 72: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/72.jpg)
Free deformation of parametric curve
and surface (FFD)
•1D curve
•2D surface
•3D solid
•Further expansion?
![Page 73: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/73.jpg)
Extended Free Form Deformation
![Page 74: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/74.jpg)
![Page 75: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/75.jpg)
![Page 76: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/76.jpg)
![Page 77: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/77.jpg)
![Page 78: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/78.jpg)
Selective Course Project 6
Try to program the following shape
using GDI+:
![Page 79: Fundamentals of Computer Graphics Lecture 3 Parametric ... · Cn curve continuity •Differentiability of function:if combined parametric curve has continuous derivative until n](https://reader033.vdocuments.net/reader033/viewer/2022050311/5f72f8d68557ce2aea5f3756/html5/thumbnails/79.jpg)
Tips: The following code constructs a complicated region using two spline curves
using namespace Gdiplus; Graphics graphics( pDC->m_hDC ); Pen pen(Color::Blue, 3); Point point1( 50, 200); Point point2(100, 150); Point point3(160, 180); Point point4(200, 200); Point point5(230, 150); Point point6(220, 50); Point point7(190, 70); Point point8(130, 220); Point curvePoints[8] = {point1, point2, point3, point4, point5, point6, point7, point8}; Point* pcurvePoints = curvePoints; GraphicsPath path; path.AddClosedCurve(curvePoints, 8, 0.5); PathGradientBrush pthGrBrush(&path); pthGrBrush.SetCenterColor(Color(255, 0, 0, 255)); Color colors[] = {Color(0, 0, 0, 255)}; INT count = 1; pthGrBrush.SetSurroundColors(colors, &count); graphics.DrawClosedCurve(&pen, curvePoints, 8, 0.5); graphics.FillPath(&pthGrBrush, &path);