Collision detection is mainly to judge whether there is intersection between virtual models, which means there is collision. Bounding box is one of the important methods of collision detection. It uses regular geometry with simple structure to replace the complex model to be detected. A simple point cloud model usually contains hundreds or thousands of polygons when meshed. When collision tests are performed directly on the geometry of two model objects, the calculation process is relatively complex. In order to reduce the computational cost, the bounding box test of the model was performed before the geometry intersection test. Only when the bounding box has a collision, can further accurate intersection detection be carried out. This paper mainly introduces the content and significance of the bounding box, and compares four kinds of common bounding boxes and their advantages and disadvantages as well as the application scenarios of the bounding box. Firstly, the content and significance of the bounding box are expounded. Secondly, it is analyzed according to different bounding boxes. Finally, the different bounding box algorithms are summarized, and the advantages and disadvantages of different bounding boxes and application scenarios are pointed out.

Virtual reality technology is closely related to many disciplines, which is widely used in simulation teaching, medical surgery, urban planning, industrial simulation and other fields [

For the complex model to be tested, the thought of bounding box is to surround the model to be tested with simple bounding box whose volume is slightly larger than the model to be tested and whose geometric features are regular [

Many scholars have studied and explored the bounding box algorithm. The results show that the choice of bounding box algorithm is one of the key factors affecting the result of collision detection. The more compact the virtual model under test is wrapped by a bounding box, the simpler the set features are, indicating that its wrapping effect is better. But at the same time in bounding box algorithm, its simplicity and compactness are usually contradictory [

Bounding sphere is defined as the smallest volume sphere that can encase the model to be tested [

Three dimensional of the Bounding Sphere.

The radius of the sphere can be expressed as the distance between the farthest vertex and the center of the sphere, and the center of the longest axis is the center surrounding the sphere. The bounding sphere is expressed as formula (1):

_{x}, O_{y}, O_{z}

The principle of intersecting detection between bounding spheres is as follows: judging from the relationship between the sum of the center distance and radius between two spheres, if A and B represent two bounding spheres, the intersection of A and B is only necessary and sufficient if |_{1} + _{2}) is true. This is shown in Figure

Intersecting test between spheres.

For update operations, only rotation and translation are needed to satisfy any operation in space. The update operation of the bounding sphere is that no matter the object rotates or moves along any axis or any point, the bounding sphere always wraps the model under test. Therefore, for a translation operation, it just need to do the same transformation of the center of the sphere according to the translation vector, while for a rotation, it don’t need to do any update operation, and the position of the center of the sphere doesn’t change no matter how rotate it. When compared to other bounding boxes, the advantage of the bounding sphere is obvious. It requires the least amount of computation compared to other bounding boxes.

By reason of the foregoing, although the calculation of the bounding sphere is small, its tightness is also poor. There are too many redundant calculations for most objects with uneven spatial distribution such as irregular geometric models or elongated objects. Because of its structural characteristics, it is suitable for the movement environment where the detection accuracy is not high. Therefore, when selecting the bounding box, the bounding box that is closer to the model to be tested should be selected, and the best scheme should be selected after comprehensive consideration of the advantages and disadvantages.

An Axis-Aligned Bounding Box(AABB) is defined as the smallest hexahedron that wraps the model under test in the same direction as the coordinate axis, so only six scalars are needed to describe an AABB [

Three dimensional of the Axis-Aligned Bounding Box.

In the construction of AABB, all bounding boxes have the same direction along the axial direction of the local coordinate system of the model. AABB is expressed as formula (2):

_{min}, y_{min}, z_{min}, x_{max}, y_{max}, z_{max}

The principle of intersection detection between AABB is as follows: if the vertex of the model intersects all the projected intervals on the three coordinate axes, collision may occur between the detection models. If A and B represent two AABB, where _{A}_{B}_{A}_{B}_{A}_{B}_{A}_{B}

Intersecting test between AABB.

Both translation and rotation have an impact on the AABB update operation, which is not complicated due to the simplicity of AABB. In the case of translation operation, there is no need to rebuild AABB, but only need to change the vertex coordinates of AABB according to the direction vector and displacement of target model translation. In the case of rotation operation, the coordinates of the rotated vertices need to be calculated by rotation Angle and then re-projected to the

Oriented Bounding Box(OBB) is defined as the smallest cuboid that wraps the model to be tested and is in an arbitrary direction relative to the coordinate axis[

Three dimensional of the Oriented Bounding Box.

Because of the flexible orientation of the OBB and its ability to wrap the model under test more tightly, it is difficult to create and update the bounding box for collision detection. The OBB region can be expressed as formula (3):

_{1}, r_{2}, r_{3}_{1}, v_{2}, v_{3}

The principle of OBB’s intersecting detection is complicated, and it uses the Separating Axis Theorem (SAT) test. If you can find A straight line so that the bounding box A is exactly on one side of the line and the bounding box B is exactly on the other side, then the two bounding boxes do not overlap. This line is the separation line and must be perpendicular to the separation axis. The two-dimensional schematic diagram of the testing principle is shown in Figure _{A}_{B}

Intersecting test between OBB.

OBB’s update operations for rotation and translation are less computationally intensive. When the model is translated or rotated, the OBB needs to be updated. A new OBB can be obtained by carrying out the same displacement or rotation on all direction vectors of the model.

OBB is used in a narrow range of scenarios, only between rigid bodies. For soft body, OBB is not applicable. When the object is deformed, the update and reconstruction of OBB hierarchy tree is cumbersome and the calculation is very large, so the real-time detection conditions cannot be guaranteed. There is no good solution to the problem of updating the OBB hierarchy tree, and the cost of rebuilding the bounding box hierarchy tree is too high, so OBB is not suitable for collision detection between soft bodies.

The discrete oriented polytope (

The common

The biggest drawback of

This paper simulates the above three bounding box algorithms. The experiment uses VS2107 compilation environment and VTK visualization library. The 3D point cloud data is the rabbit point cloud data of Stanford in the format of pcd file. Entering point cloud data into it can get the bounding sphere, the bounding box of AABB and OBB that wraps the whole point cloud data. The simulation results are shown in Figure

Simulation results of Sphere, AABB and OBB.

Comparison of various bounding box algorithms is shown in Table

COMPARISON OF VARIOUS BOUNDING BOX ALGORITHMS

Bounding box type | Simplicity | Tightness | Collision Detection Difficulty | Update the Difficulty | Application Scenarios |
---|---|---|---|---|---|

simpler | worst | easiest | easiest | All | |

simplest | worse | easier | more difficult | Both rigid body and soft body are applicable | |

most complex | better | most difficult | easier | All | |

more complex | best | more difficult | most difficult | All |

Through the analysis of the table, it is found that the bounding sphere is relatively simple compared with other bounding boxes in terms of construction difficulty, collision detection difficulty and update calculation difficulty, and it has a wide range of applications, including rigid body and soft body. The only drawback is that it has the worst tightness surrounding the model. In the scene where the detection accuracy is not high, the bounding sphere algorithm can be given priority. AABB is relatively simple in terms of construction difficulty and collision detection difficulty, and has the same disadvantage as the bounding sphere, which has a relatively weak enveloping tightness. It is also relatively difficult to update the calculation. In particular, AABB is not suitable for models with narrow and long shapes and direction deviating from the coordinate axis. OBB has strong bounding compactness and less updating calculation, but its disadvantage is that compared with other bounding boxes, it is more difficult to construct and collision detection, and its application scope is smaller. The tightness of

Bounding box algorithm is a very important algorithm idea in ray tracing and collision detection. This paper introduces some classical bounding box algorithms and analyzes their advantages and disadvantages as well as their application scenarios and scope. It can be seen from this article that there is no one kind of bounding box is the best choice, but according to different scenes to select the most appropriate bounding box. The bounding sphere is simple but with poor accuracy; AABB is simple but complicated to calculate; OBB has good accuracy and simple update but complicated to construct;

The authors will thank Prof. LiuBaolong for his great help in this paper. This work is supported by Science & Technology Program of Weiyang District of Xi’an City with project “2018036”.