Clipping Points Consider a clip window which is rectangular in shape. P(x, y) is a point to be displayed.

Size: px
Start display at page:

Download "Clipping Points Consider a clip window which is rectangular in shape. P(x, y) is a point to be displayed."

Transcription

1 Usually only a specified region of a picture needs to be displayed. This region is called the clip window. An algorithm which displays only those primitives (or part of the primitives) which lie inside a clip window is referred to as a clipping algorithm. A clipping algorithm identifies those portions of a picture that are either inside or outside of a specified region. The region against which an object is to clipped is called a clip window. The following graphics primitives can be subjected to the clipping operation: () Point, (2) Line, (3) Area (polygon), (4) Curve, and (5) Text. (The reverse of clipping is called shielding covering up a portion of a picture so that it is not visible.) Clipping Points Consider a clip window which is rectangular in shape. P(x, y) is a point to be displayed. xw max, yw max xw min, yw min Point P (x; y) lies inside the rectangular clip window if and only if the following inequalities hold: xw min x xw max yw min y yw max If any of these inequalities are not satisfied, point P is outside (not visible) the window. The Cohen-Sutherland algorithm for line clipping: A line segment may be wholly inside a window (visible), or wholly outside a window (not visible), or it may partially lie in a window, e.g., it may intersect with window boundaries. In the last case, the line may be subjected to the operation of clipping. The Cohen-Sutherland line clipping algorithm is used to determine to which category a line belongs. The algorithm is based on first deciding whether a line is to be trivially accepted (display full line), trivially rejected, or whether the line is to be partially displayed (candidate for clipping). Mukesh N. Tekwani (mukeshtekwani@hotmail.com) Page of 6

2 The Cohen-Sutherland algorithm consists of the following parts:. Determine the outcodes of the endpoints. 2. Based on the outcodes, determine the visibility of the line 3. If the line is wholly visible, draw the line. 4. If the line is partially visible, determine the intersection points of the line with the window boundaries and draw the line. Endpoint Outcodes: The clipping window divides the XY plane into 9 regions as shown below. Each region is assigned a 4-bit code. The endpoints of a line can only lie in these regions. A 4-bit code is assigned to each endpoint of a line segment. The code is determined according to which of the following nine regions of the plane the endpoint lies in To remember the outcodes, remember this mnemonic: TBRL, where T -> Top, B -> Bottom, R -> Right, and L -> Left. If the endpoint of a line segment is to the right of the window and above the window, its outcode is 00. Similarly, determine the outcodes of the other regions. Case Trivial Acceptance: If both the endpoint codes are 0000, then both the end points of the line lie inside the window and the line is visible. It is trivially accepted. Case 2 Trivial Rejection: If the logical AND of the codes of the endpoints is not 0000, the line is not visible. It is trivially rejected. Case 3 Clipping Candidate: If the logical AND of the endpoint codes is 000, the line is a candidate for clipping. Intersection Points: Once it is determined in which category the line falls, we can determine the intersection points of the line with the window boundaries. The equation of a line passing through P (x, y ) and P 2 (x 2, y 2 ) is given by: y y = m (x x ) OR y y 2 = m (x x 2 ) Page 2 of 6 Mukesh N. Tekwani (mukeshtekwani@hotmail.com)

3 This can be rearranged as y = m (x x ) + y where, Slope m = y 2 y x 2 x The intersections of the line with the window edges are given by: If slope m : Intersection of the line with the left edge (x L ) : y = m (x L x ) + y Intersection of the line with the right edge (x R ) : y = m (x R x ) + y If slope m 0: Intersection of the line with the top edge (y T ) : x = x + Intersection of the line with the bottom edge (y B ) : x = x + y T y m y B y m If m =, then the line is parallel to the left and the right edges and we only have to check the top and bottom edges for intersection with the clipping boundary. If m = 0, then the line is parallel to the top and the bottom edges and we need to only check for intersection with the right and left window boundaries. This algorithm terminates after at most four passes through the loop, since at each iteration we retain only the position of the segment that has remained after testing at previous window boundaries, and there are only four such boundaries. Thus, after at most four iterations, trivial acceptance or rejection is assured. Consider the line segment AD in the following figure: D A G H F 00 E The outcode for point A is 0000 and for D is 00. Mukesh N. Tekwani (mukeshtekwani@hotmail.com) Page 3 of 6

