Chi-Cheng Lin, Winona State University CS430 Computer Graphics Vectors Part IV Polygon Intersection.

Slides:



Advertisements
Similar presentations
College of Information Technology & Design
Advertisements

Rezanje črt in poligonov. World window & viewport window viewport screen window world window.
Computational Geometry
CS 450: COMPUTER GRAPHICS FILLING POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
1 Planes, Polygons and Objects ©Anthony Steed
Intersection Testing Chapter 13 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
CSE 681 Bounding Volumes. CSE 681 Bounding Volumes Use simple volume enclose object(s) tradeoff for rays where there is extra intersection test for object.
Geometry Primer Lines and rays Planes Spheres Frustums Triangles Polygon Polyhedron.
10/10/02 (c) 2002 University of Wisconsin, CS 559 Last Time Finished viewing: Now you know how to: –Define a region of space that you wish to view – the.
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
CS 551 / 645: Introductory Computer Graphics Clipping Lines and Polygons.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Cohen-Sutherland Line Clipping Algorithm.
3/2/04© University of Wisconsin, CS559 Spring 2004 Last Time General Perspective –Methods for specifying the view volume As a set of clip planes As a field.
David Breen, William Regli and Maxim Peysakhov
Dr. Scott Schaefer Clipping Lines. 2/94 Why Clip? We do not want to waste time drawing objects that are outside of viewing window (or clipping window)
1 Clipping. 2 Transformation Sequence X Y Z X Y Z X Y Z X Y Z Object Coords. Eye Coords. Clip Coords. Normalized Device Coords. Screen Coords. Implementation:
Clipping CSE 403 Computer Graphics Cohen Sutherland Algorithm (Line)
CMPE 466 COMPUTER GRAPHICS Chapter 8 2D Viewing Instructor: D. Arifler Material based on - Computer Graphics with OpenGL ®, Fourth Edition by Donald Hearn,
Ray Polygon Interception: Cyrus Beck Algorithm Mengxia Zhu Fall 2007.
Advanced Computer Graphics Spring 2014
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Basic 3D collision detection We want to know if objects have touched Objects are considered to.
Computer Graphics using OpenGL, 3 rd Edition F. S. Hill, Jr. and S. Kelley Chapter Vector Tools for Graphics S. M. Lea University of North Carolina.
Informationsteknologi Thursday, November 22, 2007Computer Graphics - Class 111 Today’s class Clipping Parametric and point-normal form of lines Intersecting.
CS 4731: Computer Graphics Lecture 14: 3D Clipping and Viewport Transformation Emmanuel Agu.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Half-Space Intersections
UNC Chapel Hill M. C. Lin References Collision Detection between Geometric Models: A Survey, by M. Lin and S. Gottschalk, Proc. of IMA Conference on Mathematics.
Visibility culling – Clipping. The visibility problem What polygons are visible? There are few visible polygons. –Avoid redundant processing Three classes.
1 Clipping and Hidden Surfaces CS-184: Computer Graphics Prof. James O’Brien.
Computer Graphics Clipping Cohen Sutherland Algorithm (Line) Cyrus-Back Algorithm (Line) Sutherland-Hodgeman Algorithm (Polygon) Cohen Sutherland Algorithm.
2/26/04© University of Wisconsin, CS559 Spring 2004 Last Time General Orthographic Viewing –Specifying cameras in world coordinates –Building world  view.
Introduction to Geometry: Points, Lines, and Planes
Chapter 12 Surface Area and Volume. Topics We Will Discuss 3-D Shapes (Solids) Surface Area of solids Volume of Solids.
Chapter 12 Surface Area and Volume. Topics We Will Discuss 3-D Shapes (Solids) Surface Area of solids Volume of Solids.
Week 13 - Wednesday CS361.
CSE53111 Computational Geometry TOPICS q Preliminaries q Point in a Polygon q Polygon Construction q Convex Hulls Further Reading.
Vector Exercise. Parametric form for a line Passing two points.
Clipping Apart from clipping to the view volume, clipping is a basic operation in many other algorithms –Breaking space up into chunks –2D drawing and.
2003CS Hons RW778 Graphics1 Chapter 4: Vector Tools 4.5 Representation of Key Geometric Objects 4.5 Representation of Key Geometric Objects –4.5.1 Coordinate.
Prisms Fun with by D. Fisher
CS 325 Introduction to Computer Graphics 03 / 08 / 2010 Instructor: Michael Eckmann.
Vertex – A point at which two or more edges meet Edge – A line segment at which two faces intersect Face – A flat surface Vertices, Edges, Faces.
UNC Chapel Hill M. C. Lin Linear Programming Reading: Chapter 4 of the Textbook Driving Applications –Casting/Metal Molding –Collision Detection Randomized.
Clipping Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by David Luebke)
10/15/02 (c) 2002 University of Wisconsin, CS559 Last Time Clipping.
Week 13 - Monday.  What did we talk about last time?  Exam 2!  Before that…  Polygonal techniques ▪ Tessellation and triangulation  Triangle strips,
12.1 – Explore Solids.
1 Visiblity: Culling and Clipping Computer Graphics COMP 770 (236) Spring 2009 January 21 & 26: 2009.
1 Dr. Scott Schaefer Intersecting Simple Surfaces.
10/19/04© University of Wisconsin, CS559 Fall 2004 Last Time Clipping –Why we care –Sutherland-Hodgman –Cohen-Sutherland –Intuition for Liang-Barsky Homework.
1 11. Polygons Polygons 2D polygons ( 다각형 ) –Polygon sides are all straight lines lying in the same plane 3D polyhedra ( 다면체 )  chap. 12 –Polyhedra.
Advanced Computer Graphics Spring 2009
12.1 Exploring Solids.
CS 480/680 Computer Graphics Compositing and Blending Dr. Frederick C Harris, Jr.
Computer Graphics I, Fall 2010 Implementation II.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Vectors Part III Intersections.
CS6234 Advanced Algorithms - Convex hull. Terminologies – ◦ Convex hull of a set Q of points is the smallest convex polygon P for which each point in.
Clipping Primitives. Clipping line Clipping rectangle: – x min to x max – y min to y max A point (x,y) lies within a clip rectangle and thus displayed.
11-1 Space Figures and Cross Sections Objectives To recognize polyhedra and their parts To visualize cross sections of space figures.
Computer Graphics Lecture 08 Taqdees A. Siddiqi Computer Graphics Filled Area Primitives I Lecture 08 Taqdees A. Siddiqi
University of North Carolina at Greensboro
Polyhedra and Prisms.
Computer Graphics CC416 Week 13 Clipping.
Clipping Computer Graphics Cohen Sutherland Algorithm (Line)
By the end of Week 3: You would learn how to solve many problems involving lines/planes and manipulate with different coordinate systems. These are.
Segment Clipping Simple algorithm. For each segment compute the intersection with the four sides of the rectangle, and then determine which sub-segment.
© University of Wisconsin, CS559 Fall 2004
(c) 2002 University of Wisconsin, CS559
Clipping Clipping Sutherland-Hodgman Clipping
COMPUTER GRAPHICS Clipping
Presentation transcript:

