an easier approach to visible edge determination from moving viewpoint, paper presentation...

18
An Easier Approach to Visible Edge Determination from Moving Viewpoint Shibbir Ahmed (Presenter) Friday, April 11, 2014

Upload: shibbirtanvin

Post on 08-Aug-2015

24 views

Category:

Education


0 download

TRANSCRIPT

An Easier Approach to Visible Edge Determination from

Moving Viewpoint

Shibbir Ahmed (Presenter)

Friday, April 11, 2014

An Easier Approach to Visible Edge Determination from Moving Viewpoint 2/18

Outline

Problem Statement

Background

Motivation

Preliminaries

Our Approach

Proposed Algorithm

Optimization in case of Moving Viewpoint

Implementation Details & Performance Analysis

An Easier Approach to Visible Edge Determination from Moving Viewpoint 3/18

Problem Statement

Viewpoint

Obstacles

Unbounded Visible Region

Viewpoint Moving Viewpoint

Input Output

An Easier Approach to Visible Edge Determination from Moving Viewpoint 4/18

Background

1963 ; Back-face Culling is used ๐‘…๐‘œ๐‘๐‘’๐‘Ÿ๐‘กโ€ฒ๐‘  Algorithm

๐ด๐‘๐‘๐‘™๐‘’โ€ฒs Algorithm 1967; Polygon instead of Polyhedron

๐‘ƒ๐‘Ž๐‘–๐‘›๐‘ก๐‘’๐‘Ÿโ€ฒs Algorithm Render polygons from back to front,

โ€˜painting overโ€™ previous polygons

๐‘ง๐ตuffer Algorithm Polygons are scan converted in arbitrary order.

When pixels overlap, Intensity & Depth buffer is used to decide which polygon gets that pixel

๐ต๐‘†๐‘ƒ Tree Split a line to apply Divide & Conquer in spatial subdivision; process front & back sub-tree recursively

๐‘†๐‘๐‘Žn๐‘™๐‘–๐‘›๐‘’ Algorithm Render scene scan line for image precision

by maintaining various lists of tables of edge, active edge, polygon, active polygon

An Easier Approach to Visible Edge Determination from Moving Viewpoint 5/18

Motivation

Less complicated approach; can be easily implemented

Determines Visible Regions besides visible edges

Same approach applicable for Moving Viewpoint i.e., easier incremental approach for the problem

Optimization of algorithm for moving viewpoint ensures better time complexity

An Easier Approach to Visible Edge Determination from Moving Viewpoint 6/18

Preliminaries

Object Edge

Edge of simple rectangular objects which may or may not be visible from a particular viewpoint

Active Edge

Always an Object Edge ; At any point throughout the run of the algorithm, there is always a single active edge which is updated time to time

Extension Line

Lines drawn from endpoint of objects to detect new active edge (in case of intersection) or visible Unbounded region (in case of infinite Extension Line)

Extension Line

Object Edge

Viewpoint

Object Edge

Extension Line

Visible Edge

An Easier Approach to Visible Edge Determination from Moving Viewpoint 7/18

Preliminaries (contd.)

Object Endpoints

Total number of endpoints

๐‘›

Closest endpoint from ๐‘ƒ๐‘ฃ ๐‘ƒ๐‘œ

๐‘ƒ0, ๐‘ƒ1, ๐‘ƒ2, ๐‘ƒ3, ๐‘ƒ4, โ€ฆ โ€ฆ โ€ฆ , ๐‘ƒ๐‘›

๐‘ƒ๐‘ฃ

๐‘ƒ0 ๐‘ƒ1

๐‘ƒ2 ๐‘ƒ3

๐‘ƒ4 ๐‘ƒ5

๐‘ƒ6 ๐‘ƒ7 ๐‘ƒ8 ๐‘ƒ9

๐‘ƒ10 ๐‘ƒ11

Initial Active Edge

View Point ๐‘ƒ๐‘ฃ

Visible Edge formed by closest visible endpoint of object from Viewpoint