4 Logical AND of these two outcodes is (0000 AND 00) = Hence, the line AD is a candidate for clipping. Choose D as the outside point. The code for D shows that it crosses the top edge(since T bit is ) and the left edge (since L bit is also ). We first use the top edge to clip AD to AB and we calculate point B s outcode as (Remember, a point on the window boundary is treated as inside the window, so its outcode is 0000). In the next iteration, we apply the trivial acceptance/rejection tests to AB, and the line is trivially accepted or rejected. Line EH requires multiple iterations. (i) (ii) (iii) (iv) The point E has endpoint code 000, so the algorithm chooses it as the outside point. The endpoint code shows that the first edge against which the line is cut is the bottom edge. So EI is clipped to FI. In the second iteration, FI cannot be trivially accepted or rejected. The code for F is 0000 (since it is on the window boundary). So the algorithm chooses point I as the outside point and its outcode is 00. The first edge clipped against is the top edge, yielding the segment FH. The endpoint code of H is 000. the clipping is now against the right edge to segment FG. FG is trivially accepted in the final iteration. Cohen-Sutherland Algorithm:. Read the two end points of the line P (x, y ), and P 2 (x 2, y 2 ). 2. Read the co-ordinates of the two corners of the rectangular window (x L, y B ) and (x R, y T ) 3. Assign the outcodes for each point P and P 2 : a. Initialize the outcode to 0000 for each point P and P 2. b. For each point: i. Set bit (L bit) to if x < x L (point to the left) ii. Set bit 2 (R bit) to if x > x R (point to the right) iii. Set bit 3 (B bit) to if y < y B (point below the bottom) iv. Set bit 4 (T bit) to if y > y T (point above the top) 4. Check for visibility of line P P 2 : a. If the outcodes of both P and P 2 are zero, then the line is completely visible. Hence, draw the line and go to step 9. b. If the outcodes for endpoints are not zero and outcode [{P ) AND {P 2 )] is also not equal to zero, then the line is completely invisible. So reject the line and go to step 9. c. Else, line is partially visible (candidate for clipping) (i.e., processing continues at step 5}. 5. Compute the intersecting edge of the clipping window by inspecting the outcodes of the two end points: a. If the outcodes for both P and P 2 are non-zero, then find the intersection points P / and P / 2 with the boundary edges of the clipping window. Page 4 of 6 Mukesh N. Tekwani (mukeshtekwani@hotmail.com)

5 b. If the outcode for any one end point is non-zero, then find the intersection point P / or P / 2 with the boundary edge of the clipping window. 6. Divide the line segments considering intersection points. 7. Reject the line segment if any one end point of it appears outside the clipping window. 8. Draw the remaining line segments. 9. Stop. Midpoint Subdivision Algorithm: This algorithm is also referred to as Sproull-Sutherland algorithm. It is a special case of the Cohen-Sutherland algorithm. Cohen-Sutherland algorithm calculates the intersection point of a line with a window edge. This direct calculation can be avoided by performing a binary search for the intersection point. The line is repeatedly divided at its midpoint. This algorithm is fast because division by 2 is accomplished by shifting each bit to the right. (Left shift is faster than division by 2). The end point codes of a line are first used to identify totally visible or totally invisible lines. Lines which do not fall into these two categories are subdivided by this algorithm. The tests are then applied to each half of the line until the intersection point with the window edge is found or the length of the divided segments is infinitesimal (reduces to a point). Consider the line c in the following diagram: P c P m P m2 P 2 The endpoint codes of the line are 000 and 000. Logical AND of codes is 000 and 000 is Hence, the line is a candidate for clipping. Mukesh N. Tekwani (mukeshtekwani@hotmail.com) Page 5 of 6

6 Subdivide the line at point P m. The two halves of the line are now P P m and P m P 2. Both these segments are again candidates for clipping. Consider P m P 2. This is further subdivided at P m2. The segment P m P m2 is totally visible (since their outcodes are both 0000). Segment P m2 P 2 is partially visible. Although line P m2 P 2 can be drawn, it will result in short segments being drawn. Instead, we save the point P m2 as the current farthest visible point from P. Now subdivide P m2 P 2. each time a visible midpoint is found, it is treated as the farthest visible point from P until the intersection with the bottom edge of the clipping window is determined. This intersection is then declared the farthest visible point from P. The segment P P m is then examined in the same way. The visible portion of the line P P 2 is then drawn between the two intersections. Midpoint Subdivision Algorithm:. Read the two endpoint coordinates P (x, y ) and P 2 (x 2, y 2 ). 2. Read the co-ordinates of the two corners of the rectangular window (x L, y B ) and (x R, y T ) 3. Assign the outcodes for each point P and P 2 : a. Initialize the outcode to 0000 for each point P and P 2. b. For each point: i. Set bit (L bit) to if x < x L (point to the left) ii. Set bit 2 (R bit) to if x > x R (point to the right) iii. Set bit 3 (B bit) to if y < y B (point below the bottom) iv. Set bit 4 (T bit) to if y > y T (point above the top) 4. Check for visibility of line P P 2 : a. If the outcodes of both P and P 2 are zero, then the line is completely visible. Hence, draw the line and go to step 6. b. If the outcodes for endpoints are not zero and outcode [{P ) AND {P 2 )] is also not equal to zero, then the line is completely invisible. So reject the line and go to step 6. c. Else, line is partially visible (candidate for clipping) (i.e., processing continues at step 5}. 5. Divide the partially visible line in equal parts and repeat steps 3 to 5 for both subdivided segments until you get completely visible and completely invisible line segments. 6. Stop. Page 6 of 6 Mukesh N. Tekwani (mukeshtekwani@hotmail.com)

Computer Graphics Viewing Objective

Computer Graphics Viewing Objective Computer Graphics Viewing Objective The aim of this lesson is to make the student aware of the following concepts: Window Viewport Window to Viewport Transformation line clipping Polygon Clipping Introduction

More information

CSCI 4620/8626. Computer Graphics Clipping Algorithms (Chapter 8-5 )

CSCI 4620/8626. Computer Graphics Clipping Algorithms (Chapter 8-5 ) CSCI 4620/8626 Computer Graphics Clipping Algorithms (Chapter 8-5 ) Last update: 2016-03-15 Clipping Algorithms A clipping algorithm is any procedure that eliminates those portions of a picture outside

More information

Clipping Lines. Dr. Scott Schaefer

