an easier approach to visible edge determination from moving viewpoint, paper presentation...
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