Collision detection method using Sphere-AABB hierarchical bounding box based on Unity 3D environment

By using the Sphere-AABB hierarchical bounding box algorithm and binary tree structure for collision detection in a virtual assembly environment, the problems of collision detection accuracy and response delay in complex scenarios in the virtual assembly environment are solved, and assembly efficiency and quality are improved.

CN119251186APending Publication Date: 2025-01-03NANJING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411348457.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

In virtual assembly environments, existing collision detection technology cannot meet the needs of high precision and high response delays, especially in high-precision large-scale electronic product assembly in complex scenarios, and cannot effectively improve assembly efficiency and quality.

Method used

The Sphere-AABB hierarchical bounding box algorithm is used to combine binary tree structure for collision detection, and the rough detection is performed through Sphere and AABB for accurate detection, reducing complexity and improving the search rate, and performing collision response and tactile rendering when collision is detected to increase reality and interactivity.

Benefits of technology

It improves the accuracy and efficiency of collision detection, enhances the authenticity and user experience of the virtual assembly system, and achieves the quality improvement of high-precision large-scale electronic product assembly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251186A_ABST
    Figure CN119251186A_ABST
Patent Text Reader

Abstract

The invention discloses a VR virtual assembly system of an array antenna, and provides a collision detection method using a Sphere-AABB hierarchical bounding box based on a Unity 3D environment. Firstly, a method principle is determined; then, a Sphere-AABB hierarchical bounding box is constructed, and compared with a single bounding box, the hierarchical bounding box has the advantages of being better in tightness and higher in detection efficiency; and then, a collision detection response is designed based on a Unity 3D system, geometric constraint and touch rendering content are added, and the immersion and experience of the user are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of computer graphics and virtual reality technology development, in particular to a collision detection method using Sphere-AABB hierarchical bounding boxes based on Unity 3D environment. Background Art

[0002] High-precision electronic products often have a very complex assembly process, and their assembly process greatly affects the quality of the final product. Due to the complexity of the structure of some high-precision large-scale electronic products, their assembly process is very dependent on the experience of the workers. The assembly method adopts "blind insertion, blind installation, and blind adjustment", and the assembly quality is difficult to guarantee. As a result, it takes an average of a long time and hundreds of repeated installations and adjustments to form a qualified product, and the one-time assembly pass rate is zero. Faced with the situation where the assembly efficiency and quality of such complex electromechanical products are relatively low, it is urgent to introduce new assembly optimization methods to achieve a comprehensive improvement in the assembly quality of high-precision large-scale electronic products.

[0003] Traditional assembly teaching methods, such as video guides, lack guidance on relevant knowledge and cannot enable employees to master assembly and detailed processes proficiently and effectively. At the same time, they are also limited by the environment and resources when learning. Simulating the assembly process in a virtual environment can solve the limitations of these traditional methods. The virtual assembly system allows users to quickly and easily control the key points in the assembly process, improve the assembly level through repeated practice, and effectively solve the problem of space and resource waste. The present invention takes the assembly of high-precision large-scale electronic products as the research object, focuses on its key process flow and assembly characteristics, and focuses on the collision detection problem in virtual assembly based on VR technology, in order to achieve a guiding role in its assembly work and improve assembly efficiency.

[0004] Collision detection is the main way to trigger interactive events in three-dimensional scenes. Collision detection technology can be used to add physical simulation properties to virtual objects in three-dimensional scenes, making virtual objects real. When a collision between entities is detected, interactive events can be dynamically triggered.

[0005] The initial application of 3D scenes was mainly in the field of games and entertainment. The scene structure was relatively simple, and the requirements for collision detection accuracy and response delay were relatively low. The built-in components of the 3D development engine can meet general collision detection requirements. However, the virtual assembly environment has very high requirements for interactive response delay and accuracy, and the original collision detection technology can only realize the boundary detection of regular models in simple scenes, and cannot meet higher-precision detection. Therefore, this study intends to try to adopt a strategy of mixing different bounding box algorithms to improve the accuracy and real-time performance of collision detection in complex scenes. Summary of the invention

[0006] The purpose of the present invention is to provide a collision detection method using Sphere-AABB hierarchical bounding box based on Unity 3D environment, which can provide collision detection support in VR virtual assembly system.

[0007] The technical solution to achieve the purpose of the present invention is:

[0008] A collision detection method using Sphere-AABB hierarchical bounding box based on Unity 3D environment includes the following steps:

[0009] Step 1: Determine the principle of collision detection method: Decide to use Sphere-AABB (sphere-axis aligned bounding box) hierarchical bounding box algorithm, and develop collision detection of VR virtual assembly system based on Unity 3D (a three-dimensional virtual reality development engine) environment;

[0010] Step 2: Construct Sphere-AABB hierarchical bounding box: For each object in the scene, construct a Sphere-AABB hierarchical bounding box containing Sphere and AABB according to its shape and position, choose to use a binary tree as a hybrid bounding tree, and traverse and search from top to bottom;

[0011] Step 3: Design collision response, add geometric constraints, and tactile rendering content.