Clipping Lines. Dr. Scott Schaefer Clipping Lines Dr. Scott Schaefer Why Clip? We do not want to waste time drawing objects that are outside of viewing window (or clipping window) 2/94 Clipping Points Given a point (x, y) and clipping window

More information

From Vertices To Fragments-1

From Vertices To Fragments-1 From Vertices To Fragments-1 1 Objectives Clipping Line-segment clipping polygon clipping 2 Overview At end of the geometric pipeline, vertices have been assembled into primitives Must clip out primitives

More information

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI Department of Computer Science and Engineering CS6504-COMPUTER GRAPHICS Anna University 2 & 16 Mark Questions & Answers Year / Semester: III / V Regulation:

More information

Chapter 8: Implementation- Clipping and Rasterization

Chapter 8: Implementation- Clipping and Rasterization Chapter 8: Implementation- Clipping and Rasterization Clipping Fundamentals Cohen-Sutherland Parametric Polygons Circles and Curves Text Basic Concepts: The purpose of clipping is to remove objects or

More information

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Clipping. Concepts, Algorithms for line clipping. 1 of 16. Andries van Dam. Clipping - 10/12/17

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Clipping. Concepts, Algorithms for line clipping. 1 of 16. Andries van Dam. Clipping - 10/12/17 Clipping Concepts, Algorithms for line clipping 1 of 16 Line Clipping in 2D Clipping endpoints If x min x x max and y min y y max, the point is inside the clip rectangle. Endpoint analysis for lines: if

More information

UNIT -8 IMPLEMENTATION

UNIT -8 IMPLEMENTATION UNIT -8 IMPLEMENTATION 1. Discuss the Bresenham s rasterization algorithm. How is it advantageous when compared to other existing methods? Describe. (Jun2012) 10M Ans: Consider drawing a line on a raster

More information

Two-Dimensional Viewing. Chapter 6

Two-Dimensional Viewing. Chapter 6 Two-Dimensional Viewing Chapter 6 Viewing Pipeline Two-Dimensional Viewing Two dimensional viewing transformation From world coordinate scene description to device (screen) coordinates Normalization and

More information

Computer Graphics (CS 543) Lecture 9 (Part 2): Clipping. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Computer Graphics (CS 543) Lecture 9 (Part 2): Clipping. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI) Computer Graphics (CS 543) Lecture 9 (Part 2): Clipping Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) OpenGL Stages After projection, several stages before objects drawn

More information

Unit 3 Transformations and Clipping

Unit 3 Transformations and Clipping Transformation Unit 3 Transformations and Clipping Changes in orientation, size and shape of an object by changing the coordinate description, is known as Geometric Transformation. Translation To reposition

More information

MODULE - 9. Subject: Computer Science. Module: Line Clipping. Module No: CS/CGV/9

MODULE - 9. Subject: Computer Science. Module: Line Clipping. Module No: CS/CGV/9 Quadrant 1 e-text e-pg Pathshala MODULE - 9 Subject: Computer Science Paper: Computer Graphics and Visualization Module: Line Clipping Module No: CS/CGV/9 Objectives: Understand Cohen-Sutherland Line Clipping

More information

Graphics System. Processor. Output Display. Input Devices. Frame Buffer. Memory. Array of pixels. Resolution: # of pixels Depth: # of bits/pixel

Graphics System. Processor. Output Display. Input Devices. Frame Buffer. Memory. Array of pixels. Resolution: # of pixels Depth: # of bits/pixel Graphics System Input Devices Processor Memory Frame Buffer Output Display Array of pixels Resolution: # of pixels Depth: # of bits/pixel Input Devices Physical Devices: Keyboard, Mouse, Tablet, etc. Logical

More information

3D Rendering Pipeline (for direct illumination)

3D Rendering Pipeline (for direct illumination) Clipping 3D Rendering Pipeline (for direct illumination) 3D Primitives 3D Modeling Coordinates Modeling Transformation Lighting 3D Camera Coordinates Projection Transformation Clipping 2D Screen Coordinates

More information

Computer Graphics: Two Dimensional Viewing

Computer Graphics: Two Dimensional Viewing Computer Graphics: Two Dimensional Viewing Clipping and Normalized Window By: A. H. Abdul Hafez Abdul.hafez@hku.edu.tr, 1 Outlines 1. End 2 Transformation between 2 coordinate systems To transform positioned

More information

1 Attempt any three of the following: 1 5 a. What is Computer Graphics? How image is to be display on Video Display Device?

1 Attempt any three of the following: 1 5 a. What is Computer Graphics? How image is to be display on Video Display Device? (2½ hours) Total Marks: 75 N. B.: (1) All questions are compulsory. (2) Makesuitable assumptions wherever necessary and state the assumptions made. (3) Answers to the same question must be written together.

More information

Clipping & Culling. Lecture 11 Spring Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling

Clipping & Culling. Lecture 11 Spring Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling Clipping & Culling Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling Lecture 11 Spring 2015 What is Clipping? Clipping is a procedure for spatially partitioning geometric primitives,

More information

2D Viewing. Viewing Pipeline: Window-Viewport Transf.

2D Viewing. Viewing Pipeline: Window-Viewport Transf. Viewing Pipeline: Window-Viewport Transf. 2D Viewing yw max clipping window: what to display viewport: where to be viewed translation, rotation, scaling, clipping,... Clipping Window yv max Viewport yv

More information

Last class. A vertex (w x, w y, w z, w) - clipping is in the - windowing and viewport normalized view volume if: - scan conversion/ rasterization

