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

Info iconThis 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
Viewing Pipeline
Background image of page 2
Two-Dimensional Viewing Two dimensional viewing transformation From world coordinate scene description to device (screen) coordinates
Background image of page 3

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

View Full DocumentRight Arrow Icon
Normalization and Viewport Transformation World coordinate clipping window Normalization square: usually [-1,1]x[-1,1] Device coordinate viewport
Background 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.
Background image of page 5

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

View Full DocumentRight 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
Background 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
Background image of page 7

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

View Full DocumentRight 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
Background 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)
Background image of page 9

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

View Full DocumentRight Arrow Icon
Cohen-Sutherland Line-Clipping Algorithm * Fixed order testing and clipping cause needless clipping (external intersection)
Background image of page 10
Cohen-Sutherland Line-Clipping Algorithm Midpoint Subdivision for locating intersections 1. trivial accept/reject test
Background image of page 11

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

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 34

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

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online