You are on page 1of 9

8/9/2016

ParametricCurves

ParametricCurves
Curvesandsurfacescanhaveexplicit,implicit,andparametricrepresentations.Parametricrepresentationsare
themostcommonincomputergraphics.
Reparameterization
Parameterizationsareingeneralnotunique.Considerthefollowingparameterizationsforaline:
L(P0,P1)=P0+u(P1P0),u=[0...1]
L(P0,P1)=v(P1P0)/2+(P1+P0)/2,v=[1...1]

Parameterizationscanbechangedtoliebetweendesiredbounds.Toreparameterizefromu=[a...b]tow=
[0...1],wecanusew=(ua)/(ba),whichgivesu=w(ba)+a.Thus,wehave:
P(u),u=[a...b]=P(w(ba)+a),w=[0...1]

ParametricCubicCurves
Cubiccurvesarecommonlyusedingraphicsbecausecurvesoflowerordercommonlyhavetoolittleflexibility,
whilecurvesofhigherorderareusuallyconsideredunnecessarilycomplexandmakeiteasytointroduce
undesiredwiggles.
Aparametriccubiccurvein3Disdefinedby:

Usually,weconsidert=[0...1].

Acompactversionoftheparametricequationscanbewrittenasfollows:

https://www.cs.helsinki.fi/group/goa/mallinnus/curves/curves.html

1/9

8/9/2016

ParametricCurves

Similarly,wecanwrite
y(t)=TB
z(t)=TC

Eachdimensionistreatedindependently,sowecandealwithcurvesinanynumberofdimensions.
Thederivativesofthecurvewithrespecttotcanbeexpressedasfollows:
x'(t)=[3t^22t10]A

Itisoftenconvenienttothinkoftheparametertasbeingtimeinordertovisualizesomeofthepropertiesofthe
curve.Thederivativesalsohaveanintuitiveinterpretationinthecartesianspaceofthecurve:

AFirstExample
Supposewewishtodefineacubiccurvesuchthattheuserspecifiesthepositionoftwoendpointsanda
midpoint,aswellasthetangentatthemidpoint.Thefollowingfigureillustratessomesamplecurves.

We'llfirstconstructthecubiccurveforx(t).Therearefourconstraintsthataretobemetandfourunknowns:

https://www.cs.helsinki.fi/group/goa/mallinnus/curves/curves.html

2/9

8/9/2016

ParametricCurves

WecansolveforAusingA=B_invG_x.Thefinalequationforxisthus:
x(t)=TB_invG_x

ThematrixB_invisoftencalledthebasismatrix,whichweshalldenotebyM.Wecanthuswrite
x(t)=TMG_x

Inthiscase,wehave
[4044]
M=[8464]
[5421]
[1000]

Lastly,wecanalsowrite
x(t)=[f1(t)f2(t)f3(t)f4(t)]G_x

wheref1(t)...f4(t)arethefunctionsobtainedfromtheproductTM.Thesearefunctionsarecalledtheblending
orbasisfunctions,becausetheyservetogiveaweightingtothevariouscomponentsofthegeometryvector,G.
Inthiscase,theseare
f1(t)=4t^3+8t^25t+1
f2(t)=4t^2+4t
f3(t)=4t^3+6t^22t
f4(t)=4t^34t^2+1,

wheref1(t)istheweightingfunctionforP0,f2(t)istheweightingfunctionforP0.5,f3(t)istheweighting
functionforT0.5,andf4(t)istheweightingfunctionforP1.Thesebasisfunctionslookasfollows:

https://www.cs.helsinki.fi/group/goa/mallinnus/curves/curves.html

3/9

8/9/2016

ParametricCurves

Thecurvesfory(t)andz(t)arecontructedinananalogousfashiontothatforx(t).Thebasismatrixandbasis
functionsthusremainthesame.Onlythegeometryvectorchanges.Thegeometryvectorfory(t)givesthey
componentsofP0,P0.5,T0.5,andP1.Ingeneral,wecanwritethecurveasasinglevectorequation
P(t)=TMG

whichencompassesthefollowingthreeequations:
x(t)=TMG_x
y(t)=TMG_y
z(t)=TMG_z

