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

Size: px
Start display at page:

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

Transcription

1 Clipping Concepts, Algorithms for line clipping 1 of 16

2 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 both endpoints in, do trivial acceptance if one endpoint inside, one outside, must clip if both endpoints out, don t know Brute force clip: solve simultaneous equations using four line and four clip edges slope-intercept formula handles infinite lines only doesn t handle vertical lines 2 of 16

3 Parametric Line Formulation For Clipping Parametric form for line segment Line is in clip rectangle if parametric variables t line and s edge both in [0,1] at intersection point between line and edge of clip rectangle Slow, must intersect lines with all edges 3 of 16

4 CS123 INTRODUCTION TO COMPUTER GRAPHICS Cohen-Sutherland Line Clipping in 2D Divide plane into 9 regions Compute the sign bit of 4 comparisons between a vertex and an edge y max y; y y min ; x max x; x x min Point lies inside only if all four sign bits are 0, otherwise exceeds edge 4 bit outcode records results of four bounds tests: First bit: above top edge Second bit: below bottom edge Third bit: to the right of right edge Fourth bit: to the left of left edge Clip Rectangle Compute outcodes for both vertices of each line (denoted OC 0 and OC 1 ) Lines with OC 0 = 0 (i.e., 0000) and OC 1 = 0 can be trivially accepted. Lines lying entirely in a half plane outside an edge can be trivially rejected if (OC 0 AND OC 1 ) 0 (i.e., they share an outside bit) 4 of 16

5 Cohen-Sutherland Line Clipping in 3D Very similar to 2D Divide volume into 27 regions 6-bit outcode records results of 6 bounds tests First bit: behind back plane: Z - Zmin Second bit: in front of front plane: Zmax -Z Third bit: above top plane: Ymax - Y Fourth bit: below bottom plane: Y - Ymin Fifth bit: to the right of right plane: Xmax -X Sixth bit: to the left of left plane: X - Xmin Again, lines with OC 0 = 0 and OC 1 = 0 can be trivially accepted Lines lying entirely in a volume outside of a plane can be trivially rejected: OC 0 AND OC 1 0 (i.e., they share an outside bit) Back plane (in front) (behind) Top plane (above) (below) Right plane (to left of) (to right of) Front plane (in front) (behind) Bottom plane (above) (below) Left plane (to left of) (to right of) 5 of 16

6 CS123 INTRODUCTION TO COMPUTER GRAPHICS Cohen-Sutherland Algorithm (1/3) If we can neither trivially accept/reject (T/A, T/R), divide and conquer Subdivide line into two segments; then T/A or T/R one or both segments: use a clip edge to cut line use outcodes to choose the edges that are crossed for a given clip edge, if a line s two outcodes differ in the corresponding bit, the line has one vertex on each side of the edge, thus crosses pick an order for checking edges: top bottom right left compute the intersection point the clip edge fixes either x or y can substitute into the line equation iterate for the newly shortened line, extra clips may happen (e.g., E-I at H) D C E B A Clip rectangle F G H I 6 of 16

7 Cohen-Sutherland Algorithm (2/3) ComputeOutCode(x0, y0, outcode0); ComputeOutCode(x1, y1, outcode1); repeat check for trivial reject or trivial accept pick the point that is outside the clip rectangle if TOP then x = x0 + (x1 x0) * (ymax y0) / (y1 y0); y = ymax; else if BOTTOM then x = x0 + (x1 x0) * (ymin y0) / (y1 y0); y = ymin; else if RIGHT then y = y0 + (y1 y0) * (xmax x0) / (x1 x0); x = xmax; else if LEFT then y = y0 + (y1 y0) * (xmin x0) / (x1 x0); x = xmin; if (x0, y0 is the outer point) then x0 = x; y0 = y; ComputeOutCode(x0, y0, outcode0) else x1 = x; y1 = y; ComputeOutCode(x1, y1, outcode1) until done 7 of 16

