計(jì)算機(jī)圖形學(xué)基礎(chǔ):第五講 Geometric representations (Chap 3-1)_第1頁(yè)
計(jì)算機(jī)圖形學(xué)基礎(chǔ):第五講 Geometric representations (Chap 3-1)_第2頁(yè)
計(jì)算機(jī)圖形學(xué)基礎(chǔ):第五講 Geometric representations (Chap 3-1)_第3頁(yè)
計(jì)算機(jī)圖形學(xué)基礎(chǔ):第五講 Geometric representations (Chap 3-1)_第4頁(yè)
計(jì)算機(jī)圖形學(xué)基礎(chǔ):第五講 Geometric representations (Chap 3-1)_第5頁(yè)
已閱讀5頁(yè),還剩64頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、Chap 3 Geometric Representations (3) (幾何表示)Li GuiqingSouth China University of Technology2AgendaParametric curves and surfaces (參數(shù)曲線曲面)Simple parametric curves and surfaces Parametric curves in CAGDParametric surfaces in CAGD3AgendaParametric representation of curves and surfacesWhat are parametric

2、representations Bezier curves and surfacesB-spline curves and surfaces4Line segment: P0(x0, y0, z0)P1(x1, y1, z1) Parametric representation (參數(shù)表示)Coordinate components (分量表示)Parametric domain(參數(shù)域)0,1:What are parametric curves: Line segment (直線段) 5(Cont.) Geometric meaning (幾何意義)Mapping from domain