HermiteCurves
Asasecondexample,let'slookatHermitecurves.Hermitecurvesaredefinedbytwopointsandtwotangent
vectors.

Let'sderivetheequationforHermitecurvesusingthefollowinggeometryvector:
G_h=[P1P4R1R4]^T

Asbefore,we'llexpressthecurveas:
x(t)=TA_h
=TM_hG_h

Theconstraintswe'llusetodefinethecurveare:
x(0)=P1=[0001]A_h
x(1)=P4=[1111]A_h
x'(0)=R1=[0010]A_h
x'(1)=R4=[3210]A_h

Writingtheseconstraintsinmatrixformgives:
G_h=B_hA_h
A_h=inv(B_h)G_h
x(t)=TA_h
=Tinv(B_h)G_h
=TM_hG_h

TheinverseofB_histhusdefinedasthebasismatrixforthehermitecurve.
[2211]
M_h=[3321]
[0010]
[1000]

Asbefore,thebasisfunctionsaretheweightingfactorsforthetermsinthegeometryvector,andaregivenby
theproductTM_h.Thus,forbasisfunctionsforHermitecurvesare
f1(t)=2t^33t^2+1
f2(t)=2t^3+3t^2
f3(t)=t^32t^2+t
f4(t)=t^3t^2
https://www.cs.helsinki.fi/group/goa/mallinnus/curves/curves.html

4/9

8/9/2016

ParametricCurves

Thesebasisfunctionslookasfollows:

BezierCurves
BeziercurvesareavariationoftheHermitecurves.Theyarespecifiedbyfourpoints:

ThecurveiscloselyrelatedtotheHermitecurve:
P1_h=P1
P4_h=P4
R1_h=3(P2P1)
R4_h=3(P4P3)

We'llarriveatthebasismatrixbyexpressingtheaboveinmatrixform:
[P1_h][1000][P1]
[P4_h]=[0001][P2]
[R1_h][3300][P3]
[R4_h][0033][P4]
P_h=M_bhP_b

Theequationforabeziercurvecanthusbewrittenas:
P(t)=TM_hM_bhP_b
P(t)=TM_bP_b

where
[1331]
M_b=[3630]
[3300]
[1000]

TheBezierbasisfunctionsareasfollows:
P(t)=TM_bG_b
=f1(t)P1+f2(t)P2+f3(t)P3+f4(t)P4
where
f1(t)=t^3+3t^23t+1
https://www.cs.helsinki.fi/group/goa/mallinnus/curves/curves.html

5/9

8/9/2016

ParametricCurves

f2(t)=3t^36t^2+3t
f3(t)=3t^3+3t^2
f4(t)=t^3
oralternatively,
f1(t)=(1t)^3
f2(t)=3t(1t)^2
f3(t)=3t^2(1t)
f4(t)=t^3

Convexhullproperty

Theconvexhullpropertyensuresthatthecurvewillneverpassoutsideoftheconvexhullformedbythefour
controlvertices.Assuch,itlendsameasureofpredictabilitytothecurve.TheBezierbasisfunctionssatisfythe
conditionsnecessaryfortheconvexhullproperty,namely:
0<=fi(t)<=1fortin[0,1].
f1(t)+...+fn(t)=1

BezierCurvesofdegreen
ItisnotperchancethatthebasisfunctionsforBeziercurveshavetheconvexhullproperty.Howmightonethen
goaboutdesigningasetofbasisfunctionsthatsumtooneandensurethateachindividualbasisfunctionremain
intherange[0,1]?TheBernsteinpolynomialshaveexactlytherequiredproperties.
UsingtheBernsteinnpolynomials,wecanconstructaBeziercurveofarbitrarydegree.Forcurvesofhigher
degreethanthecubicBeziercurvediscussedthusfar,we'llneedmorethanfourcontrolpoints.Thegeneral
Beziercurveofdegreenisgivenby

Thebasisfunctionsareequivalenttothetermsarisingfromtheexpansionof
usingthebinomialexpansiontheorem.Itisalsoobviousfromthiswhythesumofallthetermsisequaltoone.