8 Cohen-Sutherland Algorithm (3/3) Similar algorithm for using 3D outcodes to clip against canonical parallel view volume: xmin = ymin = -1; xmax = ymax = 1; zmin = -1; zmax = 0; ComputeOutCode(x0, y0, z0, outcode0); ComputeOutCode(x1, y1, z1, outcode1); repeat check for trivial reject or trivial accept pick the point that is outside the clip rectangle if TOP then x = x0 + (x1 x0) * (ymax y0) / (y1 y0); z = z0 + (z1 z0) * (ymax y0) / (y1 y0); y = ymax; else if BOTTOM then x = x0 + (x1 x0) * (ymin y0) / (y1 y0); z = z0 + (z1 z0) * (ymin y0) / (y1 y0); y = ymin; else if RIGHT then y = y0 + (y1 y0) * (xmax x0) / (x1 x0); z = z0 + (z1 z0) * (xmax x0) / (x1 x0); x = xmax; else if LEFT then y = y0 + (y1 y0) * (xmin x0) / (x1 x0); z = z0 + (z1 z0) * (xmin x0) / (x1 x0); x = xmin; else if NEAR then x = x0 + (x1 x0) * (zmax z0) / (z1 z0); y = y0 + (y1 y0) * (zmax z0) / (z1 z0); z = zmax; else if FAR then x = x0 + (x1 x0) * (zmin z0) / (z1 z0); y = y0 + (y1 y0) * (zmin z0) / (z1 z0); z = zmin; if (x0, y0, z0 is the outer point) then x0 = x; y0 = y; z0 = z; ComputeOutCode(x0, y0, z0, outcode0) else x1 = x; y1 = y; z1 = z; ComputeOutCode(x1, y1, z1, outcode1) until done 8 of 16

9 Scan Conversion after Clipping Clip rectangle Don t round and then scan convert, because the line will have the wrong slope: calculate decision variable based on pixel chosen on left edge (remember: y = mx + B) Horizontal edge problem: Clipping/rounding produces pixel A; to get pixel B, round up x of the intersection of line with y = y min ½ and pick pixel above: x = x min y = y min y = y min 1/2 y = y min 1 B A 9 of 16

10 Sutherland-Hodgman Polygon Clipping The 2D Sutherland-Hodgman algorithm generalizes to higher dimensions We can use it to clip polygons to the 3D view volume one plane at a time Section 36.5 in textbook BALSA demonstration: 10 of 16

11 Cyrus-Beck/Liang-Barsky Parametric Line Clipping (1/3) 11 of 16

12 Cyrus-Beck/Liang-Barsky Parametric Line Clipping (2/3) Now solve for the value of t at the intersection of P 0 P 1 with the edge E i : First, substitute for P(t) with P 0 + (P 1 P 0 )t: Next, group terms and distribute dot product: Let D be the vector from P 0 to P 1 = (P 1 P 0 ), and solve for t: note that this gives a valid value of t only if the denominator of the expression is nonzero. For this to be true, it must be the case that: N i 0 (that is, the normal should not be 0; this could occur only as a mistake) D 0 (that is, P 1 P 0 ) N i D 0 (edge E i and line D are not parallel; if they are, no intersection). The algorithm checks these conditions. 12 of 16

13 Cyrus-Beck/Liang-Barsky Parametric Line Clipping (3/3) Eliminate all t s outside [0, 1] on the line Of remaining t s which produce interior intersections? Can t just take the innermost t values! Move from P 0 to P 1 ; for a given edge, just before crossing: If N i D < 0 Potentially Entering (PE); If N i D > 0 Potentially Leaving (PL) Pick inner PE/PL pair: t E for P PE with max t, t L for P PL with min t, and t E > 0, t L < 1 If t L < t E, no intersection 13 of 16

14 Cyrus-Beck/Liang-Barsky Line Clipping Algorithm Pre-calculate N i and select P Ei for each edge; for each line segment to be clipped if P 1 = P 0 then line is degenerate so clip as a point; else begin t E = 0; t L = 1; for each candidate intersection with a clip edge if Ni D 0 then {Ignore edges parallel to line} begin calculate t; {of line and clip edge intersection} use sign of N i D to categorize as PE or PL; if PE then t E = max(t E,t); if PL then t L = min(t L,t); end if t E > t L then return nil else return P(t E ) and P(t L ) as true clip intersections end 14 of 16

15 Parametric Line Clipping for Upright Clip Rectangle (1/2) D = P 1 P 0 = (x 1 x 0, y 1 y 0 ) Leave P Ei as an arbitrary point on clip edge: it s a free variable and drops out Calculations for Parametric Line Clipping Algorithm Clip Edge i Normal N i P Ei P 0 -P Ei t N i ( P P ) 0 Ei N D i left: x = x min (-1,0) (x min, y) (x 0 - x min,y 0 -y) ( x x ) 0 min ( x x ) 1 0 right: x = x max (1,0) (x max,y) (x 0 - x max,y 0 -y) ( x x ) 0 max ( x x ) 1 0 bottom: y = y min (0,-1) (x, y min ) (x 0 -x,y 0 - y min ) ( y y ) 0 min ( y y ) 1 0 top: y = y max (0,1) (x, y max ) (x 0 -x,y 0 - y max ) ( y y ) 0 max ( y y ) of 16

