Asian American Pacific Islander Month DDSD 2024.pptx
An Easier Approach to Visible Edge Determination from Moving Viewpoint, Paper Presentation @ICEEiCT2014, Dhaka
1. An Easier Approach to Visible
Edge Determination from
Moving Viewpoint
Shibbir Ahmed (Presenter)
Friday, April 11, 2014
2. 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
3. An Easier Approach to Visible Edge Determination from Moving Viewpoint 3/18
Problem Statement
Viewpoint
Obstacles
Unbounded
Visible Region
ViewpointMoving Viewpoint
Input Output
4. 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
5. 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
6. 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
7. 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
8. 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
9. 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
10. 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.
11. 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
12. 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( 𝒏 𝟐)
13. 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’
14. 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 [ 𝑎, 𝑏 ]
15. 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
16. 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
RuningTime(msecs)
Number of Obstacles
Performance Analysis
Running
Time(mili
seconds)
Per
Thousand
Obstacles
17. 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
18. An Easier Approach to Visible Edge Determination from Moving Viewpoint 18/18
Any Question or
Suggestion is Welcome
iCEEiCT
April 11, 2014