Xem mẫu

Bài 3: Các giải thuật cơ sở Le Tan Hung hunglt@it-hut.edu.vn 0913030731 (c) SE/FIT/HUT 2002 1 Nội dung ④Các giải thuật xén tỉa - Clipping ④Các thuật toán tô miền kín ④Phép tô mầu ④Phép xử lý Antialiasing (c) SE/FIT/HUT 2002 2 Xén tỉa - Clipping ④ Nhiệm vụ cơ bản trong đồ họa là giữ các phần của đối tượng lựa chọn nằm bên ngoài đồ hoạ. ④ Xén tỉa là việc di chuyển tất cả các đối tượng hoặc các phần của đối tượng thuộc mô hình ngữ cảnh ra bên ngoài của sổ thế giới thực ④ Việc loại từng điểm ảnh của đối tượng thường chậm nhất là khi đối tượng mà phần lớn nằm ngoài cửa sổ hiển thị. ④ Kỹ thuật thực hành là cần thiết để nâng cao tốc độ trong thực hiện nhiệm vụ ④ Định nghĩa Clipping điểm ④ xmin ≤ x ≤ xmax ymin ≤ y ≤ ymax (c) SE/FIT/HUT 2002 3 Clipping đoạn thẳng ④Lines are defined by their endpoints, so it should be possible just to examine these (in a similar way to points) and determine whether or not to clip without considering every pixel on the line ④We often have windows that are either very large, i.e. nearly the whole scene fits inside, or very small, i.e. most of the scene lies inside the window ④Hence, most lines may be either trivially accepted or rejected (c) SE/FIT/HUT 2002 4 Giải thuật Cohen Sutherland Outcode ④The Cohen-Sutherland line-clipping algorithm is particularly fast for “trivial” cases, i.e. lines completely inside or outside the window. ④Non-trivial lines, i.e. ones that cross a boundary of the window, are clipped by computing the coordinates of the new boundary endpoint of the line where it crosses the edge of the window ④Each point on all lines are first assigned an “outcode” defining their position relative to the clipping rectangle (c) SE/FIT/HUT 2002 5 ... - tailieumienphi.vn
nguon tai.lieu . vn