16 Parametric Line Clipping for Upright Clip Rectangle (2/2) Examine t: Numerator is just the directed distance to an edge; sign corresponds to OC Denominator is just the horizontal or vertical projection of the line, dx or dy; sign determines PE or PL for a given edge Ratio is constant of proportionality: how far over from P 0 to P 1 intersection is relative to dx or dy 16 of 16

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

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

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

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

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

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

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

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

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

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

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

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

Clipping Points Consider a clip window which is rectangular in shape. P(x, y) is a point to be displayed. 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

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

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

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

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

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

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

Lesson 8 - Practice Problems

Lesson 8 - Practice Problems Lesson 8 - Practice Problems Section 8.1: A Case for the Quadratic Formula 1. For each quadratic equation below, show a graph in the space provided and circle the number and type of solution(s) to that

More information

Lecture 7 of 41. Viewing 4 of 4: Culling and Clipping Lab 1b: Flash Intro

Lecture 7 of 41. Viewing 4 of 4: Culling and Clipping Lab 1b: Flash Intro Viewing 4 of 4: Culling and Clipping Lab 1b: Flash Intro William H. Hsu Department of Computing and Information Sciences, KSU KSOL course pages: http://bit.ly/hgvxlh / http://bit.ly/evizre Public mirror

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

Computer Graphics Geometry and Transform

Computer Graphics Geometry and Transform Computer Graphics 2012 5. Geometry and Transform Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2012-09-26 上机实践 地址 :ftp://give.zju.edu.cn 用户 :cgzhang 密码 :cgzhang 请大家把上机作业结果和报告内容, 上传至 学号 _ 姓名

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

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

Announcements. Midterms graded back at the end of class Help session on Assignment 3 for last ~20 minutes of class. Computer Graphics

Announcements. Midterms graded back at the end of class Help session on Assignment 3 for last ~20 minutes of class. Computer Graphics Announcements Midterms graded back at the end of class Help session on Assignment 3 for last ~20 minutes of class 1 Scan Conversion Overview of Rendering Scan Conversion Drawing Lines Drawing Polygons

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

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

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

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

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

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

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

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

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

Computer Graphics. Brian Wyvill. Clipping. cpsc/enel P 1 H K AB AC DE FG HI JK

Computer Graphics. Brian Wyvill. Clipping. cpsc/enel P 1 H K AB AC DE FG HI JK Comuter Grahic 1001 A 1000 F 1010 0001 0000 0010 G E C B D 0101 H 0100 0110 K I J P2 P3 Outide Inide P4 P1 Cliing by AB AC DE FG HI JK 1001 1001 0000 0000 0101 0110 0000 0001 0000 1000 0010 0110 AND 0000

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

CSE328 Fundamentals of Computer Graphics

CSE328 Fundamentals of Computer Graphics CSE328 Fundamentals of Computer Graphics Hong Qin State University of New York at Stony Brook (Stony Brook University) Stony Brook, New York 794--44 Tel: (63)632-845; Fax: (63)632-8334 qin@cs.sunysb.edu

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

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CSE528 Computer Graphics: Theory, Algorithms, and Applications CSE528 Computer Graphics: Theory, Algorithms, and Applications Hong Qin Stony Brook University (SUNY at Stony Brook) Stony Brook, New York 11794-2424 Tel: (631)632-845; Fax: (631)632-8334 qin@cs.stonybrook.edu

More information

Binghamton University. EngiNet. Thomas J. Watson. School of Engineering and Applied Science. Computer Graphics. State University of New York.

Binghamton University. EngiNet. Thomas J. Watson. School of Engineering and Applied Science. Computer Graphics. State University of New York. Binghamton University EngiNet State University of New York EngiNet Thomas J. Watson School of Engineering and Applied Science WARNING All rights reserved. No Part of this video lecture series may be reproduced

More information

Math 1313 Prerequisites/Test 1 Review

Math 1313 Prerequisites/Test 1 Review Math 1313 Prerequisites/Test 1 Review Test 1 (Prerequisite Test) is the only exam that can be done from ANYWHERE online. Two attempts. See Online Assignments in your CASA account. Note the deadline too.

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

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

