Title: OBBTree
1OBBTree
- Han, Gabjong
- hkj84_at_postech.ac.kr
- POSTECH VR Lab
- 2006. 4. 12.
2Outline
- Introduction
- Previous Methods
- Hierarchical Methods
- Other Approaches
- Previous OBB Methods
- OBBTree Building
- Overlap Test for OBBs
- OBB vs. Other Volumes
- Implementation and Performance
- Robustness and Accuracy
- Performance
- Comparison with Others
- RAPID
- Cost Evaluation
- Conclusion
3Introduction - Concepts
- What is collision detection?
- Checks whether two objects overlap in space
- What is proximity?
- Information about the relative configuration of
two objects
4Introduction - Concepts
- What is OBB?
- Synonym for oriented bounding box
- Rectangular bounding box at an arbitrary
orientation in 3D space
OBB
AABB
5Introduction - Problems
- Problems in collision detection
- Model Complexity
- Unstructured Representation
- Close Proximity
- Accurate Contact Determination
6Introduction - Contributions
- OBBTree Contributions
- New hierarchical representation for OBB models
- Fast overlap test for two OBBs
- Comparison with other representations
- Robust and interactive implementation and
demonstration
7Hierarchical Methods
- Simplest algorithms in collision detection
- Problems in hierarchical methods
- Poor performance in extreme cases
- Close proximity
- Multiple contacts
8Hierarchical Methods - Examples
- Examples
- Bounding volumes
- AABBs and Spheres
- Hierarchical structures
- Cone trees, k-d trees and octrees
- Sphere trees, R-trees
- Spatial representations
- BSP and multi-space partitions
- Space-time bounds or four-dimensional testing
9Other Approaches
- Theoretically efficient algorithms
- Problems of this kind
- Unclear practical utility
- Limited models
- Limited motion
- Slow performance
10Previous OBB Methods
- Used to speed up ray-tracing and other
interference computation - Issues in OBBs
- Computing tight-fitting OBBs
- Testing two boxes for overlap
11Previous OBB Methods- Tight-fitting Issues
- Minimal enclosing box algorithm
- O(n3)
- Simple Incremental algorithm
- O(n), but constant factor is very high
- Using Hierarchical model
- Cannot be applied for large unstructured models
12Previous OBB Methods- Overlap Test Issues
- Edge by edge intersection test
- Linear programming algorithm
- General purpose test
13OBBTree Building OBB Data Structure
- Midpoint
- C
- 3 basis vectors
- bu, bv, bw
- 3 half-dimensions
- hu, hv, hw
14OBBTree Building Covariance Matrix
- What is covariance matrix?
- A matrix of covariances between elements of a
vector
15OBBTree Building
- How to get the midpoint of OBB?
- Assume the centroid of all polygons as midpoint
- How to get the orientation of OBB?
- Using the covariance matrix
- Eigenvectors of the matrix is basis
16OBBTree Building- Simple Approach
- Triangulate all polygons
- Obtain the centroid with all triangles
- Compute the covariance matrix
- Get the basis using the eigenvectors of the
matrix - Compute maximum and minimum extents
- Get the center and the half-dimensions of the OBB
17OBBTree Building
- Problem with Simple Approach
- Sampling problem
- Interior vertices
- Dense collection of vertices
- Solution
- Using a convex hull
- Integrating over the surface of each triangle
18OBBTree Building - Building Steps of OBB
- Triangulate all polygons
- Compute the convex hull (added)
- Calculate the centroid (revised)
- Compute the covariance matrix (revised)
- Get the eigenvectors
- Compute the extreme veritces
- Take the points
19OBBTree Building
20OBBTree Building
- Calculate the centroid
- The area of a triangle
-
- The centroid of the triangle
- c (pqr) /3
- The centroid of the entire convex hull
-
21OBBTree Building
- Compute the covariance matrix
-
- Get the eigenvectors
- Covariance matrix is diagonalizable
22OBBTree Building
- Compute the extreme vertices along each axis
- Take the points
- A midpoint is the mean of extreme values
- A half-dimension value is distance between the
midpoint and one extreme value
23OBBTree Building - Method
- Top down methods of OBBTree Building
24OBBTree Building
- Building steps of OBBTree
- Begin with a group of all polygons
- Subdivide recursively until all leaf nodes are
indivisible - Subdivision rule
- Split longest axis to shortest one until it can
split
25Overlap Test for OBBs - Concepts
- Separating axis theorem
- Two convex polytopes are disjoint iff there exist
a separating axis orthogonal to a face of either
polytope or orthogonal to an edge from each
polytope
26Overlap Test for OBBs
- Separating axis test for two boxes
-
-
- T distance between center of A and B
- L separating axis
- Ai half-dimension
- ai basis vector
27Overlap Test for OBBs
- Possible separating axis
- Face to face, face to edge, face to vertex
- Each face can be a separating plane
- Edge to edge
- Two edges can create one plane
- Vertex to vertex, edge to vertex
- They can be expressed by other plane
28Overlap Test for OBBs
- Each box has three unique face normals and three
unique edges - 3 faces 3 faces
- 3 edges 3 edges
- 15 candidates for a separating axis
29Overlap Test for OBBs
- Projection intervals are disjoint iff
-
- Simplifed computation example
-
-
30Overlap Test for OBBs
- Degenerate OBBs
- An OBB become a rectangle or a line segment
- Much simpler test
31Overlap Test for OBBs
- OBBs with infinite extents
- One term should be removed by one infinity
condition - if a2 is infinite,
32Overlap Test for OBBs
- Performance of overlap testing algorithms
- Two previous algorithms are optimized for general
convex polytopes - All these algorithms are much faster than 144
edge-face tests - New algorithm is about 10 times faster than
previous algorithms
33OBB vs. Other Volumes
- What is Hausdorff distance?
- distance from set A to set B is a maximin
function, defined as
34OBB vs. Other Volumes
- Tightness
-
- Diameter
-
- Aspect ratio
-
35OBB vs. Other Volumes Analytical Performance
Comparison
- Aspect ratio and volume changes in hierarch
36OBB vs. Other Volumes - First experiment
- Test for parallel close proximity
- Use two concentric spheres
- Change radius of sphere
- One is 1 and another is 1e
37OBB vs. Other Volumes- Second experiment
- Test for point close proximity
- Use two same-size spheres
- Change distance of e
38OBB vs. Other Volumes
- Analysis
- High curvature
- No advantages for OBBs
- Coarse tessellation
- Have to traverse entire hierarchies
- No advantages for OBBs
- Quadratic convergence property is useful in
parallel close proximity
39Robustness and Accuracy
- Robustness
- Unstructured polygonal method
- Degenerate polygons
- No adjacency information
- No special cases for overlap test
- Easily implementable in hardware
- Accuracy
- Numerically stable
- Error margin guards missing intersection
40Performance
- SGI Reality Engine
- 90 MHZ R8000 CPU, 512MB
41Performance - Pipe scenario
- Smaller object is entirely embedded
- Long thin triangles cannot efficiently
approximated in general
42Performance - Torus scenario
- The spikes prevent large bounding boxes
- The dimples provide concavities
- The wrinkles and the twisting make it impractical
to decompose into convex polytopes
43Comparison with Others
- No standard benchmark available
- Environments
- Based on line-stabbing, AABB and sphere tree
algorithms - On SGI Indigo2 Extreme
- About 10000 polygon models
- About 1/71/5 a second
- Compute all the contacts
- Result
- One order of magnitude improvement
44RAPID
- Rapid and Accurate Polygon Interference Detection
(RAPID) - Implementation of OBBTree
45Cost Evaluation - Equation
- T Nv Cv Np Cp
- T total cost function
- Nv number of bounding volume pair overlap test
- Cv cost of testing a pair of bounding volumes
for overlap - Np the number primitive pairs tested for
interference - Cp cost of testing a pair of primitives for
interference
46Cost Evaluation - Result
- Cv is one-order magnitude slow
- Nv is asympototically low
- Np is asympototically low
- It is asympototically fast for close proximity
47Conclusion
- OBBTree
- A hierarchical data structure for rapid and exact
collision detection between polygonal models - Efficient and fast
- Accurate and robust
48Reference
- S. Gottschalk, M. C. Lin, and D. Manocha,
"OBBTree A Hierarchical Structure for Rapid
Interference Detection, inProceedings of the
ACM SIGGRAPH Conference,1996, pp. 171-180.
(Errata) - RAPID Homepagehttp//www.cs.unc.edu/geom/OBB/OBB
T.html
49QnA