3、to line segment (映射)Endpoints correspond.(端點(diǎn)對(duì)應(yīng)) 6General form (一般形式)Mapping: t R(t)(參數(shù)域曲線上點(diǎn)) In CG, the domain is a finite interval (參數(shù)域有限區(qū)間parametric curve segment (參數(shù)曲線段) In CG: (piecewise分段) (rational有理) polynomials(即x(t),y(t),z(t)是(分段)(有理)多項(xiàng)式) (Cont.) General parametric curves7Bilinear quadrilat

4、eral patches (雙線性四邊形曲面片)Parametric expression(表達(dá)式) (u,v)0,10,1 Four points P0、P1、P2 and P3 four corners of the surface: R(0,0)、R(1,0)、R(1,0) and R(0,1) p0p1p2p38Geometric meaning(幾何意義)Bilinear quadrilateral patch(雙線性四邊形曲面片)9General form (參數(shù)曲面的One-to-one mapping: (u, v)R(u,v) (一一映射)A finite parametri

5、c domain, e.g. a rectangle, defines a surface patch (有限的參數(shù)域)Functions are generally (rational) polynomials in CG (圖形學(xué)中一般用多項(xiàng)式函數(shù))What are parametric surfaces:general surfaces (參數(shù)曲面一般形式)一般形式)10Advantages of Parametric Representation (參數(shù)表示的優(yōu)點(diǎn))Explicit representation (參數(shù)表示是顯式的)Easy to compute position fo

6、r given point in parametric domain (易于計(jì)算曲面上點(diǎn)的幾何屬性)Easy to convert to polygonal meshes (易于網(wǎng)格化)11Advantages of Parametric RepresentationEasy to compute geometric attributes: (微分幾何:法向、曲率、測(cè)地線、曲率線等)Pseudo-color visualization of mean curvature(平均曲率偽彩繪制)12Advantages of Parametric RepresentationEasy to cont

7、rol the shape of the surfaces ? Bzier、B-樣條、NURBS (Non-Uniform Rational B-Spline, 非均勻有理B-樣條)曲線/曲面Mesh shape editing needs to solve large scale optimization13Agenda Parametric surfacesWhat are parametric representationsParametric curvesBzier curves(曲線)B-spline (B樣條曲線)NURBS(非均勻有理B樣條曲線)Parametric surfac

8、esApplications14FontsPath planningShape design15Bzier曲線Bzier曲線給定四個(gè)點(diǎn)16Bzier曲線Pierre Bzier (1910-1999) in Renault : control polygon(控制多邊形). :Bzier 系數(shù), 是3D點(diǎn). R(t): 3D向量函數(shù)17A Bzier curve of degree n is defined asDefinition of Bzier curves(曲線定義) Base functions(基函數(shù)): Bi,n(t) (或blending function):18Bzier曲線

9、性質(zhì)Endpoint interpolation端點(diǎn)插值:R(0)=R0 R(1)=Rn三次Bzier曲線Tangent at endpoints(切向)R(0)=n(R1R0)R(1)=n(RnRn-1) Symmetry (對(duì)稱(chēng)性)iRn-iBi,n(t) = iRiBi,n(t)(曲線關(guān)于控制多邊形是對(duì)稱(chēng)的)Bzier Matrix (Bezier曲線的矩陣表示)Cubic Bezier curves are most popular Matrix form of general Bezier curves is Q(t) = tTMBP (MB is the Bzier matrix)

10、MBtTP Blending functions(混合(或基)函數(shù)) 表達(dá)式 基函數(shù)的幾何形狀2021Properties of Bzier curves (性質(zhì))Convexity (凸包性):Bzier curve is enveloped by the convex hull of its control polygonBzier曲線的凸包性Geometric invariant (幾何不變性), or affine invariant (仿射不變性) P0P1P2P3P0P1P2P322Some examples (例子)23Bzier曲線細(xì)分性質(zhì)Illustration of Cub

11、ic Bzier curve subdivision subdivision algorithm of Bzier curve of degree n(Bzier曲線細(xì)分算法)Reference:http:/wiki/B%C3%A9zier_curve24Bzier曲線的細(xì)分性質(zhì)The curve is split into two(一段分為兩段):The control polygon approximates the curve with the increasing of subdivision depth (控制多邊形越來(lái)越逼近曲線本身)It can be used to render

12、 the curve(繪制多邊形)25Disadvantage of Bzier curvesGlobal property(全局性):the whole shape will change when a control point movesFor complex shapes, we need to stitch multiple Bezier curves (復(fù)雜形狀需拼接)Position continuity(位置連續(xù)):C0(或G0)Smoothness: n次導(dǎo)數(shù)Cn(或幾何Gn)連續(xù)26AgendaParametric curves and surfaces參數(shù)表示的數(shù)學(xué)原理P

13、arametric curves(參數(shù)曲線)Bzier曲線B-spline (B樣條曲線)NURBS曲線參數(shù)曲面歷史27A Duck (weight)Ducks trace out curve28B-spline: example(樣條曲線實(shí)列)B-spline of degree 3(order 4) (三次(四階)B樣條曲線) R0R1R2R3R4R5R6R729Definition of B-splines(B樣條曲線定義) B-spline curve is piecewise polynomial curve (分段多項(xiàng)式曲線) Given knot vector(節(jié)點(diǎn)向量) u=u

14、0, u1, , ui, , un+k+1 A B-spline of degree k (order k+1) with (n+1) control points is defined as 分段多項(xiàng)式K次或k+1階B樣條30Definition of basis of B-splinesRi: control points,Rii=0,1,n: control polygonNi,k(u) are basis of B-spline: 遞歸關(guān)系3132Bases satisfy normalizationn=3 (4個(gè)控制頂點(diǎn))k=3 三次(四階)曲線u=0 0 0 1 2 2 2 2在

15、u = 0.6 處,基函數(shù)的和為:N0,3+N1,3+N2,3+N3,3 =0.16+0.66+0.18+0.0= 1.0 uN0,3N1,3N2,3N3,3Periodic uniform knot (周期均勻B樣條)Periodic knots are determined fromUi = i (0 i n+k)The basis splines over the full domain of uExampleCurve with degree 3 and 4 control points (cubic B-spline)(k = 3, n = 3) number of knots =

16、8(0, 1, 2, 3, 4, 5, 6, 7)Normalize u (0 u 1,規(guī)范化參數(shù)域)N0,3(u) = 1/6 (1-u)3N1,3(u) = 1/6 (3u 3 6u 2 +4)N2,3(u) = 1/6 (-3u 3 + 3u 2 + 3u +1)N3,3(u) = 1/6 u3Periodic uniform knot參數(shù)曲線 R(u) = N0,4(u)R0 + N1,4(u)R1 + N2,4(u)R2 + N3,4(u)R3 In matrix form (矩陣表示)Periodic uniform cubic spline: MatrixPeriodic uni

17、form knotP0Closed periodicP0P1P2P3P4P5Examplek = 4, n = 538Properties of B-splines (性質(zhì))B-spline satisfies convex hull property and geometric invariant propertyMore strict than Bezier curvesQuadratic B-spline (二次B樣條)closure39Open B-splines(非周期均勻B樣條)節(jié)點(diǎn)向量在端點(diǎn)處重復(fù)k+1次For n=k+1,the B-spline degenerates to

18、a Bzier curveB樣條曲線會(huì)插值端點(diǎn)端點(diǎn)處切向量與邊一致40(Continued)Local property:(當(dāng)移動(dòng)一個(gè)控制頂點(diǎn)時(shí),只影響曲線的局部區(qū)域)Local property of B-spline of degree 341Agenda (omitted)參數(shù)曲面表示參數(shù)表示的數(shù)學(xué)原理參數(shù)曲線Bzier曲線B-樣條曲線NURBS曲線參數(shù)曲面42引入NURBS曲線的原因B-樣條情形不能精確表示二次曲面與平面的交線,如圓錐曲線(平面與圓錐的交線)拋物線橢圓(上)與圓(下)雙曲線43NURBS (Non-Uniform Rational B-Spline):非均勻有理B-樣條

19、的簡(jiǎn)稱(chēng)定義:NURBS曲線 44NURBS曲線Ni,k(u)為單位化的B-樣條基函數(shù)Ri為控制頂點(diǎn)NURBS曲線新增加的曲線控制手段是權(quán)因子i ,首末兩個(gè)權(quán)因子00、n0 其余的權(quán)因子滿足i045NURBS曲線的權(quán)因子每一個(gè)權(quán)因子對(duì)應(yīng)于一個(gè)控制頂點(diǎn)調(diào)整權(quán)因子的大小可以調(diào)整曲線的形狀。當(dāng)所有的權(quán)因子i=1時(shí),就是B-樣條曲線;當(dāng)某個(gè)權(quán)因子i=0時(shí),對(duì)應(yīng)的控制頂點(diǎn)對(duì)曲線的形狀沒(méi)有影響當(dāng)i時(shí),曲線R(u) Ri ,即曲線過(guò)點(diǎn)Ri 46NURBS曲線的例子NURBS曲線權(quán)因子對(duì)曲線形狀的影響47NURBS曲線表示圓用三個(gè)120圓弧表示圓:u=0 0 0 1 1 2 2 3 3 3k = 3i = 1,

20、 , 1 , , 1, , 1控制頂點(diǎn)分布如右圖所示NURBS曲線表示圓R0R6R1R2R3R4R548AgendaParametric curves and surfaces參數(shù)表示的數(shù)學(xué)原理參數(shù)曲線Parametric surfacesBzier surfacesB-樣條曲面NURBS曲面49Bicubic Bzier surfaces(雙三次)雙三次Bzier曲面實(shí)例50mn次Bzier曲面:Bi,m(u) & Bj,n(v) are Bernstein bases (基函數(shù)) Rij form a grid mesh規(guī)則連接形成控制網(wǎng) Bzier曲面uvm col. n row51Pr

21、operties of Bzier surfacesThe control mesh constrains the coarse shape of Bzier surfaces 52ContinuedInterpolation (插值) of four corner vertices: 53ContinuedTangents at four corner vertices Subdivision of Bzier surfaces:用加密的控制網(wǎng)格來(lái)逼近Bzier曲面 Rendering of Bzier surfaces(曲面繪制)Vector3D P=,; / Control meshMy

22、BezSurfDisplay() ;float step = 0.01; glBegin(GL_QUADS); for (u = 0; u 1; u+=step) for (v = 0; v1; v+= step) ver0 = Bezier(u,v); ver1 = Bezier(u+step, v); ver2 = Bezier(u+step,v+step); ver1 = Bezier(u,v+step); 計(jì)算上述4個(gè)點(diǎn)的法向n0,n1,n2,n3; glNormal3fv(n0); glVertex3fv(v0); glNormal3fv(n1); glVertex3fv(v1);

23、glNormal3fv(n2); glVertex3fv(v2); glNormal3fv(n3); glVertex3fv(v3); glEnd(); ; 5455Drawbacks of Bzier surfacesGlobal property:It is not convenient for editing based control vertex change(全局性)It is difficult to smoothly merge multiple Bezier patches (光滑地拼接:困難)56內(nèi)容參數(shù)曲面表示參數(shù)表示的數(shù)學(xué)原理參數(shù)曲線參數(shù)曲面Bzier曲面B-樣條曲面N

24、URBS曲面57Definition of B-spline surfacesB-spline surfaces (B樣條曲面)Degree:ku + kvNumber of control points(控制頂點(diǎn)數(shù)): (nu+1) (nv+1) Knot vectors(節(jié)點(diǎn)向量) 58B-spline surfaces (B樣條曲面)Rij: control point set Ni,ku(u) and Ni,kv(v) B-spline basis defined in knot vectors respectively The surface (定義成張量積)59Properties of B-spline surfacesLocal property(局部控制)The number of control points (控制頂點(diǎn)數(shù))Can be arbitrary for B-spline surfaces of fixed degree(次數(shù)確定,控制頂點(diǎn)數(shù)可任意)(Bzier曲面的次數(shù)確定后,控制頂點(diǎn)數(shù)目就定了)Other properties: see properties of B-spline curves(其性質(zhì)與曲線類(lèi)似)60B-spline surfaces: examples具有66個(gè)控制頂點(diǎn)雙三

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論