Lecture Computer graphics: Lecture 21 - Fasih ur Rehman

This chapter explain why computer literacy is vital to success in today's world, describe the five components of a computer, discuss the advantages and disadvantages that users experience when working with computers, discuss the uses of the Internet and World Wide Web,. | Computer Graphics Lecture 21 Fasih ur Rehman Last Class Clipping Algorithms Today’s Agenda Clipping Algorithms Cohen – Sutherland Line Clipping Cohen – Sutherland Line Clipping The view window is divided into regions as shown in the figure Each region is assigned a 4-bit outcode Cohen – Sutherland Line Clipping 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 Line Clipping For each line segment Assign an outcode to each vertex If both outcodes = 0, (by bit – wise OR operation) trivial accept (Line AB of the Figure) Else AND (bitwise) vertex outcodes if result 0, trivial reject (e. g. EF) Cohen – Sutherland Line Clipping If line cannot be trivially accepted or rejected, subdivide the line into the segments either or both of which can be rejected Start with an edge of . | Computer Graphics Lecture 21 Fasih ur Rehman Last Class Clipping Algorithms Today’s Agenda Clipping Algorithms Cohen – Sutherland Line Clipping Cohen – Sutherland Line Clipping The view window is divided into regions as shown in the figure Each region is assigned a 4-bit outcode Cohen – Sutherland Line Clipping 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 Line Clipping For each line segment Assign an outcode to each vertex If both outcodes = 0, (by bit – wise OR operation) trivial accept (Line AB of the Figure) Else AND (bitwise) vertex outcodes if result 0, trivial reject (e. g. EF) Cohen – Sutherland Line Clipping If line cannot be trivially accepted or rejected, subdivide the line into the segments either or both of which can be rejected Start with an edge of view window that the line intersects Find intersection of line with the edge Reject the segment on wrong side of edge (outside the view window) and assign new outcode to new vertex Apply trivial accept/reject tests repeat if necessary Cohen – Sutherland Line Clipping If line can neither be trivially accepted nor rejected, subdivide the line so that o both or either of the two segments can be discarded Select an edge that the line crosses Keep check order the same order each time 9 To find intersection point Parametric Form of Line Summary Clipping References Fundamentals of Computer Graphics Third Edition by Peter Shirley and Steve Marschner Interactive Computer Graphics, A Top-down Approach with OpenGL (Sixth Edition) by Edward .

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.