Lecture Computer graphics: Lecture 20 - Fasih ur Rehman

This chapter discuss the purpose of the components required for successful communications; describe these uses of computer communications: wireless messaging services, wireless Internet access points, cybercafés, global positioning systems, collaboration, groupware, voice mail, and Web services; | Computer Graphics Lecture 20 Fasih ur Rehman Last Class Clipping What is clipping Why we do clipping How clipping is done Today’s Agenda Clipping Algorithms Clipping Identification of the portions of geometric primitives by analytical calculations within the view windows Clipping Not to clip means Rasterize outside framebuffer time to convert pixels outside the window will be wasted Line Clipping A clipper decides which primitives, or parts of primitives can possibly be displayed and be passed on to rasterizer. Primitives that fit within the specified view volume pass through the clipper, or are accepted Primitives that cannot appear on the display are eliminated, or rejected or culled. Primitives that are partially within the view volume must be clipped such that any part lying outside the volume is removed Clipping Algorithms Combining the above two If both endpoints lie inside all the edges of view window, accept the line “trivially” If both endpoints lie outside the same edge of . | Computer Graphics Lecture 20 Fasih ur Rehman Last Class Clipping What is clipping Why we do clipping How clipping is done Today’s Agenda Clipping Algorithms Clipping Identification of the portions of geometric primitives by analytical calculations within the view windows Clipping Not to clip means Rasterize outside framebuffer time to convert pixels outside the window will be wasted Line Clipping A clipper decides which primitives, or parts of primitives can possibly be displayed and be passed on to rasterizer. Primitives that fit within the specified view volume pass through the clipper, or are accepted Primitives that cannot appear on the display are eliminated, or rejected or culled. Primitives that are partially within the view volume must be clipped such that any part lying outside the volume is removed Clipping Algorithms Combining the above two If both endpoints lie inside all the edges of view window, accept the line “trivially” If both endpoints lie outside the same edge of view window, reject the line “trivially” Otherwise, split the line in two segments and accept and reject each segment trivially. Cohen – Sutherland Clipping Algorithms Algorithm works for lines only The view window is divided into regions as shown in the figure Each region is assigned a 4-bit outcode Cohen – Sutherland Clipping Algorithms Most significant bit (MSB) called bit 1 indicates y-value of points are above ymax Bit 2 indicates y-value of points are below ymin Bit 3 indicates x-value of points are to the right of Xmax Bit 4 indicates x-value of points are to the left of Xmin Cohen – Sutherland Clipping Algorithms Consider a line segment whose outcodes are given by o1 = outcode(x1, y1) ando2 = outcode(x2, y2). We can now reason on the basis of these outcodes. There are four cases C – S Line Clipping (case 1) (o1= o2 = 0). Both endpoints are inside the clipping window, as is true for segment AB in Figure. The entire line segment is inside, and the segment can be sent on to be .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.