Last class. A vertex (w x, w y, w z, w) - clipping is in the - windowing and viewport normalized view volume if: - scan conversion/ rasterization Lecture 6 Last class Last lecture (clip coordinates): A vertex (w x, w y, w z, w) - clipping is in the - windowing and viewport normalized view volume if: - scan conversion/ rasterization normalized view

More information

CS 325 Computer Graphics

CS 325 Computer Graphics CS 325 Computer Graphics 02 / 29 / 2012 Instructor: Michael Eckmann Today s Topics Questions? Comments? Specifying arbitrary views Transforming into Canonical view volume View Volumes Assuming a rectangular

More information

Clipping Algorithms; 8-5. Computer Graphics. Spring CS4815

Clipping Algorithms; 8-5. Computer Graphics. Spring CS4815 Computer Graphics Spring 2016-2017 Outline Clipping Algorithms; 8-5 1 Clipping Algorithms; 8-5 Announcements Mid-term: Week07?? Clipping: Introduction It is common for a region to be defined so that only

More information

Set the Viewport. Set the Viewport Clipping. Set the Viewport. Set the Viewport. Set the Viewport. Resizing the Viewport W = H

Set the Viewport. Set the Viewport Clipping. Set the Viewport. Set the Viewport. Set the Viewport. Resizing the Viewport W = H To draw an undistorted version of the data in a viewport, you need to ensure the viewport and the window have the same aspect ratio. i.e. W H window window W = H viewport viewport Computer Graphics CSC470

More information

Computer Graphics. The Two-Dimensional Viewing. Somsak Walairacht, Computer Engineering, KMITL

Computer Graphics. The Two-Dimensional Viewing. Somsak Walairacht, Computer Engineering, KMITL Computer Graphics Chapter 6 The Two-Dimensional Viewing Somsak Walairacht, Computer Engineering, KMITL Outline The Two-Dimensional Viewing Pipeline The Clipping Window Normalization and Viewport Transformations

More information

Windowing And Clipping (14 Marks)

Windowing And Clipping (14 Marks) Window: 1. A world-coordinate area selected for display is called a window. 2. It consists of a visual area containing some of the graphical user interface of the program it belongs to and is framed by

More information

Part 3: 2D Transformation

Part 3: 2D Transformation Part 3: 2D Transformation 1. What do you understand by geometric transformation? Also define the following operation performed by ita. Translation. b. Rotation. c. Scaling. d. Reflection. 2. Explain two

More information

CS602 MCQ,s for midterm paper with reference solved by Shahid

CS602 MCQ,s for midterm paper with reference solved by Shahid #1 Rotating a point requires The coordinates for the point The rotation angles Both of above Page No 175 None of above #2 In Trimetric the direction of projection makes unequal angle with the three principal

More information

Computer Graphics: 7-Polygon Rasterization, Clipping

