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

8.1 Prisms, Area and Volume Prism – 2 congruent polygons lie in parallel planes corresponding sides are parallel. corresponding vertices are connected.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
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.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
Chapter 12: Surface Area and Volume of Solids
Informationsteknologi Thursday, November 22, 2007Computer Graphics - Class 111 Today’s class Clipping Parametric and point-normal form of lines Intersecting.
11-1 Space Figures and Cross Sections
Ray Casting Ray-Surface Intersections Barycentric Coordinates Reflection and Transmission [Shirley, Ch.9] Ray Tracing Handouts Ray Casting Ray-Surface.
ENDS 375 Foundations of Visualization Geometric Representation 10/5/04.
CS 376 Introduction to Computer Graphics 04 / 06 / 2007 Instructor: Michael Eckmann.
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.
Chapter 12 Surface Area and Volume. Topics We Will Discuss 3-D Shapes (Solids) Surface Area of solids Volume of Solids.
Surface Area and Volume
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.
1 Computer Graphics Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD3107 University of Palestine.
Mathematical fundamentals of 3D computer graphics 1.1 Manipulating three-dimensional structures 1.2 Vectors and computer graphics 1.3 Rays and computer.
CS-321 Dr. Mark L. Hornick 1 3-D Object Modeling.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
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.
VOLUME Volume is a measure of the space within a solid figure, like ball, a cube, cylinder or pyramid. Its units are at all times cubic. The formula of.
LESSON 10.1 & 10.2 POLYHEDRONS OBJECTIVES: To define polyhedrons To recognize nets of space figures To apply Euler’s formula To describe cross section.
CS 325 Introduction to Computer Graphics 03 / 08 / 2010 Instructor: Michael Eckmann.
1 Ray Tracing Polyhedra ©Anthony Steed
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.
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.
Section 8.4 Nack/Jones1 Section 8.4 Polyhedrons & Spheres.
12. Polyhedra
Week 13 - Monday.  What did we talk about last time?  Exam 2!  Before that…  Polygonal techniques ▪ Tessellation and triangulation  Triangle strips,
Chapter 11.1 Notes Common Core – G.GMD.4 Identify the shapes of two-dimensional cross-sections of three-dimensional objects, and identify three-dimensional.
Geometric Objects and Transformation
12.1– Explore Solids.
11.1 Space Figures and Cross Sections A polyhedron is a space figure, or three-dimensional figure, whose surfaces are polygons. Each polygon is a face.
Chapter 12.1 Notes Polyhedron – is a solid that is bounded by polygons, called faces, that enclose a single region of space. Edge – of a polygon is a line.
Background Mathematics Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006.
12.1 & 12.2 – Explore Solids & Surface Area of Prisms and Cones.
Space Figures & Nets, Surface Areas of Prisms & Cylinders Unit 5, Lesson 1 chapter%20ten.ppt.
1 Dr. Scott Schaefer Intersecting Simple Surfaces.
Space Figures & Cross-Sections
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
CS 551/651: Advanced Computer Graphics
Geometry Vocabulary. Triangle Triangle: a polygon with three sides. 180⁰ Sum of the interior angles of a triangle = 180⁰.
Section 12-1 Exploring Solids. Polyhedron Three dimensional closed figure formed by joining three or more polygons at their side. Plural: polyhedra.
Chapter 11: Surface Area & Volume
11-1 Space Figures and Cross Sections Objectives To recognize polyhedra and their parts To visualize cross sections of space figures.
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.
11.1 Notes Space Figures and Cross Sections. Identifying Nets and Space Figures A polyhedron is a 3-dimensional figure whose surfaces are polygons. -
Lesson: Solids & Cross Sections
Name the polygon by the number of sides.
Intersecting Simple Surfaces
12-1 Properties of Polyhedra
Lesson 10.3 Three-Dimensional Figures
Object Intersection CSE 681.
Object Intersection CSE 681.
Surface Area and Volume
11.4 Exploring Solids Geometry How many geometric solid can you name?
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 Solid Modeling Modeling of three-dimensional solids Physically realizable objects No infinitely thin sheets, no lines Interior of object should ‘hold water’ - Define a closed volume

CSE 681 Polygonal Solid Models Each edge of a face is shared by one and only one other face Each edge appears oriented one way in one face and the other way in the other face Vertices of a face have a consistent ordering (e.g. clockwise) when viewed from the outside side of the face EULER’S FORMULA F – E + V = 2 F – E + V = 2 – 2P

CSE 681 Convex Polyhedron volume bounded by finite number of infinite planes Computing intersections is similar to cube but using ray-plane intersection and arbitrary number of planes n· (s+t*v) = -d n·s + t*(n·v) = -d t = -(d + n·s)/(n·v) n· P= -d P(t) = s + t*v Use n· v to determine Entering/exiting status

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- 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 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-concave polygon Form semi-infinite ray and count ray-edge intersections Project plane and point of intersection to 2D plane 2D point-inside-a-polygon test (can also be used for convex polygons) A B A’ B’ N Project to plane of 2 smallest coordinates of normal vector

CSE 681 2D Point Inside a Convex Polygon Test to see if point is on ‘inside’ side of each edge p Semi-infinite ray test p1 p2 p Need to know order (CW or CCW) of 2D vertices

CSE 681 2D point inside a polygon test

CSE 681 Special Cases Y Y N N Logically move ray up epsilon

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 to world transform matrix World space ray Transform intersection point and normal back to world space Intersect ray with object in object space Object space ray

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 Algebraic equation – axis aligned, origin centered d1 d2 a b

CSE 681 Ray-Quadric