After determining initial active edge

Angularly Ascending Sorted

Order: ๐‘ƒ2, ๐‘ƒ3 , ๐‘ƒ9,โ€ฆ..

๐‘ƒ๐‘œ๐‘ƒ3,

Initial Active Edge ๐‘ƒ๐‘œ๐‘ƒ3

An Easier Approach to Visible Edge Determination from Moving Viewpoint 8/18

Our Approach

First Case

๐‘ƒ๐‘ฃ

๐‘ƒ0 ๐‘ƒ1

๐‘ƒ2 ๐‘ƒ3

๐‘ƒ4

If the endpoint of an object is situated behind the active edge

If the active edge is ๐‘ƒ0๐‘ƒ1 ; ๐‘ƒ2 is encountered according to the angularly sorted order.

As ๐‘ƒ2 is situated behind the active edge ๐‘ƒ0๐‘ƒ1 , ๐‘ƒ2 is Discarded.

Similar is the case with ๐‘ƒ4

๐‘ƒ4

An Easier Approach to Visible Edge Determination from Moving Viewpoint 9/18

Our Approach(contd.)

Second Case

๐‘ƒ๐‘ฃ

๐‘ƒ0 ๐‘ƒ1

๐‘ƒ2 ๐‘ƒ3

๐‘ƒ4

If an endpoint of an object is situated in front of the active edge

๐‘ƒ๐‘ฃ๐‘ƒ4 is extended which intersects ๐‘ƒ1๐‘ƒ0 in point ๐‘ƒ๐‘›, ๐‘ƒ1๐‘ƒ๐‘› & ๐‘ƒ๐‘›๐‘ƒ4 are inserted into visible edge list and ๐‘ƒ4๐‘ƒ5 is considered as the new active edge.

๐‘ƒ5

๐‘ƒ6

If the active edge is ๐‘ƒ1๐‘ƒ0 and ๐‘ƒ4 is considered according to the angularly sorted order , then the second case arises because ๐‘ƒ4 is in front of ๐‘ƒ1๐‘ƒ0.

๐‘ƒ๐‘› ๐‘ƒ7

An Easier Approach to Visible Edge Determination from Moving Viewpoint 10/18

Our Approach(contd.)

Third Case If an endpoint of an object is the other end of the active edge

๐‘ƒ๐‘ฃ

๐‘ƒ0 ๐‘ƒ1

๐‘ƒ2 ๐‘ƒ3

๐‘ƒ4 ๐‘ƒ5

๐‘ƒ6 ๐‘ƒ๐‘› ๐‘ƒ7

If active edge ๐‘ƒ4๐‘ƒ5 ; ๐‘ƒ5 is encountered according to the angularly sorted order, then the third case arises because, ๐‘ƒ5 is the other end of the active edge ๐‘ƒ4๐‘ƒ5.

๐‘ƒ5

๐‘ƒ๐‘ฃ๐‘ƒ5 is extended to infinity ; if this extension line intersects an object edge, then active & visible edge list is updated.

An Easier Approach to Visible Edge Determination from Moving Viewpoint 11/18

Proposed Algorithm Algorithm: DETERMINE_VISIBLE_EDGE(point Pv) Input : A set of vertices of polygonal objects Output : A set of visible edge or an unbounded visible region

1.1: Sort angularly all end points around Pv

1.2: Determine the initial active edge

1.3: for all points Pi in the sorted list

1.4: if Pi is behind the active edge then

1.5: Update nothing

1.6: else if Pi is in front of the active edge then

1.7: Update visible edge list and active

edge accordingly

1.8: else if Pi is the other end of active edge

then

1.9: Update visible edge list and active

edge accordingly 1.10: end if 1.11: end for

๐‘ƒ๐‘ฃ

๐‘ƒ1

๐‘ƒ10

๐‘ƒ2 ๐‘ƒ3 ๐‘ƒ5

๐‘ƒ6 ๐‘ƒ7

๐‘ƒ8 ๐‘ƒ9

