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

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

Two-Dimensional Viewing Chapter 6 Intro. to Computer Graphics Spring 2009, Y. G. Shin

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

View Full Document
Viewing Pipeline
Two-Dimensional Viewing Two dimensional viewing transformation From world coordinate scene description to device (screen) coordinates

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

View Full Document
Normalization and Viewport Transformation World coordinate clipping window Normalization square: usually [-1,1]x[-1,1] Device coordinate viewport
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.

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

View Full Document
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
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

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

View Full Document
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
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)

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

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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern