Two-Dimensional Viewing

Slides:



Advertisements
Similar presentations
CGPage: 1 We can define a window as a rectangular region of the world coordinate space, and the viewport as a rectangular region of the device coordinate.
Advertisements

Computer Graphics CLIPPING.
Objectives Define Clipping Various clipping methods. Line clipping methods.
Java ThreadsGraphics Programming Graphics Programming: Windows, Viewports & Clipping.
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
Course Website: Computer Graphics 4: Viewing In 2D.
1 Clipping. 2 Transformation Sequence X Y Z X Y Z X Y Z X Y Z Object Coords. Eye Coords. Clip Coords. Normalized Device Coords. Screen Coords. Implementation:
Chung ji hye Window vs. viewport A world-coordinate area selected for display is called a window. An area on the display device to.
Two-Dimensional Viewing Jehee Lee Seoul National University.
Computer Graphics : Clipping
Computer Graphics Viewing.
Viewing & Clipping In 2D. 2 of 44 Contents Windowing Concepts Clipping –Introduction –Brute Force –Cohen-Sutherland Clipping Algorithm Area Clipping –Sutherland-Hodgman.
CGPage: 1 東吳資訊科學 江清水 The process of clipping decides which part, if any, of a primitive lies inside the window. The algorithms used for line clipping can.
CMPE 466 COMPUTER GRAPHICS Chapter 8 2D Viewing Instructor: D. Arifler Material based on - Computer Graphics with OpenGL ®, Fourth Edition by Donald Hearn,
2D Viewing and Projection
2 D viewing Prepared by Elizabeth Isaac DCS, RSET.
Introduction to Computer Graphics Chapter 6 – 2D Viewing Pt 2 1.
CHAPTER 7 2D VIEWING CGMB214: Introduction to Computer Graphics.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Interpolation Clipping.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
1 Computer Graphics Chapter 4 2D Viewing Algorithms.
1 King ABDUL AZIZ University Faculty Of Computing and Information Technology CS 454 Computer graphics Two Dimensional Viewing Dr. Eng. Farag Elnagahy
Computer Graphics Clipping Cohen Sutherland Algorithm (Line) Cyrus-Back Algorithm (Line) Sutherland-Hodgeman Algorithm (Polygon) Cohen Sutherland Algorithm.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Clipping.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Implementation I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
2D Viewing. 2D viewing transformation is a mapping of world coordinate scene to device coordinates xw min xw max yw min yw max xv min xv max yv min yv.
Graphics Pipeline Clipping CMSC 435/634. Graphics Pipeline Object-order approach to rendering Sequence of operations – Vertex processing – Transforms.
1 Computer Graphics Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD3107 University of Palestine.
2-Dimension Viewing and Clipping
Windowing and clipping
CS 376 Introduction to Computer Graphics 02 / 12 / 2007 Instructor: Michael Eckmann.
Two-Dimensional Viewing
Clipping: Clipping is a process of dividing an object into visible and invisible positions and displaying the visible portion and discarding the invisible.
Polygons Polygons. Polygon Any shape where every segment intersects exactly two others at its endpoints.
Two Dimensional Viewing
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Objectives Introduce basic implementation strategies Clipping Scan conversion.
Computer Graphics 2 – Dimensional Viewing.
CS 480/680 Computer Graphics Shading in OpenGL Dr. Frederick C Harris, Jr. Fall 2013.
Clipping CSCI 440 textbook section Starter Question How do we clip these lines? X=-5 Y=-5 Y=5 X=5 [0,0] [3,3] [7,-3] [0,-3] formula from wikipedia.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 2D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
Clipping Computer Graphics Cohen Sutherland Algorithm (Line)
Windows, Viewports, and Clipping
Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,
EEL Introduction to Computer Graphics
Implementation of a Renderer Consider Programs are processd by the system line & polygon, outside the view volume Efficiently Understanding of the implementation.
1 Computer Graphics Clipping Fall FCC Line Clipping What happens when one or both endpoints of a line segment are not inside the specified drawing.
1Computer Graphics Implementation 1 Lecture 15 John Shearer Culture Lab – space 2
2D Viewing.
Introduction to Computer Graphics Chapter 6 – 2D Viewing Pt 3 1.
Clipping Primitives. Clipping line Clipping rectangle: – x min to x max – y min to y max A point (x,y) lies within a clip rectangle and thus displayed.
Graphics Graphics & Graphical Programming Lecture 23 - Viewing & Clipping.
A.Aruna/Assistant Professor/SNSCE
Perspective View Volume View Volume Far Near Window Far Near Window Center of Projection Center of Projection (a) Original Orientation (b) After Transformation.
Computer Graphics Viewing. 2 of 30 Viewing in 2D Window in world coordinates. 45  250  Viewport in Device coords 250 x 250 Pixels.
Lecture 9 From Vertices to Fragments. Objectives Introduce basic implementation strategies Clipping Rasterization hidden-surface removal.
Clipping.
Computer Graphic 2 D Viewing.
Introduction to Computer Graphics with WebGL
Computer Graphics CC416 Week 13 Clipping.
Transformations contd.
2D Viewing & Clipping 한신대 류승택
2D Viewing Pipeline.
Graphics Pipeline Clipping
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
WINDOWING AND CLIPPING
WINDOWING AND CLIPPING
Two Dimensional Viewing and Clipping.
Clipping University of British Columbia CPSC 314 Computer Graphics
Presentation transcript:

Two-Dimensional Viewing 6 Two-Dimensional Viewing

Contents Window and Viewport The Viewing Transformation Window-to-Viewport coordinate transformation Point clipping Line clipping Polygon clipping Exterior clipping

Window and Viewport Window Viewport A world-coordinate area selected for display What is to be viewed Viewport An area on a display device to which a window is mapped Where is to be displayed World Coordinates Device Coordinates

Window and Viewport (계속) Window to Viewport Mapping

Window and Viewport (계속)

The Viewing Transformation window-to-viewport transformation, windowing transformation construct world coordinates convert to viewing coordinates map to normalized viewing coordinates viewport clipping World Coordinates Normalized Device Coordinates map to device coordinates

Viewing coordinate reference frame World 좌표  View 좌표 1. 중심 이동 2. 회전 MWC,VC = R• T 뷰좌표 중심을 전체좌표 중심으로 이동 두 좌축의 축을 맞추는회전

Window-to-Viewport Coordinate Transformation 윈도우의 점을 뷰포트로 변경 상대 거리를 유지하게 함 , 1. Scaling the window to the size of the viewport 2. Translate to the position of the viewport Window to Viewport Transformation

Workstation transformation Normalized coordinates에서 다양한 device로 매핑 각 device마다 window-to-viewport transformation 수행 하나의 뷰의 다른 부분을 각 장치에서 볼 수 있음

Clipping Clipping Point clipping 그림의 일부가 정해진 영역 내부인지 외부인지 구별 전체좌표계에 적용 다음을 만족하는 점 P=(x,y) 저장 응용 : 폭발, 바다등 particle model의 화면처리

Line Clipping 1. Check all segments Intersect the window boundary Before Clipping After Clipping 1. Check all segments Intersect the window boundary 2. Clip line segments Calculate the intersections with the window boundary

Cohen-Sutherland Line Clipping Basic idea Encode the line endpoints Successively divide the line segments so that they are completely contained in the window or completely lies out side window Division occurs at the boundary of window

Cohen-Sutherland Line Clipping 2진 영역 코드(region code) 4bits : 왼쪽, 오른쪽, 아래, 위 clipping 사각형에 대한 위치 의미 0000 : clipping 사각형 내의 점 선의 구분 Visible : 선의 양 끝점의 code가 모두 0000 Invisible : 양 끝점 code의 Logical AND 가 0000이 아닐 때 Indeterminate : Logical AND는 0000이지만, 끝점의 code가 0000이 아닌 경우 이 경우에 대해 Clipping실시 A B 선 끝점에 대한 2진 영역코드

Cohen-Sutherland Line Clipping 경계와의 교차점 찾기 (예) P1에서 P2로 지나는 선분 아래 끝점 P1의 좌, 우, 하방에 대한 경계비교 창의 아래쪽이므로 창 아래 경계 교차점 P1’ 찾음 P1에서 P1’ 버림 상단 : P2 --> P2‘--> P2“ 순으로 찾아 나감 P3에서 P4로 지나는 선분 P3는 창 왼쪽이므로 P3’ 찾아 선분 P3에서 P3’은 버림 선분 P3’ 에서 P4는 창 아래이므로 버림 P’2 P”2 P3 P’1 P1 P’3 P4 절단 창을 지나는 두 선분

Cohen-Sutherland Line Clipping Quiz) B A (8,8) D Line AB : A(3,10), B(6,12) CD : C(4,1), D(10,6) (2,2) C

Cohen-Sutherland Line Clipping Step1. Encode end points (2,2) (8,8) A B C D AB A(3,10) 1000 B(6,12) 1000 Logical AND 1000 CD C( 4, 1) 0100 D(10,6) 0010 Logical AND 0000 Invisible Indeterminate Step2. Clip line CD

Midpoint Subdivision Pm Window Pm Pm Similar to Cohen-Sutherland Algorithm except dividing strategy Division occurres at midpoints!! 한글을 발음하는 입술 애니메이션은 다음과 같은 문제점을 갖고 있습니다. 한글은 외국어와 차이가 있어 외국 모델을 그대로 사용할 수 없으며 연구 개요에서 보셨듯이 선행 연구는 부정확한 발음을 표현하고 동시조음도 고려하지 않아 실재와 다른 움직임을 보였습니다. 본 연구는 음절을 자연스럽게 발음하고 음절간의 움직임도 부드럽게 표현하는 모델을 구현하는 것이 목적입니다.

Midpoint Subdivision Ex) Window : (2,2),(8,6) Line AB : A(4,3), B(10,5) Sub Divisions Mid Points Segment Further Chosen Division A 0000 B 0010 Logical AND 0000 1 (7,4) (7,4) ~ (10,5) 2 3 4 . 한글을 발음하는 입술 애니메이션은 다음과 같은 문제점을 갖고 있습니다. 한글은 외국어와 차이가 있어 외국 모델을 그대로 사용할 수 없으며 연구 개요에서 보셨듯이 선행 연구는 부정확한 발음을 표현하고 동시조음도 고려하지 않아 실재와 다른 움직임을 보였습니다. 본 연구는 음절을 자연스럽게 발음하고 음절간의 움직임도 부드럽게 표현하는 모델을 구현하는 것이 목적입니다. Indeterminate

Polygon Clipping Line clipper 이용, 몇 개의 닫힌 다각형들 생성 Window boundary를 따라가며 Clipping 수행 Before Clipping After Clipping 한글을 발음하는 입술 애니메이션은 다음과 같은 문제점을 갖고 있습니다. 한글은 외국어와 차이가 있어 외국 모델을 그대로 사용할 수 없으며 연구 개요에서 보셨듯이 선행 연구는 부정확한 발음을 표현하고 동시조음도 고려하지 않아 실재와 다른 움직임을 보였습니다. 본 연구는 음절을 자연스럽게 발음하고 음절간의 움직임도 부드럽게 표현하는 모델을 구현하는 것이 목적입니다.

Polygon Clipping (계속) Sutherland-Hodgeman Clipping 다각형 정점 처리방법 - 시계방향으로 edge 탐색 처리된 정점을 다음 면에 반복 적용 Concave polygon에는 부적합 한글을 발음하는 입술 애니메이션은 다음과 같은 문제점을 갖고 있습니다. 한글은 외국어와 차이가 있어 외국 모델을 그대로 사용할 수 없으며 연구 개요에서 보셨듯이 선행 연구는 부정확한 발음을 표현하고 동시조음도 고려하지 않아 실재와 다른 움직임을 보였습니다. 본 연구는 음절을 자연스럽게 발음하고 음절간의 움직임도 부드럽게 표현하는 모델을 구현하는 것이 목적입니다. (d) (a) (b) (c)

Polygon Clipping (계속) Weiler-Atherton Polygon Clipping Concave Polygon에도 적용가능 하도록 Clipping에 Polygon edge 뿐 아니라 Window boundary도 사용 탐색원리(시계 방향의 경우) 바깥쪽  안쪽 : 다각형의 경계 따름 안쪽  바깥쪽 : 창의 경계 따라 탐색 응용 : Weiler Polygon Clipping 임의의 다각형의 경계 처리 Weiler-atherton polygon clipping 을 적용하여 두개 영역 생성 한글을 발음하는 입술 애니메이션은 다음과 같은 문제점을 갖고 있습니다. 한글은 외국어와 차이가 있어 외국 모델을 그대로 사용할 수 없으며 연구 개요에서 보셨듯이 선행 연구는 부정확한 발음을 표현하고 동시조음도 고려하지 않아 실재와 다른 움직임을 보였습니다. 본 연구는 음절을 자연스럽게 발음하고 음절간의 움직임도 부드럽게 표현하는 모델을 구현하는 것이 목적입니다. Weiler polygon clipping

Exterior Clipping Exterior Clipping 영역의 바깥쪽을 저장 적용 예 Multiple window system 그림에 라벨이나 디자인 패턴 입력 안쪽 절단에 응용 한글을 발음하는 입술 애니메이션은 다음과 같은 문제점을 갖고 있습니다. 한글은 외국어와 차이가 있어 외국 모델을 그대로 사용할 수 없으며 연구 개요에서 보셨듯이 선행 연구는 부정확한 발음을 표현하고 동시조음도 고려하지 않아 실재와 다른 움직임을 보였습니다. 본 연구는 음절을 자연스럽게 발음하고 음절간의 움직임도 부드럽게 표현하는 모델을 구현하는 것이 목적입니다. Interior clipping과 exterior clipping을 이용한 polygon 내부 line clipping