2DView - Two-Dimensional Viewing Chapter 6 Intro to...

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

View Full Document Right Arrow Icon
Two-Dimensional Viewing Chapter 6 Intro. to Computer Graphics Spring 2009, Y. G. Shin
Image of page 1

Info iconThis 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-Dimensional Viewing Two dimensional viewing transformation From world coordinate scene description to device (screen) coordinates
Image of page 3

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

View Full Document Right Arrow Icon
Normalization and Viewport Transformation World coordinate clipping window Normalization square: usually [-1,1]x[-1,1] Device coordinate viewport
Image of page 4
Clipping Remove portion of line 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 5

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

View Full Document Right Arrow Icon
Two-Dimensional Clipping Point clipping trivial Line clipping Cohen-Sutherland Cyrus-beck Liang-Barsky Fill-area clipping Sutherland-Hodgeman Weiler-Atherton Curve clipping Text clipping
Image of page 6
Line Clipping Basic calculations: Is an endpoint inside or outside the clip rectangle? 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
Image of page 7

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

View Full Document Right Arrow Icon
Cohen-Sutherland Line-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 8
Cohen-Sutherland Line-Clipping Algorithm Trivially accepted if (both region codes = 0000) Trivially rejected if (AND of region codes 0000) Otherwise, divide line into two segments test intersection edges in a fixed order. (e.g., top-to-bottom, right-to-left)
Image of page 9

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

View Full Document Right Arrow Icon
Cohen-Sutherland Line-Clipping Algorithm * Fixed order testing and clipping cause needless clipping (external intersection)
Image of page 10
Cohen-Sutherland Line-Clipping Algorithm Midpoint Subdivision for locating intersections 1. trivial accept/reject test 2. midpoint subdivision:
Image of page 11

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

View Full Document Right Arrow Icon
Image of page 12
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