資源描述:
《計算機圖形學(xué)教學(xué)ppt課件.ppt》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、ClippinginarasterworldCanbedoneAnalyticallyOntheflyduringscanconversionAspartofacopyPixelfromacanvasstoringunclippedprimitivestothedestinationcanvasBedoneasrapidlyaspossible!9/18/2021preparation9/18/2021vectorsDefinition:9/18/2021Cont.矢量的模長(VectorMode
2、)矢量的方向角非零矢量與三個坐標(biāo)軸的夾角稱為該矢量的方向角矢量的單位化9/18/2021Cont.矢量的方向余弦:非零矢量的方向角的余弦稱為該矢量的方向余弦9/18/2021Cont.兩矢量的夾角9/18/2021Cont.兩矢量的數(shù)積(點積)(VectorDotMetrix)9/18/2021Cont.兩矢量的矢積(叉積)(VectorProduct)9/18/2021Cont.9/18/2021Parametricequationsoflines(a,b)9/18/2021Cont.9/18/
3、2021ClippingissueDistinguishingtheinterior/exteriorpartofprimitivesagainstclipwindowsDecisiontheinterior/exteriorpartPrimitivesinteractingclipwindowsClipwindows:rectanglesXY9/18/2021裁剪的實質(zhì):就是決定圖形中哪些點、線段、文字、以及多邊形在窗口之內(nèi).裁剪的基本方法:將圖形元素(如線段)與窗口邊界求交點,交點連接起來在窗
4、口內(nèi)的部分就是裁剪后的顯示圖形(即求交).2DCLIPPING9/18/2021CLIPPING??EF????????????GIJHDCBAD’G’H’J’I’??EF?Cliprectangle(a)??????????GIJHDCBAJ’I’G’??H’?D’(b)Casesforclippinglines.9/18/2021Clippingendpoints(x,y)necessaryandsufficientconditiononwhichaendpoint(x,y)isinwindo
5、w:9/18/2021ytxlxryb21345CLIPPINGLINES9/18/2021Line-ClippingAlgorithmsClippingLinesbySolvingSimultaneousEquationsTheCohen—SutherlandLine-ClippingAlgorithm中點分割法Nicholl-Lee-NillconLine-ClippingAlgorithmTheLiang-Barskyalgorithm9/18/2021Cohen-SutherlandLin
6、e-ClippingAlgorithmFirst,endpointpairsarecheckedfortrivialacceptance(顯然完全可見).Ifthelinecannotbetriviallyaccepted,trivialrejection(顯然完全不可見)aredone9/18/2021Second,endpointpairsarecheckedfortrivialrejection.Wecantriviallyrejectlineswithbothendpointsinregi
7、onstotheleftofxmin,rightofxmax,belowymin,andaboveymax.Ifthelinecannotbetriviallyrejected,regionchecks(區(qū)域檢測)aredoneCohen—SutherlandLine-ClippingAlgorithm9/18/2021Ifthelinesegmentcanbeneithertriviallyacceptednorrejected,itisdividedintotwosegmentsataclip
8、edge,sothatonesegmentcanbetriviallyrejected.Asegmentisiterativelyclippedbytestingfortrivialacceptanceorrejection,andisthensubdividedifneithertestissuccessful,untilwhatremainsiscompletelyinsidethecliprectangleorcanbetriviallyrejected.Cohen—Suth