PiecewiseHermiteandBezierCurves
https://www.cs.helsinki.fi/group/goa/mallinnus/curves/curves.html

6/9

8/9/2016

ParametricCurves

Hermitecurvesegmentscanbeconnectedinacontinuousfashionbyensuringthattheendpointofonecurveis
thesameasthestartingpointofanother,aswellasensuringthatthetangentvectorsforthispointhavethesame
direction.

Intermsoftheabovefigure,thismeansP1'=P4,R1'=kR4.ForaBeziercurve,theconditionsarethatthethe
lasttwopointsofonecurveandthefirsttwopointsofthesecondcurvearealigned.

GeometricandParametricContinuity
GeometricContinuity
G0:curvesarejoined
G1:firstderivativesareproportionalatthejoinpoint
Thecurvetangentsthushavethesamedirection,butnotnecessarilythesamemagnitude.i.e.,C1'(1)=
(a,b,c)andC2'(0)=(k*a,k*b,k*c).
G2:firstandsecondderivativesareproportionalatjoinpoint
ParametricContinuity
C0:curvesarejoined
C1:firstderivativesequal
C2:firstandsecondderivativesareequal
Iftistakentobetime,thisimpliesthattheaccelerationiscontinuous.
Cn:nthderivativesareequal
Astheirnamesimply,geometriccontinuityrequiresthegeometrytobecontinuous,whileparametriccontinuity
requiresthattheunderlyingparameterizationbecontinuousaswell.
Parametriccontinuityofordernimpliesgeometriccontinuityofordern,butnotviceversa.

SummaryofBezierandHermiteCurves
offerlocalcontrol
offerC1continuity
interpolates(some)controlpoints

Splines
splinesarecubiccurveswhichmaintainC2continuity.
naturalspline
interpolatesallofitscontrolpoints.
equivalenttoathinstripofmetalforcedtopassthroughcontrolpoints
nolocalcontrol
Bspline
localcontrol
doesnotinterpolatecontrolpoints
https://www.cs.helsinki.fi/group/goa/mallinnus/curves/curves.html

7/9

8/9/2016

ParametricCurves

ThefollowingisanexampleofafivesegmentBsplinecurve(althoughthisissimplyahanddrawnexample).
Thepointswhichindicatetheendsoftheindividualcurvesegmentsandthusthejoinpointsareknownasthe
knots.

Eachcurvesegmentisdeterminedbyfourcontrolpoints,asfollows:

Bsplinecurvesaredefinedbyabasismatrix,justliketheothertypesofcubiccurves.Weshallnotdiscussthe
derivationofthismatrixhere.
[1331]
M_bspline=1/6[3630]
[3030]
[1410]

wherethegeometryvectorconsistsoffourconsecutivecontrolpoints.ItiseasytoshowthatBsplinecurvesare
C2continuousandthattheysatisfytheconvexhullproperty.ThebasisfunctionsforBsplinesareasfollows:

Multipleknots

Controlverticescanberepeatedinordertoallowforreducedgeometriccontinuityatthejoinpoints.
multiplicity
https://www.cs.helsinki.fi/group/goa/mallinnus/curves/curves.html

8/9

8/9/2016

1
2
3

ParametricCurves

G2continuous
G1continuous
G0continuous,interpolatespoint

NURBS:NonuniformRationalBsplines
Oneofthedisadvantagesofthecurvesdiscussedtodateisthattheycannotbeusedtocreatecommonconic
shapessuchascircles,ellipses,parabolas,etc.Thiscanbedoneusingrationalcubiccurves,however.Arational
cubiccurvesegmentin3Dcanbeconstructedasfollows
x(t)=X(t)/W(t)
y(t)=Y(t)/W(t)
z(t)=Z(t)/W(t)

whereeachofX(t),Y(t),Z(t),andW(t)arecubicpolynomialcurves.Definingcurvesasrationalpolynomialsin
thismannerallowsforsimpleexactrepresenationsofconicsectionssuchascircles,aswellascurveswhichare
invariantunderperspectiveprojection.
FromUniversityofTorontoSeedeatails

https://www.cs.helsinki.fi/group/goa/mallinnus/curves/curves.html

9/9

You might also like