Ray surface intersections

Similar documents
Ray casting. Ray casting/ray tracing

If f(x, y) is a surface that lies above r(t), we can think about the area between the surface and the curve.

MA1008. Calculus and Linear Algebra for Engineers. Course Notes for Section B. Stephen Wills. Department of Mathematics. University College Cork

1999, Denis Zorin. Ray tracing

Stained Glass Design. Teaching Goals:

Surfaces. Differential Geometry Lia Vas

Lecture 11. More Ray Casting/Tracing

MATH 2530: WORKSHEET 7. x 2 y dz dy dx =

Class-XI Mathematics Conic Sections Chapter-11 Chapter Notes Key Concepts

such that the S i cover S, or equivalently S

Section 10.4 Hyperbolas

6.2 Volumes of Revolution: The Disk Method

6.3 Volumes. Just as area is always positive, so is volume and our attitudes towards finding it.

Section 3.1: Sequences and Series

AML710 CAD LECTURE 16 SURFACES. 1. Analytical Surfaces 2. Synthetic Surfaces

Fig.1. Let a source of monochromatic light be incident on a slit of finite width a, as shown in Fig. 1.

It is recommended to change the limits of integration while doing a substitution.

50 AMC LECTURES Lecture 2 Analytic Geometry Distance and Lines. can be calculated by the following formula:

10.5 Graphing Quadratic Functions

2 Computing all Intersections of a Set of Segments Line Segment Intersection

4-1 NAME DATE PERIOD. Study Guide. Parallel Lines and Planes P Q, O Q. Sample answers: A J, A F, and D E

Math 17 - Review. Review for Chapter 12

a < a+ x < a+2 x < < a+n x = b, n A i n f(x i ) x. i=1 i=1

Pointwise convergence need not behave well with respect to standard properties such as continuity.

Topics in Analytic Geometry

B. Definition: The volume of a solid of known integrable cross-section area A(x) from x = a

CHAPTER III IMAGE DEWARPING (CALIBRATION) PROCEDURE

1 Quad-Edge Construction Operators

Section 12.2: Quadric Surfaces

Math 142, Exam 1 Information.

MATH 25 CLASS 5 NOTES, SEP

Unit #9 : Definite Integral Properties, Fundamental Theorem of Calculus

Improper Integrals. October 4, 2017

SOME EXAMPLES OF SUBDIVISION OF SMALL CATEGORIES

9.1 apply the distance and midpoint formulas

Yoplait with Areas and Volumes

ANALYTICAL GEOMETRY. The curves obtained by slicing the cone with a plane not passing through the vertex are called conics.

Matlab s Numerical Integration Commands

Integration. September 28, 2017

Math 35 Review Sheet, Spring 2014

Area & Volume. Chapter 6.1 & 6.2 September 25, y = 1! x 2. Back to Area:

Supplemental Notes: Line Integrals

MENSURATION-IV

Lecture 7: Building 3D Models (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

INTRODUCTION TO SIMPLICIAL COMPLEXES

Chapter 2 Sensitivity Analysis: Differential Calculus of Models

4452 Mathematical Modeling Lecture 4: Lagrange Multipliers

1. SEQUENCES INVOLVING EXPONENTIAL GROWTH (GEOMETRIC SEQUENCES)

MTH 146 Conics Supplement

Key Idea. It is not helpful to plot points to sketch a surface. Mainly we use traces and intercepts to sketch

Subtracting Fractions

CS-C3100 Computer Graphics, Fall 2016 Ray Casting II Intersection Extravaganza

Quadric Surfaces. Philippe B. Laval. Today KSU. Philippe B. Laval (KSU) Quadric Surfaces Today 1 / 24

Quadric Surfaces. Philippe B. Laval. Spring 2012 KSU. Philippe B. Laval (KSU) Quadric Surfaces Spring /

Integration. October 25, 2016

CS-184: Computer Graphics. Today. Lecture #10: Clipping and Hidden Surfaces ClippingAndHidden.key - October 27, 2014.

Geometric transformations

Iterated Integrals. f (x; y) dy dx. p(x) To evaluate a type I integral, we rst evaluate the inner integral Z q(x) f (x; y) dy.

Alignment of Long Sequences. BMI/CS Spring 2012 Colin Dewey

Solutions to Math 41 Final Exam December 12, 2011

x )Scales are the reciprocal of each other. e

The Fundamental Theorem of Calculus

1 Drawing 3D Objects in Adobe Illustrator

Answer Key Lesson 6: Workshop: Angles and Lines

F. R. K. Chung y. University ofpennsylvania. Philadelphia, Pennsylvania R. L. Graham. AT&T Labs - Research. March 2,1997.

Physics 208: Electricity and Magnetism Exam 1, Secs Feb IMPORTANT. Read these directions carefully:

arxiv: v2 [math.ho] 4 Jun 2012

8.2 Areas in the Plane

Graphing Conic Sections

)

CS-184: Computer Graphics. Today. Clipping. Hidden Surface Removal. Tuesday, October 7, Clipping to view volume Clipping arbitrary polygons

Hyperbolas. Definition of Hyperbola

a(e, x) = x. Diagrammatically, this is encoded as the following commutative diagrams / X

9 Graph Cutting Procedures

Pythagoras theorem and trigonometry (2)

The Nature of Light. Light is a propagating electromagnetic waves

Ray Casting II. Courtesy of James Arvo and David Kirk. Used with permission.

APPLICATIONS OF INTEGRATION

HW Stereotactic Targeting

cisc1110 fall 2010 lecture VI.2 call by value function parameters another call by value example:

f[a] x + f[a + x] x + f[a +2 x] x + + f[b x] x

Before We Begin. Introduction to Spatial Domain Filtering. Introduction to Digital Image Processing. Overview (1): Administrative Details (1):

AVolumePreservingMapfromCubetoOctahedron

Math 464 Fall 2012 Notes on Marginal and Conditional Densities October 18, 2012

Grade 7/8 Math Circles Geometric Arithmetic October 31, 2012

A dual of the rectangle-segmentation problem for binary matrices

EXPONENTIAL & POWER GRAPHS

3.5.1 Single slit diffraction

Rigid Body Transformations

Questions About Numbers. Number Systems and Arithmetic. Introduction to Binary Numbers. Negative Numbers?

In the last lecture, we discussed how valid tokens may be specified by regular expressions.

Functor (1A) Young Won Lim 8/2/17

Fall 2018 Midterm 1 October 11, ˆ You may not ask questions about the exam except for language clarifications.

4 = 1 which is an ellipse of major axis 2 and minor axis 2. Try the plane z = y2

CHAPTER 8 Quasi-interpolation methods

Viewing and Projection

Simplifying Algebra. Simplifying Algebra. Curriculum Ready.

Math Line Integrals I

Loop Boundary - ignore edge vertex near boundary rule. use the same edge vertex rule. Deadline changed to Friday night(7/20) 11:59p Selection - extra

3.5.1 Single slit diffraction

Transcription:

Ry surfce intersections Some primitives Finite primitives: polygons spheres, cylinders, cones prts of generl qudrics Infinite primitives: plnes infinite cylinders nd cones generl qudrics A finite primitive is often n intersection of n infinite with n re of spce 1