Computer Graphics: 7-Polygon Rasterization, Clipping Computer Graphics: 7-Polygon Rasterization, Clipping Prof. Dr. Charles A. Wüthrich, Fakultät Medien, Medieninformatik Bauhaus-Universität Weimar caw AT medien.uni-weimar.de Filling polygons (and drawing

More information

8. Hidden Surface Elimination

8. Hidden Surface Elimination -04-8 Hidden Surface Elimination To eliminate edges and surfaces not visible to the viewer Two categories: Object space methods: Image space methods: deal with object definitions directly Order the surfaces

More information

Realtime 3D Computer Graphics Virtual Reality

Realtime 3D Computer Graphics Virtual Reality Realtime 3D Computer Graphics Virtual Reality From Vertices to Fragments Overview Overall goal recapitulation: Input: World description, e.g., set of vertices and states for objects, attributes, camera,

More information

Computer Graphics. - Clipping - Philipp Slusallek & Stefan Lemme

Computer Graphics. - Clipping - Philipp Slusallek & Stefan Lemme Computer Graphics - Clipping - Philipp Slusallek & Stefan Lemme Clipping Motivation Projected primitive might fall (partially) outside of the visible display window E.g. if standing inside a building Eliminate

More information

Renderer Implementation: Basics and Clipping. Overview. Preliminaries. David Carr Virtual Environments, Fundamentals Spring 2005

Renderer Implementation: Basics and Clipping. Overview. Preliminaries. David Carr Virtual Environments, Fundamentals Spring 2005 INSTITUTIONEN FÖR SYSTEMTEKNIK LULEÅ TEKNISKA UNIVERSITET Renderer Implementation: Basics and Clipping David Carr Virtual Environments, Fundamentals Spring 2005 Feb-28-05 SMM009, Basics and Clipping 1

More information

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into 2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into the viewport of the current application window. A pixel

More information

Clipping and Scan Conversion

Clipping and Scan Conversion 15-462 Computer Graphics I Lecture 14 Clipping and Scan Conversion Line Clipping Polygon Clipping Clipping in Three Dimensions Scan Conversion (Rasterization) [Angel 7.3-7.6, 7.8-7.9] March 19, 2002 Frank

More information

RASTERIZING POLYGONS IN IMAGE SPACE

RASTERIZING POLYGONS IN IMAGE SPACE On-Line Computer Graphics Notes RASTERIZING POLYGONS IN IMAGE SPACE Kenneth I. Joy Visualization and Graphics Research Group Department of Computer Science University of California, Davis A fundamental

More information

Chapter 1. Linear Equations and Straight Lines. 2 of 71. Copyright 2014, 2010, 2007 Pearson Education, Inc.

Chapter 1. Linear Equations and Straight Lines. 2 of 71. Copyright 2014, 2010, 2007 Pearson Education, Inc. Chapter 1 Linear Equations and Straight Lines 2 of 71 Outline 1.1 Coordinate Systems and Graphs 1.4 The Slope of a Straight Line 1.3 The Intersection Point of a Pair of Lines 1.2 Linear Inequalities 1.5

More information

Two Dimensional Viewing

Two Dimensional Viewing Two Dimensional Viewing Dr. S.M. Malaek Assistant: M. Younesi Two Dimensional Viewing Basic Interactive Programming Basic Interactive Programming User controls contents, structure, and appearance of objects

More information

Roll No. : Invigilator's Signature :.. GRAPHICS AND MULTIMEDIA. Time Allotted : 3 Hours Full Marks : 70

Roll No. : Invigilator's Signature :.. GRAPHICS AND MULTIMEDIA. Time Allotted : 3 Hours Full Marks : 70 Name : Roll No. : Invigilator's Signature :.. CS/MCA/SEM-4/MCA-402/2012 2012 GRAPHICS AND MULTIMEDIA Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks. Candidates are

More information

4.5 VISIBLE SURFACE DETECTION METHODES

4.5 VISIBLE SURFACE DETECTION METHODES 4.5 VISIBLE SURFACE DETECTION METHODES A major consideration in the generation of realistic graphics displays is identifying those parts of a scene that are visible from a chosen viewing position. There

More information

Sung-Eui Yoon ( 윤성의 )

Sung-Eui Yoon ( 윤성의 ) CS380: Computer Graphics Clipping and Culling Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/cg/ Class Objectives Understand clipping and culling Understand view-frustum, back-face

More information

UNIT 2 2D TRANSFORMATIONS

UNIT 2 2D TRANSFORMATIONS UNIT 2 2D TRANSFORMATIONS Introduction With the procedures for displaying output primitives and their attributes, we can create variety of pictures and graphs. In many applications, there is also a need

More information

(Refer Slide Time: 00:02:00)

(Refer Slide Time: 00:02:00) Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 18 Polyfill - Scan Conversion of a Polygon Today we will discuss the concepts

More information

Part IV. 2D Clipping

Part IV. 2D Clipping Part IV 2D Clipping The Liang-Barsky algorithm Boolean operations on polygons Outline The Liang-Barsky algorithm Boolean operations on polygons Clipping The goal of clipping is mainly to eliminate parts

More information

Cs602-computer graphics MCQS MIDTERM EXAMINATION SOLVED BY ~ LIBRIANSMINE ~

Cs602-computer graphics MCQS MIDTERM EXAMINATION SOLVED BY ~ LIBRIANSMINE ~ Cs602-computer graphics MCQS MIDTERM EXAMINATION SOLVED BY ~ LIBRIANSMINE ~ Question # 1 of 10 ( Start time: 08:04:29 PM ) Total Marks: 1 Sutherland-Hodgeman clipping algorithm clips any polygon against

More information

Clipping. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Clipping. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015 Clipping 1 Objectives Clipping lines First of implementation algorithms Clipping polygons (next lecture) Focus on pipeline plus a few classic algorithms 2 Clipping 2D against clipping window 3D against

More information

Overview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal

Overview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal Overview Pipeline implementation I Preliminaries Clipping Line clipping Hidden Surface removal Overview At end of the geometric pipeline, vertices have been assembled into primitives Must clip out primitives

More information

8. Hidden Surface Elimination

8. Hidden Surface Elimination 8. Hidden Surface Elimination Identification and Removal of parts of picture that are not visible from a chosen viewing position. 1 8. Hidden Surface Elimination Basic idea: Overwriting Paint things in

More information

Examples. Clipping. The Rendering Pipeline. View Frustum. Normalization. How it is done. Types of operations. Removing what is not seen on the screen

Examples. Clipping. The Rendering Pipeline. View Frustum. Normalization. How it is done. Types of operations. Removing what is not seen on the screen Computer Graphics, Lecture 0 November 7, 006 Eamples Clipping Types of operations Accept Reject Clip Removing what is not seen on the screen The Rendering Pipeline The Graphics pipeline includes one stage

More information

Answer Key: Three-Dimensional Cross Sections

Answer Key: Three-Dimensional Cross Sections Geometry A Unit Answer Key: Three-Dimensional Cross Sections Name Date Objectives In this lesson, you will: visualize three-dimensional objects from different perspectives be able to create a projection

More information

COMPUTATIONAL GEOMETRY

COMPUTATIONAL GEOMETRY Thursday, September 20, 2007 (Ming C. Lin) Review on Computational Geometry & Collision Detection for Convex Polytopes COMPUTATIONAL GEOMETRY (Refer to O'Rourke's and Dutch textbook ) 1. Extreme Points

More information

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives.

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives. D Graphics Primitives Eye sees Displays - CRT/LCD Frame buffer - Addressable pixel array (D) Graphics processor s main function is to map application model (D) by projection on to D primitives: points,

More information

Section 18-1: Graphical Representation of Linear Equations and Functions

Section 18-1: Graphical Representation of Linear Equations and Functions Section 18-1: Graphical Representation of Linear Equations and Functions Prepare a table of solutions and locate the solutions on a coordinate system: f(x) = 2x 5 Learning Outcome 2 Write x + 3 = 5 as

More information

(Refer Slide Time: 00:02:02)

(Refer Slide Time: 00:02:02) Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 20 Clipping: Lines and Polygons Hello and welcome everybody to the lecture

More information

Graphs and Linear Functions

Graphs and Linear Functions Graphs and Linear Functions A -dimensional graph is a visual representation of a relationship between two variables given by an equation or an inequality. Graphs help us solve algebraic problems by analysing

More information

form are graphed in Cartesian coordinates, and are graphed in Cartesian coordinates.

form are graphed in Cartesian coordinates, and are graphed in Cartesian coordinates. Plot 3D Introduction Plot 3D graphs objects in three dimensions. It has five basic modes: 1. Cartesian mode, where surfaces defined by equations of the form are graphed in Cartesian coordinates, 2. cylindrical

More information

Chapter - 2: Geometry and Line Generations

Chapter - 2: Geometry and Line Generations Chapter - 2: Geometry and Line Generations In Computer graphics, various application ranges in different areas like entertainment to scientific image processing. In defining this all application mathematics

More information

CS452/552; EE465/505. Clipping & Scan Conversion

CS452/552; EE465/505. Clipping & Scan Conversion CS452/552; EE465/505 Clipping & Scan Conversion 3-31 15 Outline! From Geometry to Pixels: Overview Clipping (continued) Scan conversion Read: Angel, Chapter 8, 8.1-8.9 Project#1 due: this week Lab4 due:

More information

9. Visible-Surface Detection Methods

9. Visible-Surface Detection Methods 9. Visible-Surface Detection Methods More information about Modelling and Perspective Viewing: Before going to visible surface detection, we first review and discuss the followings: 1. Modelling Transformation:

More information

Page 1. Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms

Page 1. Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms Visible Surface Determination Visibility Culling Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms Divide-and-conquer strategy:

More information

About Graphing Lines

About Graphing Lines About Graphing Lines TABLE OF CONTENTS About Graphing Lines... 1 What is a LINE SEGMENT?... 1 Ordered Pairs... 1 Cartesian Co-ordinate System... 1 Ordered Pairs... 2 Line Segments... 2 Slope of a Line

More information

A Procedure to Clip Line Segment

A Procedure to Clip Line Segment Vol.5, No.1 (2014), pp.9-20 http://dx.doi.org/10.14257/ijcg.2014.5.1.02 A Procedure to Clip Line Segment Bimal Kumar Ray School of Information Technology & Engineering VIT University, Vellore 632014, India

More information

Computer Graphics II

Computer Graphics II Computer Graphics II Autumn 2017-2018 Outline Visible Surface Determination Methods (contd.) 1 Visible Surface Determination Methods (contd.) Outline Visible Surface Determination Methods (contd.) 1 Visible

More information

Clipping and Intersection

Clipping and Intersection Clipping and Intersection Clipping: Remove points, line segments, polygons outside a region of interest. Need to discard everything that s outside of our window. Point clipping: Remove points outside window.

More information

CEng 477 Introduction to Computer Graphics Fall 2007

CEng 477 Introduction to Computer Graphics Fall 2007 Visible Surface Detection CEng 477 Introduction to Computer Graphics Fall 2007 Visible Surface Detection Visible surface detection or hidden surface removal. Realistic scenes: closer objects occludes the

More information

Math 2 Coordinate Geometry Part 3 Inequalities & Quadratics

Math 2 Coordinate Geometry Part 3 Inequalities & Quadratics Math 2 Coordinate Geometry Part 3 Inequalities & Quadratics 1 DISTANCE BETWEEN TWO POINTS - REVIEW To find the distance between two points, use the Pythagorean theorem. The difference between x 1 and x

More information

Computer Graphics Geometry and Transform

Computer Graphics Geometry and Transform ! Computer Graphics 2014! 5. Geometry and Transform Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2014-10-11! Today outline Triangle rasterization Basic vector algebra ~ geometry! Antialiasing

More information

Lecture 25: Bezier Subdivision. And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10

Lecture 25: Bezier Subdivision. And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10 Lecture 25: Bezier Subdivision And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10 1. Divide and Conquer If we are going to build useful

More information

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU FROM VERTICES TO FRAGMENTS Lecture 5 Comp3080 Computer Graphics HKBU OBJECTIVES Introduce basic implementation strategies Clipping Scan conversion OCTOBER 9, 2011 2 OVERVIEW At end of the geometric pipeline,

More information

Chap 7, 2008 Spring Yeong Gil Shin

Chap 7, 2008 Spring Yeong Gil Shin Three-Dimensional i Viewingi Chap 7, 28 Spring Yeong Gil Shin Viewing i Pipeline H d fi i d? How to define a window? How to project onto the window? Rendering "Create a picture (in a synthetic camera)

More information

From 3D World to 2D Screen. Hendrik Speleers

From 3D World to 2D Screen. Hendrik Speleers Hendrik Speleers Overview Synthetic camera Rendering pipeline World window versus viewport Clipping Cohen-Sutherland algorithm Rasterizing Bresenham algorithm Three different actors in a scene Objects:

More information

Appendix E Calculating Normal Vectors

Appendix E Calculating Normal Vectors OpenGL Programming Guide (Addison-Wesley Publishing Company) Appendix E Calculating Normal Vectors This appendix describes how to calculate normal vectors for surfaces. You need to define normals to use

More information

Computing Visibility. Backface Culling for General Visibility. One More Trick with Planes. BSP Trees Ray Casting Depth Buffering Quiz

Computing Visibility. Backface Culling for General Visibility. One More Trick with Planes. BSP Trees Ray Casting Depth Buffering Quiz Computing Visibility BSP Trees Ray Casting Depth Buffering Quiz Power of Plane Equations We ve gotten a lot of mileage out of one simple equation. Basis for D outcode-clipping Basis for plane-at-a-time

More information

Computer Graphics (CS 543) Lecture 10 (Part 1): 3D Clipping. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Computer Graphics (CS 543) Lecture 10 (Part 1): 3D Clipping. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI) Computer Graphics (CS 543) Lecture 10 (Part 1): 3D Clipping Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Liang Barsky 3D Clipping Goal: Clip object edge-by-edge against

