CSE 681 Object Intersection. CSE 681 Object Representation Implicit forms F(x,y,z) = 0 Explicit forms Analytic form x = F(y,z) testing generating Parametric.

Slides:



Advertisements
Similar presentations
Everything you ever wanted to know about collision detection
Advertisements

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.
Ray Polygon Interception: Cyrus Beck Algorithm Mengxia Zhu Fall 2007.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
Chapter 12: Surface Area and Volume of Solids

Chapter 12 – Vectors and the Geometry of Space
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Object Representation 고려대학교 컴퓨터 그래픽스 연구실.
Informationsteknologi Thursday, November 22, 2007Computer Graphics - Class 111 Today’s class Clipping Parametric and point-normal form of lines Intersecting.
Chapter 11: Advanced Rendering Part 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
11-1 Space Figures and Cross Sections
Ray Tracing Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of.
Ray Casting Ray-Surface Intersections Barycentric Coordinates Reflection and Transmission [Shirley, Ch.9] Ray Tracing Handouts Ray Casting Ray-Surface.
Objects in 3D – Parametric Surfaces Computer Graphics Seminar MUM, summer 2005.
ENDS 375 Foundations of Visualization Geometric Representation 10/5/04.
CS 376 Introduction to Computer Graphics 04 / 06 / 2007 Instructor: Michael Eckmann.
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
CSE 681 Object Intersection. CSE 681 Object Representation Implicit forms F(x,y,z) = 0 Explicit forms Analytic form x = F(y,z) testing generating Parametric.
Ray Tracing 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009.
CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Cornell CS465 Fall 2004 Lecture 3© 2004 Steve Marschner 1 Ray Tracing CS 465 Lecture 3.
Week 13 - Wednesday CS361.
CSE 681 Ray Tracing Geometry. The Camera Model Based on a simpile pin-hole camera model –Simplest lens model –Pure geometric optics – based on similar.
CS-321 Dr. Mark L. Hornick 1 3-D Object Modeling.
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.
Introduction to 3D Graphics Lecture 4: Scenes and Scene Graphs Anthony Steed University College London.
COMP 175: Computer Graphics March 24, 2015
CS 325 Introduction to Computer Graphics 03 / 08 / 2010 Instructor: Michael Eckmann.
1 Ray Tracing Polyhedra ©Anthony Steed
Collision handling: detection and response
1 Ray Casting. CLASS 1 Ray Casting 2 3 Overview of Today Ray Casting Basics Camera and Ray Generation Ray-Plane Intersection.
CS 325 Introduction to Computer Graphics 04 / 26 / 2010 Instructor: Michael Eckmann.
Spaces 1D, 2D, and 3D Point Line Plan Points/Vectors A point p = (x,y,z) is also the vector p Vector Operation The Length of the vector v Normalization.
Week 13 - Monday.  What did we talk about last time?  Exam 2!  Before that…  Polygonal techniques ▪ Tessellation and triangulation  Triangle strips,
Chapter 12 Section 1 Exploring Solids Using Properties of Polyhedra Using Euler’s Theorem Richard Resseguie GOAL 1GOAL 2.
12.1– Explore Solids.
Identify each of the following shapes. In geometry, what is a net? what is surface area? cube Triangular pyramid Right square pyramid Rectangular prism.
Background Mathematics Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006.
12.1 & 12.2 – Explore Solids & Surface Area of Prisms and Cones.
1 Dr. Scott Schaefer Intersecting Simple Surfaces.
Basic Ray Tracing CMSC 435/634.
Ray Tracing. 2 Introduction OpenGL is based on a pipeline model in which primitives are rendered one at time ­No shadows (except by tricks or multiple.
1 11. Polygons Polygons 2D polygons ( 다각형 ) –Polygon sides are all straight lines lying in the same plane 3D polyhedra ( 다면체 )  chap. 12 –Polyhedra.
12.1 Exploring Solids.
CS 480/680 Computer Graphics Compositing and Blending Dr. Frederick C Harris, Jr.
Constructive Solid Geometry Ray Tracing CSG Models
3D Object Representations 2011, Fall. Introduction What is CG?  Imaging : Representing 2D images  Modeling : Representing 3D objects  Rendering : Constructing.
CS 551/651: Advanced Computer Graphics
Section 12-1 Exploring Solids. Polyhedron Three dimensional closed figure formed by joining three or more polygons at their side. Plural: polyhedra.
RENDERING : Global Illumination
Solid Modeling Dr. Scott Schaefer.
Lesson: Solids & Cross Sections
Name the polygon by the number of sides.
Introduction to Computer Graphics with WebGL
Ray Tracing Ed Angel Professor Emeritus of Computer Science
Intersecting Simple Surfaces
3D Object Representation
Ray Tracing Geometry CSE 681.
Ray Tracing Geometry CSE 681.
Introduction to Computer Graphics with WebGL
12-1 Properties of Polyhedra
Lesson 10.3 Three-Dimensional Figures
Object Intersection CSE 681.
Object Intersection CSE 681.
3D Object Representation
Presentation transcript:

CSE 681 Object Intersection

CSE 681 Object Representation Implicit forms F(x,y,z) = 0 Explicit forms Analytic form x = F(y,z) testing generating Parametric form (x,y,z) = P(t)

CSE 681 Ray-Object Intersection Implicit forms F(x,y,z) = 0 Ray: P(t) = (x,y,z) = source + t*direction = s + t*v Solve for t: F(P(t)) = 0

CSE 681 Ray-Sphere Intersection Implicit form for sphere at origin of radius 1 Ray: Solve: … Use quadratic equation…

CSE 681 Ray-Sphere Intersection At 2 + Bt + C = 0 A = |v| 2 B = 2s·v C = |s| B 2 -4AC no intersection = 0 => just grazes > 0 => two hits

CSE 681 Axis-Aligned Cuboid (rectangular solid, rectangular parallelpiped) X = x1 X = x2 Y = y2 Y = y1 Z = z1 Z = z2 P(t) = s + tv t x1 = (x1 - s x )/v x t x2 = (x2 - s x )/v x t y1 = (y1 - s x )/v x … Solve for intersections with planes Planar equations Ray equation

CSE 681 Rectangle For each intersection, note whether entering or leaving square side of plane: HOW? Ray is inside after last entering and before first exiting Ray 1 Ray 2

CSE 681 Ray-Plane for arbitrary plane ax + by + cz + d = 0 n ·P = -d V1V1 V2V2 V3V3 V4V4 d -n Generalize from axis-aligned planes to any plane:

CSE 681 Normal Vector Given ordered sequence of points defining a polygon how do you find a normal vector for the plane? Ordered: e.g., clockwise when viewed from the front of the face Right hand v. left hand space Note: 2 normal vectors to a plane, colinear and one is the negation of the other

CSE 681 Normal Vector n = (V 1 - V 2 ) x (V 3 - V 2 ) V1V1 V2V2 V3V3 V4V4 V5V5 V1V1 V2V2 V3V3 V4V4 V5V5 V4V4 V1V1 V2V2 V3V3 V5V5

CSE 681 Normal Vector V1V1 V2V2 V3V3 V4V4 V5V5 V1V1 V2V2 V3V3 V4V4 V5V5 V4V4 V1V1 V2V2 V3V3 V5V5 m x =  (y i - y next(i) ) (z i - z next(i) ) m y =  (z i - z next(i) ) (x i - x next(i) ) m z =  (x i - x next(i) ) (y i - y next(i) )

CSE 681 Ray-Plane Ax + by + cz + d = 0 P = s + t*v n ·P = -d n· (s+t*v) = -d n·s + t*(n·v) = -d t = -(d + n·s)/(n·v)

CSE 681 Ray-Polyhedron Polyhedron - volume bounded by flat faces Each face is defined by a ring of edges Each edge is shared by 2 and only 2 faces Faces can be convex or concave The polyhedron can be convex or concave

CSE 681 Polyhedron Classification Polyhedron Convex Polyhedron Concave Polyhedron One or more Concave Polygons Only Convex Polygons Only Convex Polygons One or more Concave Polygons quads triangulated mixed quads triangulated mixed

CSE 681 Convex Polyhedron volume bounded by finite number of infinite planes Intersection going from outside to inside Intersection going from inside to outside Computing intersections is similar to cube but using ray-plane intersection and arbitrary number of planes

CSE 681 Convex Polyhedron Intersection going from outside to inside Intersection going from inside to outside Record maximum entering intersection - enterMax Record minimum exiting intersection - exitMin If (enterMax < exitMin) polyhedron is intersected

CSE 681 Concave Polyhedron Find closest face (if any) intersected by ray Need ray-face (ray-polygon) intersection test

CSE 681 Ray-Polyhedron 1. Intersect ray with plane 2. Determine if intersection point is inside of 2D polygon A) Convex polygon B) Concave polygon

CSE 681 Ray- Convex Polygon Test to see if point is on ‘inside’ side of each edge E V n n·(VxE) > 0 VxE Dot product of normal Cross product of ordered edge vector from edge source to point of intersection

CSE 681 Ray-concave polygon Project to plane of 2 smallest coordinates of normal vector Form semi-infinite ray and count ray-edge intersections Project plane and point of intersection to 2D plane 2D point-inside-a-polygon test

CSE 681 2D point inside a polygon test Y Y N N

CSE 681 2D point inside a polygon test y

CSE 681 Transformed objects Intersect ray with transformed object Use inverse of object transformation to transform ray Intersect transformed ray with untransformed object e.g., Ellipse is transformed sphere Object space World space

CSE 681 Transformed objects Object space ray World space ray Transform intersection point and normal back to world space Intersect ray with object in object space

CSE 681 Ray-Cylinder r P = s 1 + t 1 *v 1 Q = s 2 + t 2 *v 2 r At closest points

CSE 681 Ray-Cylinder

CSE 681 Ray-Ellipsoid Geometric construction: all points p such that |p-a| + |p-b| = r d1 d2 |P(t)-a| + | P(t)- b| = r a b

CSE 681 Ray-Quadric Algebraic solution v. Numeric solution Ray-Whatever