Chi-Cheng Lin, Winona State University CS430 Computer Graphics Vectors Part IV Polygon Intersection

2 Topics l Polygon Intersection Problems l Convex Polygons and Polyhedra l Ray Intersection and Clipping l Cyrus-Beck Clipping Algorithm

3 Polygon Intersection Problems l Polygons are fundamental objects in both 2D and 3D graphics l A polygonal mesh can be used to model a 3D graphics object l Polyhedron zA polygonal mesh which forms a closed surface that encloses some space

4 Polygon Intersection Problems l Is a given point P inside or outside the object? l Where does a given ray R first intersect the object? l Which part of a given line L lies inside/outside the object?

5 Polygon Intersection Problems

6 Convex Polygons and Polyhedra l General case of polygon/polyhedron intersection problems is complex l Convex polygons/polyhedra are easier to deal with z2D: a convex polygon can be completely described by a set of “bounding lines” z3D: a convex polyhedron can be completely described by a set of “bounding planes”  Deal with bounding lines/planes

7 Convex Polygons and Polyhedra

8 l Outward normal zEvery bounding line of a 2D convex polygon zEvery bounding plane of a 3D convex polyhedron

9 Convex Polygons and Polyhedra l Outside half-space l Polyhedron zIntersection of all the inside half-spaces L1L1 Outside half-space Inside half-space

10 Ray Intersection l A Intersection problem: when does a ray enter and exit a convex polygon? l A ray A + ct hits a convex polygon P exactly twice zEntering hit point: A + ct in zExiting hit point: A + ct out zThe ray is inside P for all t  [t in, t out ] A c P

11 Clipping l Clipping problem: given points A and C, which part of line segment AC lies inside a convex polygon P ? l A’ = A + c max(0, t in ) C’ = A + c min(t out, 1) AP C 0 t in t out 1 A 0 t in t out C 1 A 0 t in t out C 1

12 Clipping l How are t in and t out computed? zWe must find the intersection of the ray and each bounding line in turn l Assume a bounding line is represented as {B, n}, where zB: some point on the line zn: outward normal

13 Clipping If n  c > 0, ray is exiting from P If n  c = 0, ray is parallel to P If n  c < 0, ray is entering P l For each bounding line, find z Hit time of the ray with bounding line z Whether the ray is entering or exiting n1n1 c A B1B1 B2B2 n2n2

14 Clipping l Approach zCandidate interval of t : [t in, t out ] zKeep track of the maximum entering time t in zKeep track of the minimum exit time t out zWe want to chop the interval at each iteration zCan stop as soon as t in > t out (what does this mean?)

15 Clipping - Algorithm Initialize [t in, t out ]  [0, 1] for each boundary find the hit time t hit if entering then t in = max(t in, t hit ) else t out = min(t out, t hit ) if t in > t out then no intersection  stop segment from A + ct in to A + ct out lies inside P (We found: endpoints of clipped lines entering and exiting points of ray)

16 Clipping - Example Updates on t in and t out : Line test t in t out L0L0 L1L1 L2L2 L3L3 L4L4 L5L5

17 Cyrus-Beck Clipping Algorithm l Clip a line segment against any convex polygon l Input parameters zLine segment zList of bounding lines l Output parameter zClipped line segment l Return value z1, if part of segment lies in P z0, otherwise

18

19