Intersecting rys with objects Generl pproch: Use whenever possible the implicit eqution F(q) = 0 of the object or object prts. Use prmetric eqution of the line of the ry, q = p+vt. Solve the eqution F(p+vt) = 0 to find possible vlues of t. Find the miniml nonnegtive vlue of t to get the intersection point (checking tht t is nonegtive is importnt: we wnt intersections with the ry strting from p, not with the whole line! Polygon-ry intersections Two steps: intersect with the plne of the polygon check if the intersection point is inside the polygon We know how to compute intersections with the plne (see prev. lecture). Let q=[q x,q y,q z ] be the intersection point. q

Polygon-ry intersections Possible to do the whole clcultion using 3d points, but it is more efficient to use d points. Converting to the coordintes in the plne is computtionlly expensive. Ide: project to coordinte plne (XY, YZ, or XZ) by discrding one of the vector coordintes. We cnnot lwys discrd, sy, Z, becuse the polygon my project to n intervl, if it is in plne prllel to Z. Choose the coordinte to discrd so tht the corresponding component of the norml to the polygon is mximl. E.g. if n x > n y nd n x > n z, discrd X. D Polygon-ry intersections Now we cn ssume tht ll vertices v i nd the intersection point q re D points. v 4 v 3 q v v 1 Assume tht polygons re convex. A convex polygon is the intersection of set of hlf-plnes, bounded by the lines long the polygon edges. To be inside the polygon the point hs to be in ech hlf-plne. Recll tht the implicit line eqution cn be used to check on which side of the line point is. 3

D Polygon-ry intersections Eqution of the line through the edge connecting vertices v i nd v i+1 : y y x x x y ( v v )(x v ) + ( v v )(y v 0 i i+ 1 i i+ 1 i i ) = If the quntity on the right-hnd side is positive, then the point (x,y) is to the right of the edge, ssuming we re looking from v i to v i+1. Algorithm: if for ech edge the quntity bove is nonnegtive for x = q x, y = q y then the point q is in the polygon. Otherwise, it is not. In the formuls x nd y should be replced by x nd z if y coord. ws dropped, or by y nd z if x ws dropped. Infinite cylinder-ry intersections v p r Infinite cylinder long y of rdius r xis hs eqution x + z - r = 0. The eqution for more generl cylinder of rdius r oriented long line p + v t: (q - p - (v,q - p )v ) - r = 0 where q = (x,y,z) is point on the cylinder. 4

Infinite cylinder-ry intersections To find intersection points with ry p + vt, substitute q = p + vt nd solve: (p - p + vt - (v,p - p + vt)v ) - r = 0 reduces to with A = B= C = At where p = p- p + Bt + C = 0 ( v (v,v )v ) ( v (v,v )v, p ( p,v )v ) ( p ( p,v )v ) r Cylinder cps A finite cylinder with cps cn be constructed s the intersection of n infinite cylinder with slb between two prllel plnes, which re perpendiculr to the xis. To intersect ry with cylinder with cps: intersect with the infinite cylidner; check if the intersection is between the plnes; intersect with ech plne; determine if the intersections re inside cps; out of ll intersections choose the on with miniml t 5

Cylinder-ry intersections POV -ry like cylinder with cps : cp centers t p 1 nd p, rdius r. Infinite cylinder eqution: p = p 1, v = (p - p 1 )/ p - p 1 The finite cylinder (without cps) is described by equtions: (q - p - (v,q - p )v ) - r = 0 nd (v, q- p 1 ) > 0 nd (v, q- p ) < 0 p r The equtions for cps re: (v, q- p 1 ) = 0, (q- p 1 ) < r bottom cp (v, q- p ) = 0, (q- p ) < r top cp p 1 Cylinder-ry intersections Algorithm with equtions: Step 1: Find solutions t 1 nd t of At + Bt + C = 0 if they exist. Mrk s intersection cndidtes the one(s) tht re nonnegtive nd for which (v, q i - p 1 ) > 0 nd (v, q i - p ) < 0, where q i =p+v t i Step : Compute t 3 nd t 4, the prmeter vlues for which the ry intersects the upper nd lower plnes of the cps. If these intersections exists, mrk s intersection cndidtes those tht re nonegtive nd (q 3 - p 1 ) < r (respectively (q 4 - p ) < r ). In the set of cndidtes, pick the one with min. t. 6

Infinite cone-ry intersections v p α p Infinite cone long y with pex hlf-ngle α hs eqution x + z - y = 0. The eqution for more generl cone oriented long line p + v t, with pex t p : cos α (q - p - (v,q - p )v ) - sin α (v,q - p ) = 0 where q = (x,y,z) is point on the cone, nd v is ssumed to be of unit length. Infinite cone-ry intersections Similr to the cse of the cylinder: substitute q = p+vt into the eqution, find the coefficients A, B, C of the qudrtic eqution, solve for t. Denote p = p- p. cos α (vt + p - (v, vt + p )v ) - sin α (v, vt + p ) = 0 A = cos α B = cos C = cos α ( v (v,v )v ) sin α(v,v ) α( v (v,v )v, p ( p,v )v ) ( p ( p,v )v ) sin α( p,v ) sin α(v,v )( p,v ) 7

Cone-ry intersections A finite cone with cps cn lso be constructed s intersection of n infinite cone with slb. Intersections re computed exctly in the sme wy s for the cylinder, but insted of the qudrtic eqution for the infinite cylinder the eqution for the infinite cone is used, nd the cps my hve different rdii. Both for cones nd cylinders intersections cn be computed somewht more efficiently if we first trnsform the ry to coordinte system ligned with the cone (cylinder). This requires extr progrmming to find such trnsformtion. Cone-ry intersections POV-ry cone: cp centers (bse point nd cp point) t p 1 nd p, cp rdii r 1 nd r. Then, ssuming r 1 not equl to r (otherwise it is cylinder) in the eqution of the infinite cone p pex: p = p 1 + r 1 (p - p 1 )/(r 1 - r ); xis direction: v = (p - p 1 )/ p - p 1 ; pex hlf-ngle: tg α = (r 1 - r )/ p - p 1 r p v p 1 r 1 8

Generl qudrics A generl qudric hs eqution Ax + By + Cz + Dxy + Eyz + Fxz + Gx + Hy +Iz + J =0 Intersections with generl qudrics re computed in wy similr to cones nd cylinders: for ry p+ v t, tke x = p x + v x t, y = p y + v y t, y = p z + v z t, nd solve the eqution for t; if there re solutions, tke the smller nonnegtive one. Infinite cones nd cylinders re specil cses of generl qudrics. Generl qudrics Nondegenerte qudrics Ellipsoid x / + y /b + z /c + 1= 0 One-sheet hyperboloid x / - y /b + z /c + 1= 0 Two-sheet hyperboloid x / - y /b + z /c - 1= 0 9

Generl qudrics Nondegenerte qudrics Hyperbolic prbolid x / - z /c - y= 0 Elliptic prbolid x / + z /c - y= 0 cone x / - y /b + z /c = 0 Generl qudrics Degenerte qudrics plnes (no qudrtic terms), pirs of prllel plnes (e.g. x - 1 = 0) pirs of intersecting plnes ( e.g. x -1 = 0) elliptic cylinders (e.g. x +z -1=0) hyperbolic cylinders (e.g. x -z -1=0) prbolic cylinders (e.g. x -z = 0) Possible to get imginry surfces (tht is, with no points)! Exmple: x + 1 = 0 10