2D Graphics Primitives II. Additional issues in scan converting lines. 1)Endpoint order. Want algorithms to draw the same pixels for each line

2D Graphics Primitives II. Additional issues in scan converting lines. 1)Endpoint order. Want algorithms to draw the same pixels for each line walters@buffalo.edu CSE 480/580 Lecture 8 Slide 1 2D Graphics Primitives II Additional issues in scan converting lines 1)Endpoint order Want algorithms to draw the same pixels for each line How handle?

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

Scan Converting Lines

Scan Converting Lines Scan Conversion 1 Scan Converting Lines Line Drawing Draw a line on a raster screen between two points What s wrong with the statement of the problem? it doesn t say anything about which points are allowed

More information

Computer Graphics and GPGPU Programming

Computer Graphics and GPGPU Programming Computer Graphics and GPGPU Programming Donato D Ambrosio Department of Mathematics and Computer Science and Center of Excellence for High Performace Computing Cubo 22B, University of Calabria, Rende 87036,

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

Illumination Models III: Ray Tracing (View Dependent Global Illumination)

Illumination Models III: Ray Tracing (View Dependent Global Illumination) Illumination Models III: Ray Tracing (View Dependent Global Illumination) The University of Texas at Austin 1 Basic Definitions Ray Tracing/Casting: Setting: eyepoint, virtual screen (an array of virtual

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

Section 1.6. Inverse Functions

Section 1.6. Inverse Functions Section 1.6 Inverse Functions Important Vocabulary Inverse function: Let f and g be two functions. If f(g(x)) = x in the domain of g and g(f(x) = x for every x in the domain of f, then g is the inverse

More information

2.3. Graphing Calculators; Solving Equations and Inequalities Graphically

2.3. Graphing Calculators; Solving Equations and Inequalities Graphically 2.3 Graphing Calculators; Solving Equations and Inequalities Graphically Solving Equations and Inequalities Graphically To do this, we must first draw a graph using a graphing device, this is your TI-83/84

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

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

Today. CS-184: Computer Graphics. Lecture #10: Clipping and Hidden Surfaces. Clipping. Hidden Surface Removal

Today. CS-184: Computer Graphics. Lecture #10: Clipping and Hidden Surfaces. Clipping. Hidden Surface Removal Today CS-184: Computer Graphics Lecture #10: Clipping and Hidden Surfaces!! Prof. James O Brien University of California, Berkeley! V2015-S-10-1.0 Clipping Clipping to view volume Clipping arbitrary polygons

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

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

Write C++/Java program to draw line using DDA and Bresenham s algorithm. Inherit pixel class and Use function overloading.

Write C++/Java program to draw line using DDA and Bresenham s algorithm. Inherit pixel class and Use function overloading. Group A Assignment No A1. Write C++/Java program to draw line using DDA and Bresenham s algorithm. Inherit pixel class and Use function overloading. Aim: To draw line using DDA and Bresenham s algorithm

More information

(Section 6.2: Volumes of Solids of Revolution: Disk / Washer Methods)

(Section 6.2: Volumes of Solids of Revolution: Disk / Washer Methods) (Section 6.: Volumes of Solids of Revolution: Disk / Washer Methods) 6.. PART E: DISK METHOD vs. WASHER METHOD When using the Disk or Washer Method, we need to use toothpicks that are perpendicular to

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

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

Topic #1: Rasterization (Scan Conversion)

Topic #1: Rasterization (Scan Conversion) Topic #1: Rasterization (Scan Conversion) We will generally model objects with geometric primitives points, lines, and polygons For display, we need to convert them to pixels for points it s obvious but

More information

Rasterization: Geometric Primitives

Rasterization: Geometric Primitives Rasterization: Geometric Primitives Outline Rasterizing lines Rasterizing polygons 1 Rasterization: What is it? How to go from real numbers of geometric primitives vertices to integer coordinates of pixels

More information

COMP30019 Graphics and Interaction Scan Converting Polygons and Lines

COMP30019 Graphics and Interaction Scan Converting Polygons and Lines COMP30019 Graphics and Interaction Scan Converting Polygons and Lines Department of Computer Science and Software Engineering The Lecture outline Introduction Scan conversion Scan-line algorithm Edge coherence

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

Principles of Computer Graphics. Lecture 3 1

Principles of Computer Graphics. Lecture 3 1 Lecture 3 Principles of Computer Graphics Lecture 3 1 Why we learn computer graphics? Appreciate what we see The knowledge can applied when we want to develop specific engineering program that requires

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

The Traditional Graphics Pipeline

The Traditional Graphics Pipeline Final Projects Proposals due Thursday 4/8 Proposed project summary At least 3 related papers (read & summarized) Description of series of test cases Timeline & initial task assignment The Traditional Graphics

More information

Introduction to Computer Graphics 5. Clipping

Introduction to Computer Graphics 5. Clipping Introduction to Computer Grapics 5. Clipping I-Cen Lin, Assistant Professor National Ciao Tung Univ., Taiwan Textbook: E.Angel, Interactive Computer Grapics, 5 t Ed., Addison Wesley Ref:Hearn and Baker,

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

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

521493S Computer Graphics Exercise 1 (Chapters 1-3)

521493S Computer Graphics Exercise 1 (Chapters 1-3) 521493S Computer Graphics Exercise 1 (Chapters 1-3) 1. Consider the clipping of a line segment defined by the latter s two endpoints (x 1, y 1 ) and (x 2, y 2 ) in two dimensions against a rectangular

More information

What is Clipping? Why do we Clip? Lecture 9 Comp 236 Spring Clipping is an important optimization

What is Clipping? Why do we Clip? Lecture 9 Comp 236 Spring Clipping is an important optimization Clipping, Culling, Picking & Selection Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling Picking Selection Programming Assignment #2 Lecture 9 Comp 236 Spring 2005 What is Clipping?

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

General Hidden Surface Removal Algorithms. Binghamton University. EngiNet. Thomas J. Watson. School of Engineering and Applied Science CS 460/560

General Hidden Surface Removal Algorithms. Binghamton University. EngiNet. Thomas J. Watson. School of Engineering and Applied Science CS 460/560 Binghamton University EngiNet State University of New York EngiNet Thomas J. Watson School of Engineering and Applied Science WARNING All rights reserved. No Part of this video lecture series may be reproduced

More information

The Traditional Graphics Pipeline

The Traditional Graphics Pipeline Last Time? The Traditional Graphics Pipeline Participating Media Measuring BRDFs 3D Digitizing & Scattering BSSRDFs Monte Carlo Simulation Dipole Approximation Today Ray Casting / Tracing Advantages? Ray

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

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination (Total: 100 marks) Figure 1: A perspective view of a polyhedron on an infinite plane. Cameras and Perspective Rendering

More information

Computer Graphics. - Rasterization - Philipp Slusallek

Computer Graphics. - Rasterization - Philipp Slusallek Computer Graphics - Rasterization - Philipp Slusallek Rasterization Definition Given some geometry (point, 2D line, circle, triangle, polygon, ), specify which pixels of a raster display each primitive

More information

Rasteriza2on and Clipping

Rasteriza2on and Clipping Overview Scan conversion Computer Graphics Rasterizaon and Clipping Polygon filling Clipping in D Aleksandra Pizurica Raster Display PIEL (picture element) RASTER (a rectangular array of points or dots)

More information

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination (Total: 100 marks)

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination (Total: 100 marks) CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination (Total: 100 marks) Cameras and Perspective Figure 1: A perspective view of a polyhedron on an infinite plane. Rendering

More information

Z- Buffer Store the depth for each pixel on the screen and compare stored value with depth of new pixel being drawn.

Z- Buffer Store the depth for each pixel on the screen and compare stored value with depth of new pixel being drawn. Andrew Lewis - Graphics Revision Keywords PIXEL FRAME BUFFER memory of the screen VIDEO - SCREEN - WINDOW - POLYGON filled area bound by straight lines SPLINE bit of wood used by draughtsmen to draw curves

More information

COMP3421. Vector geometry, Clipping

COMP3421. Vector geometry, Clipping COMP3421 Vector geometry, Clipping Transformations Object in model co-ordinates Transform into world co-ordinates Represent points in object as 1D Matrices Multiply by matrices to transform them Coordinate

More information

Rasterization, or What is glbegin(gl_lines) really doing?

Rasterization, or What is glbegin(gl_lines) really doing? Rasterization, or What is glbegin(gl_lines) really doing? Course web page: http://goo.gl/eb3aa February 23, 2012 Lecture 4 Outline Rasterizing lines DDA/parametric algorithm Midpoint/Bresenham s algorithm

More information

Hidden Surfaces II. Week 9, Mon Mar 15

Hidden Surfaces II. Week 9, Mon Mar 15 University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Hidden Surfaces II Week 9, Mon Mar 15 http://www.ugrad.cs.ubc.ca/~cs314/vjan2010 ews yes, I'm granting the request

More information

Polygon Filling. Can write frame buffer one word at time rather than one bit. 2/3/2000 CS 4/57101 Lecture 6 1

Polygon Filling. Can write frame buffer one word at time rather than one bit. 2/3/2000 CS 4/57101 Lecture 6 1 Polygon Filling 2 parts to task which pixels to fill what to fill them with First consider filling unclipped primitives with solid color Which pixels to fill consider scan lines that intersect primitive

More information

Graphing with a Graphing Calculator

Graphing with a Graphing Calculator APPENDIX C Graphing with a Graphing Calculator A graphing calculator is a powerful tool for graphing equations and functions. In this appendix we give general guidelines to follow and common pitfalls to

More information

Graphing Linear Equations

Graphing Linear Equations Graphing Linear Equations Question 1: What is a rectangular coordinate system? Answer 1: The rectangular coordinate system is used to graph points and equations. To create the rectangular coordinate system,

More information

UNIT 2. Translation/ Scaling/ Rotation. Unit-02/Lecture-01

UNIT 2. Translation/ Scaling/ Rotation. Unit-02/Lecture-01 UNIT 2 Translation/ Scaling/ Rotation Unit-02/Lecture-01 Translation- (RGPV-2009,10,11,13,14) Translation is to move, or parallel shift, a figure. We use a simple point as a starting point. This is a simple

More information

15. Clipping. Projection Transformation. Projection Matrix. Perspective Division

15. Clipping. Projection Transformation. Projection Matrix. Perspective Division 15. Clipping Procedures for eliminating all parts of primitives outside of the specified view volume are referred to as clipping algorithms or simply clipping This takes place as part of the Projection

More information

The Traditional Graphics Pipeline

The Traditional Graphics Pipeline Last Time? The Traditional Graphics Pipeline Reading for Today A Practical Model for Subsurface Light Transport, Jensen, Marschner, Levoy, & Hanrahan, SIGGRAPH 2001 Participating Media Measuring BRDFs

More information

Did You Find a Parking Space?

Did You Find a Parking Space? Lesson.4 Skills Practice Name Date Did You Find a Parking Space? Parallel and Perpendicular Lines on the Coordinate Plane Vocabulary Complete the sentence. 1. The point-slope form of the equation of the

More information

Computer Graphics 7: Viewing in 3-D

Computer Graphics 7: Viewing in 3-D Computer Graphics 7: Viewing in 3-D In today s lecture we are going to have a look at: Transformations in 3-D How do transformations in 3-D work? Contents 3-D homogeneous coordinates and matrix based transformations

More information

Section Graphs and Lines

Section Graphs and Lines Section 1.1 - Graphs and Lines The first chapter of this text is a review of College Algebra skills that you will need as you move through the course. This is a review, so you should have some familiarity

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

f (Pijk ) V. may form the Riemann sum: . Definition. The triple integral of f over the rectangular box B is defined to f (x, y, z) dv = lim

f (Pijk ) V. may form the Riemann sum: . Definition. The triple integral of f over the rectangular box B is defined to f (x, y, z) dv = lim 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.3

More information

Geometric Queries for Ray Tracing

Geometric Queries for Ray Tracing CSCI 420 Computer Graphics Lecture 16 Geometric Queries for Ray Tracing Ray-Surface Intersection Barycentric Coordinates [Angel Ch. 11] Jernej Barbic University of Southern California 1 Ray-Surface Intersections

More information

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

The Graphics Pipeline. Interactive Computer Graphics. The Graphics Pipeline. The Graphics Pipeline. The Graphics Pipeline: Clipping

The Graphics Pipeline. Interactive Computer Graphics. The Graphics Pipeline. The Graphics Pipeline. The Graphics Pipeline: Clipping Interactive Computer Graphics The Graphics Pipeline: The Graphics Pipeline Input: - geometric model - illumination model - camera model - viewport Some slides adopted from F. Durand and B. Cutler, MIT

More information

Scan Conversion. Drawing Lines Drawing Circles

Scan Conversion. Drawing Lines Drawing Circles Scan Conversion Drawing Lines Drawing Circles 1 How to Draw This? 2 Start From Simple How to draw a line: y(x) = mx + b? 3 Scan Conversion, a.k.a. Rasterization Ideal Picture Raster Representation Scan

More information