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

Similar documents
3D Rendering Pipeline (for direct illumination)

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

Clipping and Scan Conversion

Two-Dimensional Viewing. Chapter 6

Computer Graphics. - Clipping - Philipp Slusallek & Stefan Lemme

From Vertices To Fragments-1

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

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

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

Realtime 3D Computer Graphics Virtual Reality

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

Clipping Lines. Dr. Scott Schaefer

VISIBILITY & CULLING. Don t draw what you can t see. Thomas Larsson, Afshin Ameri DVA338, Spring 2018, MDH

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

Part IV. 2D Clipping

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

Topics. From vertices to fragments

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

Chapter 8: Implementation- Clipping and Rasterization

CS 450: COMPUTER GRAPHICS REVIEW: CLIPPING SPRING 2015 DR. MICHAEL J. REALE

Computer Graphics: 7-Polygon Rasterization, Clipping

Chap 7, 2008 Spring Yeong Gil Shin

Motivation. Culling Don t draw what you can t see! What can t we see? Low-level Culling

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

Culling. Computer Graphics CSE 167 Lecture 12

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

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

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

Computer Graphics Geometry and Transform

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI

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

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

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

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

3D Polygon Rendering. Many applications use rendering of 3D polygons with direct illumination

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

Chap 7, 2009 Spring Yeong Gil Shin

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

Sung-Eui Yoon ( 윤성의 )

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Lecture 3 Sections 2.2, 4.4. Mon, Aug 31, 2009

CS 325 Computer Graphics

COMP3421. Vector geometry, Clipping

CSE 167: Introduction to Computer Graphics Lecture #10: View Frustum Culling

CSE 167: Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

CSE328 Fundamentals of Computer Graphics

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

SRI VENKATESWARA COLLEGE OF ENGINEERING. COURSE DELIVERY PLAN - THEORY Page 1 of 6

CSE 167: Introduction to Computer Graphics Lecture #9: Visibility. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Aptitude Test Question

End-Term Examination

CSE 167: Introduction to Computer Graphics Lecture #11: Visibility Culling

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

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

Two Dimensional Viewing

Clipping and Intersection

CS4620/5620: Lecture 14 Pipeline

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

Computer Graphics Geometry and Transform

Rasterization, Depth Sorting and Culling

Lahore University of Management Sciences. CS 452 Computer Graphics

Visibility and Occlusion Culling

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

MIT EECS 6.837, Teller and Durand 1

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

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation

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

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

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

Unit 3 Transformations and Clipping

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

Course Title: Computer Graphics Course no: CSC209

Principles of Computer Graphics. Lecture 3 1

CMSC 435/634: Introduction to Graphics

Rasterization Overview

Points and lines, Line drawing algorithms. Circle generating algorithms, Midpoint circle Parallel version of these algorithms

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

Hidden Surfaces II. Week 9, Mon Mar 15

Computer Science 474 Spring 2010 Viewing Transformation

CS602 Midterm Subjective Solved with Reference By WELL WISHER (Aqua Leo)

COMP30019 Graphics and Interaction Rendering pipeline & object modelling

Lecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling

SUMMARY. CS380: Introduction to Computer Graphics Ray tracing Chapter 20. Min H. Kim KAIST School of Computing 18/05/29. Modeling

CHAPTER 1 Graphics Systems and Models 3

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

INFOGR Computer Graphics. J. Bikker - April-July Lecture 11: Visibility. Welcome!

Homework #2. Hidden Surfaces, Projections, Shading and Texture, Ray Tracing, and Parametric Curves

Lahore University of Management Sciences. CS 452 Computer Graphics

Part 3: 2D Transformation

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Computer Graphics. Jeng-Sheng Yeh 葉正聖 Ming Chuan University (modified from Bing-Yu Chen s slides)

COURSE DELIVERY PLAN - THEORY Page 1 of 6

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination

Introduction to Visualization and Computer Graphics

Computer Graphics: Two Dimensional Viewing

The Traditional Graphics Pipeline

Geometric Queries for Ray Tracing

