{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

04_2DViewing(ch6) - Two-Dimensional Viewing Chapter 6...

Info icon This preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
Two-Dimensional Viewing Chapter 6
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Viewing Pipeline
Image of page 2
Two Two-Dimensional Viewing Dimensional Viewing n Two dimensional viewing transformation n From world coordinate scene description to device (screen) coordinates
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Normalization and Viewport Transformation n World coordinate clipping window n Normalization square: usually [-1,1]x[-1,1] n Device coordinate viewport
Image of page 4
Normalization and Viewport Transformation ú ú ú ú ú ú û ù ê ê ê ê ê ê ë é - + - - - + - - = 1 0 0 2 0 0 2 min max min max min max min max min max min max , yw yw yw yw yw yw xw xw xw xw xw xw M normsquare window ú ú ú ú ú ú û ù ê ê ê ê ê ê ë é + - + - = 1 0 0 2 2 0 2 0 2 min max min max min max min max , yv yv yv yv xv xv xv xv M viewport normsquare
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Clipping § Remove portions of a picture outside viewport or screen boundaries § Two approaches: § Clip during scan conversion: per-pixel bounds check, or span endpoint tests. § Clip analytically, then scan-convert the modified primitive.
Image of page 6
Two Two-Dimensional Clipping Dimensional Clipping n Point clipping – trivial n Line clipping (straight-line segments) n Cohen-Sutherland n Cyrus-Beck n Liang-Barsky n Fill-area clipping (polygons) n Sutherland-Hodgeman n Weiler-Atherton n Curve clipping n Text clipping max min max min yw y yw xw x xw £ £ £ £
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Line Clipping n Basic calculations n Is an endpoint inside or outside the clip rectangle? n Find the point of intersection, if any, between a line segment and an edge of the clip rectangle. ü Both endpoints inside ç trivial accept ü One inside ß find intersection and clip ü Both outside ß either clip or reject 1 0 ) ( ) ( 0 0 0 0 £ £ - + = - + = u y y u y y x x u x x end end
Image of page 8
Cohen Cohen-Sutherland Sutherland Line Line-Clipping Algorithm Clipping Algorithm 0000 1000 1001 0001 0101 0100 0110 0010 1010 View port < Region code for each endpoint > above below right left Bit 4 3 2 1
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Cohen Cohen-Sutherland Sutherland Line Line-Clipping Algorithm Clipping Algorithm n Trivially accepted if // completely inside n Trivially rejected if // completely outside n Otherwise, divide line into two segments Ø test intersection edges in a fixed order. (e.g., in the order of left, right, bottom, top) ) 0000 ( 2 1 == Ú rc rc ) 0000 ( 2 1 ¹ Ù rc rc
Image of page 10
Cohen Cohen-Sutherland Sutherland Line Line-Clipping Algorithm Clipping Algorithm Fixed order testing and clipping cause needless clipping ( external intersections ) ) /( ) ( ) ( ) ( 0 0 0 0 0 0 x x y y m m y y x x x x m y y end end - - = - + = - + =
Image of page 11

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Cohen Cohen-Sutherland Sutherland Line Line-Clipping Algorithm Clipping Algorithm n When this is good n
Image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern