Object Intersection CSE 681.

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.
Geometry Primer Lines and rays Planes Spheres Frustums Triangles Polygon Polyhedron.
Ray Polygon Interception: Cyrus Beck Algorithm Mengxia Zhu Fall 2007.
Chapter 12: Surface Area and Volume of Solids
By: Andrew Shatz & Michael Baker Chapter 15. Chapter 15 section 1 Key Terms: Skew Lines, Oblique Two lines are skew iff they are not parallel and do not.
Chapter 12 – Vectors and the Geometry of Space
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
ENDS 375 Foundations of Visualization Geometric Representation 10/5/04.
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.
CSE 681 Ray Tracing Implicit Surfaces. CSE 681 Overview Similar to CSG –Combine primitive objects to form complex object Primitives are “density fields”
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.
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.
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.
CS 325 Introduction to Computer Graphics 03 / 08 / 2010 Instructor: Michael Eckmann.
Collision handling: detection and response
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.
1. Given vectors a, b, and c: Graph: a – b + 2c and 3c – 2a + b 2. Prove that these following vectors a = 3i – 2j + k, b = i – 3j +5k, and c = 2i +j –
Identify each of the following shapes. In geometry, what is a net? what is surface area? cube Triangular pyramid Right square pyramid Rectangular prism.
Surface Area of Prisms and Cylinders. Goal, to find the surface areas of prisms and cylinders.
Background Mathematics Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006.
1 Dr. Scott Schaefer Intersecting Simple Surfaces.
Cube A cube[1] is a three-dimensional solid object bounded by six square faces, facets or sides, with three meeting at each vertex[1]three-dimensionalsquarefacetsvertex.
12.1 Exploring Solids.
Solid Figures Vocabulary.
Ch 12 and 13 Definitions. 1. polyhedron A solid with all flat surfaces that enclose a single region of space.
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.
Section 12-1 Exploring Solids. Polyhedron Three dimensional closed figure formed by joining three or more polygons at their side. Plural: polyhedra.
Solid Geometry Student Expectations 7 th Grade: 7.3.6C Use properties to classify three- dimensional figures, including pyramids, cones, prisms, and.
Francis González Shapes: 2 Dimensions Figures Rectangle, Square, Triangle, Circle, Arch 3 Dimensions Figures Cube, Pyramid, Sphere, Cylinder.
PREPARING FOR SURFACE AREA AND VOLUME DRAWINGS, CROSS SECTIONS AND NETS.
Three-Dimensional Viewing Clipping Computer Graphics C Version (456p - 462p)
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.
CSE 681 Brief Review: Vectors. CSE 681 Vectors Direction in space Normalizing a vector => unit vector Dot product Cross product Parametric form of a line.
G.3.J Vocabulary of Three-Dimensional Figures
Warm Up Find the unknown lengths.
3D Rendering 2016, Fall.
Lesson: Solids & Cross Sections
Name the polygon by the number of sides.
Ray Tracing Forward Ray Tracing
Intersecting Simple Surfaces
Review: Transformations
Constructing Objects in Computer Graphics By Andries van Dam©
3D Object Representation
Ray Tracing Geometry CSE 681.
Ray Tracing Geometry CSE 681.
Collision handling: detection and response
11.4 Three Dimensional Figures
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
12-1 Properties of Polyhedra
Lesson 10.3 Three-Dimensional Figures
Solid Geometry.
Object Intersection CSE 681.
Geometric Solids All bounded three-dimensional geometric figures. Examples: Sphere, Cylinders, Cubes, Cones, Pyramids, and Prisms.
Ray Tracing Polyhedra ©Anthony Steed
Geometric Solids All bounded three-dimensional geometric figures. Examples: Sphere, Cylinders, Cubes, Cones, Pyramids, and Prisms.
(c) 2002 University of Wisconsin, CS559
Surface Area and Volume
2- and 3-Dimensional Figures
Computer Animation Algorithms and Techniques
Solid Geometry.
3D Object Representation
Objective - To identify solid figures.
Geometry Chapter : Exploring Solids.
Solid Geometry.
Presentation transcript:

Object Intersection CSE 681

Object Representation Implicit forms F(x,y,z) = 0 testing Explicit forms Analytic form x = F(y,z) 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*c Solve for t: F(P(t)) = 0 CSE 681

Ray-Sphere Intersection Implicit form for sphere at origin of radius 1 F(x,y,z) = x2 + y2 + z2 - 1 = 0 Ray: P(t) = (x,y,z) = s + t*c = (sx + t*cx, sy+t*cy, sz+t*cz) Solve: F(P(t)) = (sx + t*cx)2 + (sy+t*cy)2 + (sz+t*cz)2 - 1 = 0 sx2+sy2+sz2 + t*2*(sxcx+sycy+szcz) + t2*(cx2+cy2+cz2) -1 = 0 Use quadratic equation… CSE 681

Ray-Sphere Intersection At2 + Bt + C = 0 A = |c|2 B = 2s·c C = |s|2 - 1 B2-4AC < 0 => no intersection = 0 => just grazes > 0 => two hits CSE 681

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

Rectangle For each intersection, note whether entering or leaving square side of plane Ray 2 What’s the test for determining if outside of cuboid Ray is inside after last entering and before first leaving Ray 1 CSE 681

Ray-Plane for arbitrary plane V2 V1 ax + by + cz + d = 0 n ·P = -d V4 d -n V3 CSE 681

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

Normal Vector V1 V2 n = (V1 - V2) x (V3 - V2) V3 V5 V2 V4 V1 V3 V1 V2 In right-handed space is normal coming out of slide or into slide? V3 V1 V2 V3 V5 V4 V5 CSE 681 V4

Normal Vector mx = S(yi - ynext(i)) (zi - znext(i)) V1 V2 my = S(zi - znext(i)) (xi - xnext(i)) V3 mz = S(xi - xnext(i)) (yi - ynext(i)) V5 V2 V4 V1 V3 V1 V2 V3 V5 V4 V5 CSE 681 V4

Ray-Plane Ax + by + cz + d = 0 n ·P = -d P = s + t*dir n· (s+t*dir) = -d n·s + t*(n·dir) = -d t = -(d + n·s)/(n·dir) 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 The polyhedron can be convex or concave Faces can be convex or concave 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 Intersection going from outside to inside Intersection going from inside to outside CSE 681

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

Concave Polyhedron Find first 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 E Test to see if point is on ‘inside’ side of each edge n n·(VxE) > 0 VxE V Dot product of normal Cross product of ordered edge vector from edge source to point of intersection CSE 681

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

2D point inside a polygon test CSE 681

2D point inside a polygon test If ( ( (y<y2) && (y>=y1) ) || ( (y<y1) && (y>=y2) ) ) 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 World space ray r(t) = s + t*c s = [sx,sy,sz,1] c = [cx, cy, cz, 0] Object space ray R(t) T = M-1sT + M -1 cT worldPnt T= M*objPnt T worldN = (M -1) T *N T Transform intersection point and normal back to world space CSE 681

Ray-Cylinder Q = s2 + t2*dir2 r P = s1 + t1*dir1 r Compute distance to intercept at r from cylinder axis CSE 681

Ray-Cylinder CSE 681

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