Top Banner
1 Dr. Scott Schaefer Intersecting Simple Surfaces
69

1 Dr. Scott Schaefer Intersecting Simple Surfaces.

Dec 14, 2015

Download

Documents

Emil Hamilton
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

1

Dr. Scott Schaefer

Intersecting Simple Surfaces

Page 2: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

2/66

Types of Surfaces

Infinite Planes Polygons

Convex Ray Shooting Winding Number

Spheres Cylinders

Page 3: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

3/66

Infinite Planes

Defined by a unit normal n and a point o

0)( oxn

Page 4: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

4/66

Infinite Planes

Defined by a unit normal n and a point o

0)( oxntvptL )(

Page 5: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

5/66

Infinite Planes

Defined by a unit normal n and a point o

0)( oxntvptL )(

0)( otvpn

Page 6: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

6/66

Infinite Planes

Defined by a unit normal n and a point o

0)( oxntvptL )(

)( pontvn

Page 7: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

7/66

Infinite Planes

Defined by a unit normal n and a point o

0)( oxntvptL )(

vn

pont

)(

Page 8: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

8/66

Infinite Planes

Defined by a unit normal n and a point o

0)( oxntvptL )(

vn

ponvp

)(

Page 9: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

9/66

Polygons

Intersect infinite plane containing polygon Determine if point is inside polygon

Page 10: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

10/66

Polygons

Intersect infinite plane containing polygon Determine if point is inside polygon

How do we know if a point is inside a polygon?

Page 11: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

11/66

Point Inside Convex Polygon

Page 12: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

12/66

Check if point on same side of all edges

Point Inside Convex Polygon

Page 13: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

13/66

Check if point on same side of all edges

Point Inside Convex Polygon

Page 14: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

14/66

Check if point on same side of all edges

Point Inside Convex Polygon

Page 15: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

15/66

Check if point on same side of all edges

Point Inside Convex Polygon

Page 16: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

16/66

Check if point on same side of all edges

Point Inside Convex Polygon

Page 17: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

17/66

Check if point on same side of all edges

Point Inside Convex Polygon

Page 18: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

18/66

Check if point on same side of all edges

Point Inside Convex Polygon

Page 19: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

19/66

Check if point on same side of all edges

Point Inside Convex Polygon

Page 20: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

20/66

Check if point on same side of all edges

Point Inside Convex Polygon

Page 21: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

21/66

Check if point on same side of all edges

Point Inside Convex Polygon

Page 22: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

22/66

Point Inside Convex Polygon

X iP

1iP sign same bemust

)(

)(

1T

i

Ti

T

XP

XP

N

Page 23: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

23/66

Point Inside Polygon Test

Given a point, determine

if it lies inside a polygon

or not

Page 24: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

24/66

Ray Test

Fire ray from point Count intersections

Odd = inside polygonEven = outside polygon

Page 25: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

25/66

Problems With Rays

Fire ray from point Count intersections

Odd = inside polygonEven = outside polygon

ProblemsRay through vertex

Page 26: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

26/66

Problems With Rays

Fire ray from point Count intersections

Odd = inside polygonEven = outside polygon

ProblemsRay through vertex

Page 27: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

27/66

Problems With Rays

Fire ray from point Count intersections

Odd = inside polygonEven = outside polygon

ProblemsRay through vertexRay parallel to edge

Page 28: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

28/66

A Better Way

Page 29: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

29/66

A Better Way

Page 30: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

30/66

A Better Way

Page 31: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

31/66

A Better Way

Page 32: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

32/66

A Better Way

Page 33: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

33/66

A Better Way

Page 34: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

34/66

A Better Way

Page 35: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

35/66

A Better Way

Page 36: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

36/66

A Better Way

Page 37: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

37/66

A Better Way

Page 38: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

38/66

A Better Way

Page 39: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

39/66

A Better Way

One winding = inside

Page 40: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

40/66

A Better Way

Page 41: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

41/66

A Better Way

Page 42: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

42/66

A Better Way

Page 43: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

43/66

A Better Way

Page 44: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

44/66

A Better Way

Page 45: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

45/66

A Better Way

Page 46: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

46/66

A Better Way

Page 47: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

47/66

A Better Way

Page 48: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

48/66

A Better Way

Page 49: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

49/66

A Better Way

Page 50: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

50/66

A Better Way

Page 51: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

51/66

A Better Way

zero winding = outside

Page 52: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

52/66

Requirements

Oriented edges Edges can be processed

in any order

Page 53: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

53/66

Computing Winding Number

Given unit normal n =0 For each edge (p1, p2)

If , then inside

1p

2px

xpxp

xpxp

xpxp

xpxpn

21

211

21

21 )()(cos

)()(

))()((

Page 54: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

54/66

Advantages

Extends to 3D! Numerically stable Even works on models

with holes (sort of) No ray casting

Page 55: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

55/66

Intersecting Spheres

Three possible casesZero intersections: miss the sphereOne intersection: hit tangent to sphereTwo intersections: hit sphere on front and

back side

How do we distinguish these cases?

Page 56: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

56/66

Intersecting Spheres

0)()()( 2 rcxcxxF

Page 57: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

57/66

Intersecting Spheres

0)()()( 2 rcxcxxF

0)()())(( 2 rctvpctvptLF

Page 58: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

58/66

Intersecting Spheres

0)()()( 2 rcxcxxF

0)()())(( 2 rctvpctvptLF

0)()()(2)())(( 22 rcpcptcpvtvvtLF

Page 59: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

59/66

Intersecting Spheres

is quadratic in t0))(( tLF

0)()()(2)())(( 22 rcpcptcpvtvvtLF

a b c

Page 60: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

60/66

Intersecting Spheres

is quadratic in t

Solve for t using quadratic equation

If , no intersection If , one intersection Otherwise, two intersections

0))(( tLF

0)()()(2)())(( 22 rcpcptcpvtvvtLF

a b c

a

acbbt

2

42

042 acb

042 acb

Page 61: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

61/66

Normals of Spheres

0)()()( 2 rcxcxxF

cxxF )(

Page 62: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

62/66

Infinite Cylinders

Defined by a center point C, a unit axis direction A and a radius r

A

C

r

Page 63: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

63/66

Infinite Cylinders

Defined by a center point C, a unit axis direction A and a radius r

A

C

r)(tL

Page 64: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

64/66

Infinite Cylinders

Defined by a center point C, a unit axis direction A and a radius r

A

C

r

1.Perform an orthogonal projection to the plane defined by C, A on the line L(t) and intersect with circle in 2D

)(ˆ tL

Page 65: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

65/66

Infinite Cylinders

Defined by a center point C, a unit axis direction A and a radius r

A

C

r)(tL

2.Substitute t parameters from 2D intersection to 3D line equation

Page 66: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

66/66

Infinite Cylinders

Defined by a center point C, a unit axis direction A and a radius r

A

C

r)(tL

3.Normal of 2D circle is the same normal of cylinder at point of intersection

N

Page 67: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

67/66

Page 68: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

68/66

Infinite Cylinders

Defined by a center point C, a unit axis direction A and a radius r

A

C

r

PN

Page 69: 1 Dr. Scott Schaefer Intersecting Simple Surfaces.

69/66

Infinite Cylinders

Defined by a center point C, a unit axis direction A and a radius r

A

C

r

PN

(( ) )P C P C A AN

r