资料案例介绍_第1页
资料案例介绍_第2页
资料案例介绍_第3页
资料案例介绍_第4页
资料案例介绍_第5页
已阅读5页,还剩93页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

SE-341Computer(SpringSE-341Computer(Spring&hidden-••••HiddenSurface•Clippingof•ClippingofprimitivesisdoneusuallyscanconvertingtheprimitivesReasonsbeingscanconversionneedstodealonlywiththeversionoftheprimitive,whichmightbemuchsmallerthanitsunclippedversionPrimitivesareusuallydefinedintherealworld,theirmappingfromtherealtotheintegerdomainofthedisplaymightresultintheoverflowingoftheintegervaluesresultinginunnecessary•HowwouldweHowwouldwe••••2D3DClippingiseasyforLineandPolygonsClippingishardforcurveandText–Theycanbetransformedto2D2DClipping2D2DClipping2D2DClippingSegment-Segment-IntersectionIntersectionwithaxis-aligned2DClipping2DClipping•••••Sutherland-Cohen裁剪:编中点分割裁剪:除以2,移位运参数化裁剪与梁友栋-Barsky裁剪:高效率的裁Nicholl-Lee-Nicholl裁剪:更为精细的判(outcode1OR(outcode1ORoutcode2)==linesegmentis(outcode1ANDoutcode2)!=linesegmentistotally(outcode1ANDoutcode2)==linesegmentpotentiallycrossesclipFalseSomelinesegmentsthatareclassifiedascrossingtheclipregionactuallyCheckLineCheckLineIfP1P2iscompletelyinside,acceptit;ifP1P2isoutside,rejectit;otherwisegotostepFindanendpointP1(orP2)oflineP1P2outsideofFindtheintersectionpointP’1toreplaceP1(orIfP1P2iscompletelyinside,thenacceptthisline,elsetostep3D3DPipelinePipelinesystemofLinePolygonPolygonPolygonPolygonPolygonPolygonBoundingBoundingBoundingBounding••••HiddenSurfaceWhyeliminatinginvisibleWhyeliminatinginvisible••VisibleandinvisibleportionsofEnhancereality(增加图形的真实感Projectionÿ3Dspace2D2Dspaceÿsortingaccordingtodepthmayadd3DWhyeliminatinginvisibleWhyeliminatinginvisibleHiddensurfaceremoval(HSR)mayBC(a)CubeBisthenearestĀ(c)CtheVisibleSurfaceVisibleSurfaceGiven:asetof3DobjectsandViewing Determine:thosepartsoftheobjectsthatarevisiblewhenviewedalongthedirectionofprojection.Orequivalently,eliminationofhiddenparts(hiddenlinesandsurfaces)Visiblepartswillbedrawn/shownwithpropercolorsandshads.•••Hiddensurface•ImageHiddensurface•ImageSpaceMethodÿ图像空间 Workonper-pixel/peroffragmentafterscanMuchfaster,butresolutionZ-Buffer/DepthObjectSpaceMethodÿ对象空间Workin3DbeforescanUsuallyindependentofImportanttomaintainindependenceofoutputdevice(screen/printeretc.)FrameworkofFrameworkofHSRinimagefor(Eachpixelintheimage)connectthepixelandtheviewpointfindthenearestobjectĀcomputethecolorforthe}•Theimageis•Theimageisconstrainedbyresolutionofdisplaydevices受分辨率限制)ComplexityO(nN)ÿObjectsshouldbesortedforeachpixelusen:thenumberofprimitivesN:thenumberofAlgorithmsÿz-buffer,scanline••FrameworkofHSRinFrameworkofHSRinobjectfor(eachobjectinworldcoordinate{determinethosepartsoftheobjectviewisunobstructedbyotherpartsofitoranyotherobject;drawthosepartsintheappropriate}•Highresolution•Highresolution (适合于精密的CAD工程领域•ComplexityEachobjectshouldbecomparedwiththeothern:objectBacksurface••理论–如n(物体数•理论–如n(物体数)<N(像素数,则对象空间算法的计O(n2)小于图像空间算法对象空间和图像空间的混合消隐••Hiddensurface•ImageHiddensurface•ImageSpaceZ-Buffer/DepthObjectSpaceZ-bufferZ-bufferZ-bufferFrame-buffer:Z-bufferFrame-buffer:storethecolorofZ-bufferÿstorez-coordinatesofViewingsystem(oxyzprojectionplanez=0;viewingdirection(0,0,-1);orthogonalprojection(平行投影)Depthvalueofapointisitsz-Thelargerofthez-valuetheshorterofthedistancetotheviewpoint(z越大离视点越近)•DepthColorDepthColorOutlineofz-Initializecolor(frame)-bufferOutlineofz-Initializecolor(frame)-bufferbackgroundInitializez-buffer视点最远的z以任意顺序扫描各多a)对于多边形中的每一像素,计算其深度值比较z(x,y)与z缓冲器中已有的值如果z(x,y)zbuffer(x,y)计算该像素y)的光亮值属性并写入帧缓更新zzbuffer(x,Z-BufferZ-BufferZ-BufferZ-BufferZ-BufferZ-BufferObjectObjectSpaceBackBackfaceBackface•LetBackface•LetVbetheviewingdirectionfromthetothecamera;nthenormalofthefacetobe––BackBackface•Only•Onlyapplicabletoconvex•Only•OnlyapplicabletoconvexPainter’sPainter’sForFor2DForFor2DForFor2DPainter’sPainter’sWhatPainter’sPainter’sWhatPainter’sPainter’sBinaryBinarySpacePartitioningBinaryBinarySpacePartitionCreatingCreatingBSPTrees:CreatingCreatingBSPTrees:CreatingCreatingBSPTrees:CreatingCreatingBSPTrees:CreatingCreatingBSPTrees:SplittingSplittingBSP-Trees:BSP-Trees:ViewpointBSP-Trees:BSP-Trees:ViewpointBSP-Trees:BSP-Trees:ViewpointBSP-Trees:BSP-Trees:ViewpointBSP-Trees:BSP-Trees:ViewpointBSP-Trees:BSP-Trees:ViewpointBSP-Trees:BSP-Trees:ViewpointBSP-Trees:BSP-Trees:ViewpointBSP-Trees:BSP-Trees:ViewpointBSP-Trees:BSP-

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论