- 1、本文档共82页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Lecture05-Clipping 计算机图形学ppt课件
Cohen-Sutherland Line Clipping Algorithm: if (code0 == code1 == 0000) accept the line if ((code0 code1 ) != 0) reject the line Clip the line against an edge (where both bits are nonzero) Assign the new vertex a 4-bit value Return to 1 Recursive Subdivision Clipping Recursive Subdivision Clipping Recursive Subdivision Level 1 Recursive Subdivision Level 2 Recursive Subdivision Level 3 Recursive Subdivision Level 3 Recursive Subdivision Level 3 Recursive Subdivision Level 3 Recursive Subdivision Level 3 Recursive Subdivision Clipping Accurate to 3 Binary Digits Liang-Barsky Line Clipping Consider the parametric definition of a line: x = x1 + u?x y = y1 + u?y ?x = (x2 - x1), ?y = (y2 - y1), 0 ≤ (u, v) ≤ 1 What if we could find the range for u and v in which both x and y are inside the viewport? Liang-Barsky Line Clipping Mathematically, this means xmin ≤ x1 + u?x ≤ xmax ymin ≤ y1 + u?y ≤ ymax Rearranging, we get -u?x ≤ (x1 - xmin) u?x ≤ (xmax - x1) -v?y ≤ (y1 - ymin) v?y ≤ (ymax - y1) In general: u * pk ≤ qk Liang-Barsky Line Clipping Cases: pk = 0 Line is parallel to boundaries If for the same k, qk 0, reject Else, accept pk 0 Line starts outside this boundary rk = qk / pk u1 = max(0, rk, u1) Cases: (cont’d) 3. pk 0 Line starts outside this boundary rk = qk / pk u2 = min(1, rk, u2) 4. If u1 u2, the line is completely outside Liang-Barsky Line Clipping Also extends to 3D Just add equations for z = z1 + u?z 2 more p’s and q’s Liang-Barsky Line Clipping In most cases, Liang-Barsky is slightly more efficient According to the Hearn-Baker textbook Avoids multiple shortenings of line segments However, Cohen-Sutherland is much easier to understand (I think) An important issue if you’re actually implementing Weiler-Atherton Polygon Clipping When using Sutherland-Hodgeman, concavities can end up linked A different clipping algorithm, the Weiler-Atherton algorithm, creates separate polygons Weiler-Atherton Clipping Gives “Right” Answer Weiler
您可能关注的文档
- GeneticAlgorithms Optimization Method 最优化方法经典教材课件.ppt
- Genitive 德语初级适用 教学课件.ppt
- genetive 基础德语教学课件.ppt
- GeoMap 地质绘图系统 教学课件.ppt
- genetive 德语初级适用 教学课件.ppt
- GetFLV+Pro+图文教程.doc
- GISPortal_2009 WebGIS课件.pdf
- GIMPS - 寻找梅森素数 Prime95(23.7版)安装使用说明.doc
- GIS在土地利用规划中的应用--土地利用规划方法与实施——课件.ppt
- GMM估计中文讲义 广义矩估计.doc
- DB14∕T 143-2019 苹果褐斑病测报调查规范.docx
- DB14∕T 1417-2017 人工生态公益林经营技术规范.docx
- DB14∕T 1469-2017 胡麻垄膜集雨沟播栽培技术规程.docx
- DB14∕T 1457-2017 带柄玻璃杯标准规范.docx
- DB14∕T 1394-2017 北柴胡良种繁育技术规程.docx
- DB14∕T 1352-2017 晋北区旱地黍子栽培技术规程.docx
- DB14∕T 560-2010 人工影响天气火箭作业系统年检技术规范.docx
- DB14∕T 1510-2017 玉米镰孢穗腐病抗性鉴定牙签接种技术规程.docx
- DB14∕T 166.2-2007 太原绿色转型标准体系 第2部分:框架.docx
- DB14∕T 703-2012 气象灾害等级划分.docx
文档评论(0)