Presentation is loading. Please wait.

Presentation is loading. Please wait.

Quiz 2 [answer in the back] 2. Two line segments: S1: (1,2) to (5,6) S2: (3,5) to (7,3) Compute the intersection 3. Explain the complexity for line segment.

Similar presentations


Presentation on theme: "Quiz 2 [answer in the back] 2. Two line segments: S1: (1,2) to (5,6) S2: (3,5) to (7,3) Compute the intersection 3. Explain the complexity for line segment."— Presentation transcript:

1 Quiz 2 [answer in the back] 2. Two line segments: S1: (1,2) to (5,6) S2: (3,5) to (7,3) Compute the intersection 3. Explain the complexity for line segment intersection is O((n+I)logn) 1. Sketch the sweep line and complete the corresponding event queue and T. Perform all required steps and highlight the step that report an intersection (an intersection between ??)

2 s1s1 s2s2 s3s3 a b c d e f Event Queue [ ] Event point: [ ] U = { } C = { } L = { } T = [ ]

3 s1s1 s2s2 s3s3 a b c d e f Event Queue [ ] Event point: [ ] U = { } C = { } L = { } T = [ ]

4 s1s1 s2s2 s3s3 a b c d e f Event Queue [ ] Event point: [ ] U = { } C = { } L = { } T = [ ]

5 s1s1 s2s2 s3s3 a b c d e f Event Queue [ ] Event point: [ ] U = { } C = { } L = { } T = [ ]

6 s1s1 s2s2 s3s3 a b c d e f Event Queue [ ] Event point: [ ] U = { } C = { } L = { } T = [ ]

7 s1s1 s2s2 s3s3 a b c d e f Event Queue [ ] Event point: [ ] U = { } C = { } L = { } T = [ ]

8 s1s1 s2s2 s3s3 a b c d e f Event Queue [ ] Event point: [ ] U = { } C = { } L = { } T = [ ]

9 s1s1 s2s2 s3s3 a b c d e f Event Queue [ bcdef ] Event point: [ a ] U = { s1 } C = { } L = { } T = [ s1 ]

10 s1s1 s2s2 s3s3 a b c e d f Event Queue [ ] Event point: [ ] U = { } C = { } L = { } T = [ ] g s4s4

11 s1s1 s2s2 s3s3 a b c d e f Event Queue [ cdef ] Event point: [ b ] U = { s2 } C = { } L = { } T = [ s1 s2 ] S ’ =s2, sl = s1, find intersect S ” =s2, sr =nil, no-op

12 s1s1 s2s2 s3s3 a b c d e f Event Queue [ xdef ] Event point: [ c ] U = { s3 } C = { } L = { } T = [ s1 s2 s3 ] S ’ =s3, sl = s2, find intersect->x S ” =s3, sr =nil, no-op x

13 s1s1 s2s2 s3s3 a b c d e f Event Queue [ def ] Event point: [ x ] U = { } C = { s2,s3 } L = { } Report intersection: T = [ s1 s3 s2 ] S ’ =s3, sl = s1, find intersect->y S ” =s2, sr =nil, no-op Y=d x

14 s1s1 s2s2 s3s3 a b c d e f Event Queue [ ef ] Event point: [ d ] U = { } C = { s3 } L = { s1 } Report intersection T = [ s3 s2 ] S ’ =s3, sl = nil, S ” =s3, sr =s2, intersect above scanline x

15 s1s1 s2s2 s3s3 a b c d e f Event Queue [ f ] Event point: [ e ] U = { } C = {} L = { s2 } T = [ s3 ] Sl=s3, sr = nil, no-op x

16 s1s1 s2s2 s3s3 a b c d e f Event Queue [] Event point: [ f ] U = { } C = {} L = { s3 } T = [ ] x


Download ppt "Quiz 2 [answer in the back] 2. Two line segments: S1: (1,2) to (5,6) S2: (3,5) to (7,3) Compute the intersection 3. Explain the complexity for line segment."

Similar presentations


Ads by Google