More information

SE Mock Online Test 1-CG

SE Mock Online Test 1-CG SE Mock Online Test 1-CG 1. Email address * 2. 1. For gentle slope line, slope m is -1

More information

(a) rotating 45 0 about the origin and then translating in the direction of vector I by 4 units and (b) translating and then rotation.

(a) rotating 45 0 about the origin and then translating in the direction of vector I by 4 units and (b) translating and then rotation. Code No: R05221201 Set No. 1 1. (a) List and explain the applications of Computer Graphics. (b) With a neat cross- sectional view explain the functioning of CRT devices. 2. (a) Write the modified version

More information

Midterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer

Midterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer Midterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer The exam consists of 10 questions. There are 2 points per question for a total of 20 points. You

More information

Edge linking. Two types of approaches. This process needs to be able to bridge gaps in detected edges due to the reason mentioned above

Edge linking. Two types of approaches. This process needs to be able to bridge gaps in detected edges due to the reason mentioned above Edge linking Edge detection rarely finds the entire set of edges in an image. Normally there are breaks due to noise, non-uniform illumination, etc. If we want to obtain region boundaries (for segmentation)

More information

LINEAR PROGRAMMING: A GEOMETRIC APPROACH. Copyright Cengage Learning. All rights reserved.

LINEAR PROGRAMMING: A GEOMETRIC APPROACH. Copyright Cengage Learning. All rights reserved. 3 LINEAR PROGRAMMING: A GEOMETRIC APPROACH Copyright Cengage Learning. All rights reserved. 3.1 Graphing Systems of Linear Inequalities in Two Variables Copyright Cengage Learning. All rights reserved.