[0012] Compared with the prior art, the present invention has the following significant advantages:

[0013] (1) Using the Sphere-AABB hierarchical bounding box, when the collision bodies are far apart, the retrieval complexity is reduced and the retrieval rate is increased. Sphere can be used for rough collision detection first, and if they intersect, AABB can be used for precise collision detection. Because our research object contains many sheet-like and block-like parts, using AABB as a leaf node can improve the tightness of the sheet-like and block-like model encirclement, thereby accelerating collision detection and other spatial queries, balancing accuracy and performance, and achieving the best rendering and physical simulation effects. The binary tree hierarchical bounding tree model can avoid redundant calculations for objects that are obviously not intersecting, and has a simple structure, which can effectively improve retrieval efficiency.

[0014] (2) Collision response and tactile rendering have been added to the collision detection system, and feedback force calculation has been added, which can more realistically reflect the situation during a collision, increase the authenticity and interactivity of the virtual assembly system, and enhance the user experience and immersion. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 This is a schematic diagram of the Sphere-AABB hierarchical bounding box.

[0016] Figure 2 Build a flow chart for a binary tree hierarchy.

[0017] Figure 3 This is the collision detection flow chart. DETAILED DESCRIPTION

[0018] The specific embodiments of the present invention will be further described below in conjunction with the accompanying drawings.

[0019] Attached Figure 1 This is a schematic diagram of the Sphere-AABB hierarchical bounding box. When the collision bodies are far apart, in order to reduce the complexity of retrieval and increase the retrieval rate, you can first use Sphere for rough collision detection. If they intersect, then use AABB for precise collision detection. Because our target assembly contains many sheet-like and block-like structures, using AABB as a leaf node can improve the tightness of the encirclement of sheet-like and block-like models. At the same time, combining Sphere and AABB can avoid redundant calculations for objects that are obviously not intersected, thereby accelerating collision detection and other spatial queries, balancing accuracy and performance to achieve the best rendering and physical simulation effects.

[0020] Attached Figure 2 This is a flowchart for building a binary tree hierarchy. First, because the models in Unity3D are stored in triangular facets, we need to generate a set containing all the target component triangular facet models. Then, we divide the set by recursive division, which requires selecting a reasonable division axis and division point. Subsequently, using the determined division point and division axis, the object set is divided into two subsets. Finally, connect the node with its parent node and iterate the above process to gradually complete the division.

[0021] Attached Figure 3 It is a collision detection flow chart. In the virtual assembly process, the initial material color information of the parts is first obtained, and its motion state is identified. The collision information between parts is identified according to the collision detection principle of the Sphere-AABB hierarchical bounding box. If a collision is detected, the corresponding collision response is executed. The collision response mainly includes color change and tactile rendering.

[0022] The present invention is a collision detection method using Sphere-AABB hierarchical bounding box based on Unity 3D environment, characterized in that it comprises the following steps:

[0023] Step 1: Determine the principle of collision detection method: Decide to use Sphere-AABB hierarchical bounding box algorithm, and develop collision detection of VR virtual assembly system based on Unity 3D environment, which can better and more tightly wrap the research object model and has faster retrieval speed;

[0024] Step 2: Construct a Sphere-AABB hierarchical bounding box: For each object in the scene, construct a Sphere-AABB hierarchical bounding box containing a Sphere and AABB according to its shape and position. Use a binary tree as the hybrid bounding tree and perform a top-down traversal search. The hierarchical bounding box construction method is as follows:

[0025] (1) Construct Sphere and AABB calculation method:

[0026] Sphere is the smallest sphere that contains the target object. Its advantages are simple calculation, fast response speed and no impact from the rotation of the target object. However, it has poor fit with the target model, generates a lot of redundant space and has poor collision detection accuracy.

[0027] R = {(x,y,z)|(xo x ) 2 +(yO y ) 2 +(zO z ) 2 <r 2} (1)

[0028]

[0029]

[0030] Among them, xmax, xmin, ymax, ymin, zmax, and zmin are the minimum and maximum values ​​of the object vertices mapped to the x, y, and z coordinate axes respectively; Ox, Oy, and Oz represent the coordinates of the x, y, and z axes corresponding to the center of the sphere O, respectively, and r is the radius.

[0031] An AABB bounding box is a rectangular bounding box whose sides are parallel to the coordinate axes, that is, its bounding box will not change direction as the object rotates and will always remain parallel to the coordinate axes. This feature makes AABB very efficient and practical in collision detection, bounding box hierarchy, and object selection. AABB is generally represented as:

[0032] R = {(x, y, z)|x min ≤x≤x max ,y min ≤y≤y max , z min ≤z≤z max} (4)

[0033] Among them, x min 、x max ,y min ,y max 、z min 、z max Respectively represent the minimum and maximum projection coordinates of the object's vertices mapped to the x, y, and z coordinate axes.

[0034] (2) Construct Sphere-AABB hierarchical bounding box:

[0035] When the collision bodies are far apart, in order to reduce the complexity of retrieval and increase the retrieval rate, you can first use Sphere for rough collision detection, and if they intersect, then use AABB for precise collision detection. Because the objects contained in our target assembly contain many sheet-like and block-like structures, using AABB as a leaf node can improve the tightness of the encirclement of sheet-like and block-like models. At the same time, combining Sphere and AABB can avoid redundant calculations for objects that are obviously not intersected, thereby accelerating collision detection and other spatial queries.

[0036] (3) Constructing a binary tree structure. The present invention uses a top-down method to construct a binary tree.

[0037] Here are the steps:

[0038] First, generate a collection containing all the objects to be processed. Since the models in Unity3D are stored as triangular facets, you need to generate a collection containing the triangular facet (mesh) models of all target components.

[0039] Then, select a reasonable split axis. Usually, the longest axis in the bounding box is selected as the split axis, which can minimize the overlap of the bounding boxes and improve the efficiency of collision detection. Here, programming is based on Unity3D, searching for the lengths in each direction for comparison and solving for the longest axis.

[0040] Secondly, determine the split point. Project all objects onto the split axis, calculate the coordinates of all projection points, and select the median of these coordinates as the split point. Using the median point as the split point has significant advantages when constructing a binary tree, including maintaining the balance of the tree, optimizing performance, simplifying implementation difficulty, and adapting to a variety of application scenarios.

[0041] Afterwards, the triangular face (mesh) set is divided into two subsets using the determined segmentation points and segmentation axes.

[0042] Finally, the subset is connected to the triangle patch set, the node is connected to its parent node, and the subset is used as the new root node. The above process is iterated to gradually complete the division.

[0043] Step 3: Design collision response, add geometric constraints, and tactile rendering content. In the virtual assembly process, first obtain the initial material color information of the parts and identify its motion state. According to the collision detection principle of the Sphere-AABB hierarchical bounding box, identify the collision information between the parts. If a collision is detected, execute the corresponding collision response. The collision response mainly includes color change and tactile rendering, which is specifically reflected in the model turning red and the operating handle vibrating when it occurs.

Claims

1. A collision detection method based on Sphere-AABB hierarchical bounding box in Unity 3D environment, characterized in that: The following steps are involved: Step 1: Determine the principle of collision detection method: Decide to use Sphere-AABB hierarchical bounding box algorithm and develop collision detection of VR virtual assembly system based on Unity 3D environment; Step 2: Construct Sphere-AABB hierarchical bounding box: For each object in the scene, construct a Sphere-AABB hierarchical bounding box containing Sphere and AABB according to its shape and position, choose to use a binary tree as a hybrid bounding tree, and traverse and search from top to bottom; Step 3: Design collision response, add geometric constraints, and tactile rendering content.

2. The collision detection method using Sphere-AABB hierarchical bounding box in Unity 3D environment according to claim 1, characterized in that: In step 2, Sphere is the smallest sphere that contains the target object, and its calculation method is: R={(x,y,z)|(x-O x ) 2 +(y-O y ) 2 +(z-O z ) 2 <r 2 } (1) Among them, xmax, xmin, ymax, ymin, zmax, and zmin are the minimum and maximum values ​​of the object's vertices mapped to the x, y, and z coordinate axes respectively; Ox, Oy, and Oz represent the coordinates of the x, y, and z axes of the sphere center O respectively, and r is the radius; AABB is a rectangular bounding box whose sides are parallel to the coordinate axes, that is, its bounding box will not change direction as the object rotates and always remains parallel to the coordinate axes; AABB is expressed as: R={(x,y,z)|x min ≤x≤x max ,y min ≤u≤y max ,z min ≤z≤z max } (4) Among them, x min 、x max ,y min ,y max 、z min 、z max Respectively represent the minimum and maximum projection coordinates of the object's vertices mapped to the x, y, and z coordinate axes.

3. The collision detection method using Sphere-AABB hierarchical bounding box in Unity 3D environment according to claim 2, characterized in that: The specific method of constructing the Sphere-AABB hierarchical bounding box is: when the collision bodies are far apart, in order to reduce the complexity of retrieval and increase the retrieval rate, first use Sphere for rough collision detection, and if they intersect, further use AABB for precise collision detection.

4. The collision detection method using Sphere-AABB hierarchical bounding box based on Unity 3D ring according to claim 1, characterized in that: In step 2, the binary tree structure is constructed as follows: The first step is to generate a collection containing all objects to be processed; since the models in Unity3D are stored in triangular facets, it is necessary to generate a collection containing the triangular facet mesh models of all target components; The second step is to select the longest axis in the Sphere or AABB as the segmentation axis. The specific method of determining the longest axis is to perform programming based on Unity 3D, search for the lengths in each direction and compare them to find the longest axis. The third step is to determine the segmentation point. The specific method is: project all objects onto the segmentation axis, calculate the coordinates of all projection points, and select the median of these coordinates as the segmentation point; The fourth step is to divide the triangular face mesh set into two subsets using the determined segmentation points and segmentation axes; The fifth step is to connect the subset to the triangle face set, connect the node to its parent node, and use the subset as the new root node. Iterate the above process to gradually complete the division.