(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.

Viewing Transformation. Clipping. 2-D Viewing Transformation

Transcription:

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 for clipping Clipping is most often performed in Normalized device coordinates View Frustum The view frustum is divided by si clipping planes Back plane Projection plane Modeling Transformation Viewing Transformation Projection Transformation Clipping Rasterization Field of View COP Front plane Normalization Clipping in a cube is easier! Observe the -coordinate of the points! Range w w w y w w z w How it is done Use perspective division We can now use parallel projection Scale the coordinates in the range (,y) (,y) (,y ) COP COP Anders Hast

Computer Graphics, Lecture 0 November 7, 006 Clipping in D Clipping can also be performed in D But it is usually less effective Discard all polygons behind the camera Project on the clipping plane Clip polygons in D (on the projection plane) We can also clip in the Frame buffer (scissoring) Most approaches for D clipping can be etended to 3D Algorithms Some well known clipping algorithms Cohen-Sutherland Liang-Barsky Sutherland-Hodgeman Weiler-Atherton Cyrus-Beck We will look at the D version for Line clipping and discuss etensions to polygon clipping in 3D Cohen-Sutherland Divide space in 9 regions And assign codes to them Pattern Each side corresponds to one bit in the codes (outcode) 00 000 00 00 000 00 000 0000 000 000 0000 000 00 000 00 00 000 00 The viewport Eample Assignment The endpoints are assigned an outcode 000 and 00 in this case 00 000 00 000 00 0000 000 000 00 The outcode o =outcode(, y )=(b 0 b b b 3 ) is easily assigned: if y > yma, b0 if y < ymin, b if > ma, b if < min, b3 Anders Hast

Computer Graphics, Lecture 0 November 7, 006 o =o =0 Both endpoints are inside the clipping window o =o =0 Both endpoints are inside the clipping window o!=0, o =0; or vice versa One endpoint is inside and the other is outside The line segment must be shortened o!=0, o =0; or vice versa One endpoint is inside and the other is outside The line segment must be shortened o &o!=0 Both endpoints are on the same side of the clipping window Trivial Reject o &o!=0 Both endpoints are on the same side of the clipping window Trivial Reject Anders Hast 3

Computer Graphics, Lecture 0 November 7, 006 o &o =0 Both endpoint are outside but outside different edges The line segment must be investigated further o &o =0 Both endpoint are outside but outside different edges The line segment must be investigated further Parametric Lines Intersection computation Intersections with can easily be computed by regarding the line as a parametric line This is a linear interpolation with p( α ) = ( α) p + αp 0 α Eample: Intersection with right border ma The parameter can easily be computed ma ma ma = ( α) + α = + α( = α( ma α = ) ) p p p p ma Intersection computation Intersections Finally we compute the y-coordinate by putting the parameter into the line equation p y ma y = y + α( y y), α = ma y = y + ( y y) y y y = y + ( ma ) p The two point formula! We can therefore compute intersections with the border using the two point formula We will obtain similar equations for the other borders What happens if we have no intersections with the view port? The parameter is out of range! ma Anders Hast 4

Computer Graphics, Lecture 0 November 7, 006 3D Intersections in 3D A little bit more complicated. 7 regions with a 6 bit code Intersections in 3D The first equation into the second equation A hybrid approach Use 3D Cohen Sutherland for trivial Reject and trivial Accept Then project onto viewport And finally do final clipping in D Trivial cases need not to be handled! Or perhaps even use scissoring instead? Liang Barsky Liang Barsky Uses the parametric line! Compute α for each border in a clockwise order p Note the changed order! > α 4 > α > α3 > α > 0 α α 4 p α 4 α 3 α α 3 > α 4 > α3 > α > α > 0 α p α p Anders Hast 5

Computer Graphics, Lecture 0 November 7, 006 Liang Barsky Similar equations can be derived for all possible cases Clip using the computed α s 3D: just add one dimension in the parametric line Sutherland-Hodgeman Is a pipeline clipper z( α ) = ( α) z + αz Computing intersections Use the two-point formula for intersection computations Polygon clipping The previous eplained approaches can be used for clipping polygons with some modifications Note that a triangle can have more vertices after clipping Acceleration techniques Imagine an object with many polygons The Stanford Bunny Bounding Volumes Create the smallest bo that contains the bunny A boed Bunny It is not so funny to check thousands of polygons for intersections! (6945 to be eact) We need some acceleration technique Check eight sides for intersections instead! Anders Hast 6

Computer Graphics, Lecture 0 November 7, 006 Intersection test Trivial cases are easy! Non trivial cases still need etensive computations Unless you use a hierarchy of cubes Bounding Spheres Only one center and a radius have to be checked! But not all objects are suitable for spheres Bounding Spheres Make a hierarchy of spheres for elongated objects! Some final words Not only 3D Objects need to be clipped Also splines, letters etc A mirror or a portal in a game can have non rectangular shape Clipping is needed Even though clipping is implemented in hardware, it is essential to understand the basics of it! Anders Hast 7