More information

Computer Vision. Image Segmentation. 10. Segmentation. Computer Engineering, Sejong University. Dongil Han

Computer Vision. Image Segmentation. 10. Segmentation. Computer Engineering, Sejong University. Dongil Han Computer Vision 10. Segmentation Computer Engineering, Sejong University Dongil Han Image Segmentation Image segmentation Subdivides an image into its constituent regions or objects - After an image has

More information

Presented by Konstantinos Georgiadis

Presented by Konstantinos Georgiadis Presented by Konstantinos Georgiadis Abstract This method extends the Hierarchical Radiosity approach for environments whose geometry and surface attributes changes dynamically. Major contributions It

More information

2D Image Synthesis. 2D image synthesis. Raster graphics systems. Modeling transformation. Vectorization. u x u y 0. o x o y 1

2D Image Synthesis. 2D image synthesis. Raster graphics systems. Modeling transformation. Vectorization. u x u y 0. o x o y 1 General scheme of a 2D CG application 2D Image Synthesis Balázs Csébfalvi modeling image synthesis Virtual world model world defined in a 2D plane Department of Control Engineering and Information Technology

More information

MET71 COMPUTER AIDED DESIGN

MET71 COMPUTER AIDED DESIGN UNIT - II BRESENHAM S ALGORITHM BRESENHAM S LINE ALGORITHM Bresenham s algorithm enables the selection of optimum raster locations to represent a straight line. In this algorithm either pixels along X

More information

Review for Mastery Using Graphs and Tables to Solve Linear Systems

Review for Mastery Using Graphs and Tables to Solve Linear Systems 3-1 Using Graphs and Tables to Solve Linear Systems A linear system of equations is a set of two or more linear equations. To solve a linear system, find all the ordered pairs (x, y) that make both equations

More information

Topics. From vertices to fragments

Topics. From vertices to fragments Topics From vertices to fragments From Vertices to Fragments Assign a color to every pixel Pass every object through the system Required tasks: Modeling Geometric processing Rasterization Fragment processing

More information

Raster Displays and Scan Conversion. Computer Graphics, CSCD18 Fall 2008 Instructor: Leonid Sigal

Raster Displays and Scan Conversion. Computer Graphics, CSCD18 Fall 2008 Instructor: Leonid Sigal Raster Displays and Scan Conversion Computer Graphics, CSCD18 Fall 28 Instructor: Leonid Sigal Rater Displays Screen is represented by 2D array of locations called piels y Rater Displays Screen is represented

More information

More on Coordinate Systems. Coordinate Systems (3) Coordinate Systems (2) Coordinate Systems (5) Coordinate Systems (4) 9/15/2011

More on Coordinate Systems. Coordinate Systems (3) Coordinate Systems (2) Coordinate Systems (5) Coordinate Systems (4) 9/15/2011 Computer Graphics using OpenGL, Chapter 3 Additional Drawing Tools More on Coordinate Systems We have been using the coordinate system of the screen window (in pixels). The range is from 0 (left) to some