๐‘ƒ4

๐‘ƒ11 ๐‘ƒ12

๐‘ƒ13

๐‘ƒ11

๐‘ƒ14

๐‘ƒ15 ๐‘ƒ16

๐‘ƒ17 ๐‘ƒ18

๐‘ƒ0 ๐‘ƒ0

๐‘ƒ3 ๐‘ƒ2

An Easier Approach to Visible Edge Determination from Moving Viewpoint 12/18

Time Complexity Analysis Algorithm: DETERMINE_VISIBLE_EDGE(point Pv) Input : A set of vertices of polygonal objects Output : A set of visible edge or an unbounded visible region

1.1: Sort angularly all end points around Pv

1.2: Determine the initial active edge

1.3: for all points Pi in the sorted list

1.4: if Pi is behind the active edge then

1.5: Update nothing

1.6: else if Pi is in front of the active edge then

1.7: Update visible edge list and active

edge accordingly

1.8: else if Pi is in the other end of active edge

then

1.9: Update visible edge list and active

edge accordingly 1.10: end if 1.11: end for

O(๐’ ๐’๐’๐’ˆ๐’)

O(๐’)

๐Ž(n)

๐Ž(n)

๐Ž(๐’2)

In Worst Case

O(๐’๐Ÿ)

An Easier Approach to Visible Edge Determination from Moving Viewpoint 13/18

Optimization for Moving Viewpoint

Modifying Angularly Sorted Order

P comes before R when they are sorted angularly around Oโ€™ and P comes after R when they are sorted angularly around O.

This is due to the fact that the straight line connecting P and R intersects the line segment OOโ€™.

So if we pre-calculate all intersection points between O(n2) lines and the straight line along which we move the viewpoint, we can determine which pairs to swap in the angularly sorted list in a straight forward manner.

P

R

O Oโ€™

An Easier Approach to Visible Edge Determination from Moving Viewpoint 14/18

Optimization for Moving Viewpoint

Improving Intersection Point Determination

We pre-calculate the angular span of each obstacle by considering two oblique tangents between the obstacle and the straight line segment along which we move the viewpoint.

We can use a segment tree to store all the angular spans which allows us to determine all the candidate intersecting obstacles of an extension line in logarithmic time.

๐‘ถ

๐‘Ž ๐‘

Angular Span of O is [ ๐‘Ž, ๐‘ ]

An Easier Approach to Visible Edge Determination from Moving Viewpoint 15/18

Implementation Details

C++ Language & OpenGL API

Input:

Simple axis aligned rectangles as

obstacles in .txt file

Output:

Visible edge or Visible Unbounded Region from

Moving Viewpoint in different position inside a

2D space

An Easier Approach to Visible Edge Determination from Moving Viewpoint 16/18

Performance Analysis

No. Number of

Obstacles

Running

Time(msecs)

1. 1000 22

2. 2000 42

3. 3000 70

4. 4000 96

5. 5000 130

6. 6000 161

7. 7000 200

8. 8000 241

9. 9000 298

10 10000 365

The Running times of the initial run of the algorithm around the first viewpoint has been calculated for randomly

generated 1000 to 10000 obstacles.

0

50

100

150

200

250

300

350

400

1000 2000 3000 4000 5000 6000 7000 8000 9000 10000

Ru

nin

g Ti

me

(mse

cs)

Number of Obstacles

Performance Analysis

Running

Time(mili

seconds)Per

Thousand

Obstacles

An Easier Approach to Visible Edge Determination from Moving Viewpoint 17/18

An Easier and less complicated algorithm is proposed for determining visible edge so to say unbounded visible region from moving viewpoint.

Further modification of this algorithm can be made to determine the visible surface from moving perspective in 3D space also with better time complexity.

Optimization of the algorithm for moving viewpoint is expected to perform far better than the worst case time complexity.

Conclusions

An Easier Approach to Visible Edge Determination from Moving Viewpoint 18/18

Any Question or Suggestion is Welcome

iCEEiCT April 11, 2014