More information

Polygon Triangulation

Polygon Triangulation Polygon Triangulation Definition Simple Polygons 1. A polygon is the region of a plane bounded by a finite collection of line segments forming a simple closed curve. 2. Simple closed curve means a certain

More information

Three Dimensional Geometry. Linear Programming

Three Dimensional Geometry. Linear Programming Three Dimensional Geometry Linear Programming A plane is determined uniquely if any one of the following is known: The normal to the plane and its distance from the origin is given, i.e. equation of a

More information

Lab Manual. Computer Graphics. T.E. Computer. (Sem VI)

Lab Manual. Computer Graphics. T.E. Computer. (Sem VI) Lab Manual Computer Graphics T.E. Computer (Sem VI) Index Sr. No. Title of Programming Assignments Page No. 1. Line Drawing Algorithms 3 2. Circle Drawing Algorithms 6 3. Ellipse Drawing Algorithms 8 4.

More information

Must first specify the type of projection desired. When use parallel projections? For technical drawings, etc. Specify the viewing parameters

Must first specify the type of projection desired. When use parallel projections? For technical drawings, etc. Specify the viewing parameters walters@buffalo.edu CSE 480/580 Lecture 4 Slide 3-D Viewing Continued Eamples of 3-D Viewing Must first specif the tpe of projection desired When use parallel projections? For technical drawings, etc.

More information

CSCI 4620/8626. Coordinate Reference Frames

CSCI 4620/8626. Coordinate Reference Frames CSCI 4620/8626 Computer Graphics Graphics Output Primitives Last update: 2014-02-03 Coordinate Reference Frames To describe a picture, the world-coordinate reference frame (2D or 3D) must be selected.

More information

SNAP Centre Workshop. Graphing Lines

SNAP Centre Workshop. Graphing Lines SNAP Centre Workshop Graphing Lines 45 Graphing a Line Using Test Values A simple way to linear equation involves finding test values, plotting the points on a coordinate plane, and connecting the points.

More information

Computer Graphics Course Notes

Computer Graphics Course Notes Clipping Algorithms Real world objects can be represented relative to a reference world coordinate system. It is difficult to view all the objects on computer screen at the same time in one screen shot

More information

= f (a, b) + (hf x + kf y ) (a,b) +

= f (a, b) + (hf x + kf y ) (a,b) + Chapter 14 Multiple Integrals 1 Double Integrals, Iterated Integrals, Cross-sections 2 Double Integrals over more general regions, Definition, Evaluation of Double Integrals, Properties of Double Integrals

More information

Haga's Origamics. Haga's Origamics are a series of activities designed to illustrate the science behind simple paper folding.

Haga's Origamics. Haga's Origamics are a series of activities designed to illustrate the science behind simple paper folding. Haga's Origamics Haga's Origamics are a series of activities designed to illustrate the science behind simple paper folding. Activity I : TUPS (Turned-Up Parts) Take a square piece of paper and label the

More information

Intermediate Mathematics League of Eastern Massachusetts

Intermediate Mathematics League of Eastern Massachusetts Meet # January 010 Intermediate Mathematics League of Eastern Massachusetts Meet # January 010 Category 1 - Mystery Meet #, January 010 1. Of all the number pairs whose sum equals their product, what is

More information

CS488 2D Graphics. Luc RENAMBOT

CS488 2D Graphics. Luc RENAMBOT CS488 2D Graphics Luc RENAMBOT 1 Topics Last time, hardware and frame buffer Now, how lines and polygons are drawn in the frame buffer. Then, how 2D and 3D models drawing into the frame buffer Then, more

More information

.(3, 2) Co-ordinate Geometry Co-ordinates. Every point has two co-ordinates. Plot the following points on the plane. A (4, 1) D (2, 5) G (6, 3)

.(3, 2) Co-ordinate Geometry Co-ordinates. Every point has two co-ordinates. Plot the following points on the plane. A (4, 1) D (2, 5) G (6, 3) Co-ordinate Geometry Co-ordinates Every point has two co-ordinates. (3, 2) x co-ordinate y co-ordinate Plot the following points on the plane..(3, 2) A (4, 1) D (2, 5) G (6, 3) B (3, 3) E ( 4, 4) H (6,

More information

Viewing Transformation. Clipping. 2-D Viewing Transformation

Viewing Transformation. Clipping. 2-D Viewing Transformation Viewing Transformation Clipping 2-D Viewing Transformation 2-D Viewing Transformation Convert from Window Coordinates to Viewport Coordinates (xw, yw) --> (xv, yv) Maps a world coordinate window to a screen

More information

From Vertices to Fragments: Rasterization. Reading Assignment: Chapter 7. Special memory where pixel colors are stored.

From Vertices to Fragments: Rasterization. Reading Assignment: Chapter 7. Special memory where pixel colors are stored. From Vertices to Fragments: Rasterization Reading Assignment: Chapter 7 Frame Buffer Special memory where pixel colors are stored. System Bus CPU Main Memory Graphics Card -- Graphics Processing Unit (GPU)

More information

Trimmed Surfaces Maya 2013

Trimmed Surfaces Maya 2013 2000-2013 Michael O'Rourke Trimmed Surfaces Maya 2013 Concepts Trimming works only on patches (in Maya, this means NURBS patches) Does not work with polygonal models A trim can look similar to a Boolean

More information