A method, device and equipment for human-computer interaction based on non-structural grid of aircraft, and a storage medium
By employing a top-down recursive partitioning and bounding box construction method, the problem of low efficiency in human-computer interaction with unstructured meshes is solved, enabling efficient capture and refresh of interactive objects under large data volumes, thereby improving the user experience.
Patent Information
- Application Number
- CN202511500923.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2045-10-21
AI Technical Summary
Existing technologies are inefficient in human-computer interaction based on unstructured meshes of aircraft, especially when the data volume reaches tens of millions or even hundreds of millions, they cannot efficiently capture and refresh interactive objects, and the difference in the graphics card configuration of users' computers leads to poor interaction effects.
A top-down recursive partitioning method is used to construct directed bounding boxes. The unstructured mesh is recursively partitioned into a preset number of sub-bounding boxes. The bounding boxes are used for intersection detection and data storage. Collision detection is performed in conjunction with captured state flags to achieve efficient human-computer interaction.
It improves the efficiency of human-computer interaction in unstructured grids, enhances the user experience, and enables rapid response to interaction commands and accurate object capture under large data volumes.
Smart Images

Figure CN120973241B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of fluid mechanics, in particular to a man-machine interaction method and device based on aircraft unstructured grid, equipment and storage medium. BACKGROUND
[0002] At present, the research of three-dimensional space index technology mainly focuses on octree, three-dimensional R-tree and the like. In addition, there is a laser point cloud data management method integrating octree and three-dimensional R-tree in the prior art, but the above algorithm has certain requirements for application scenarios, that is, it is not applicable to grid model data with various model forms for uniformly distributed point cloud data.
[0003] In addition, the octree algorithm has certain limitations. For non-uniform data, the intermediate nodes of the octree need to continue to divide the octree according to the convergence condition until the condition converges, and the index time is affected by the tree hierarchy structure. When the method is applied to the OpenGL picking operation, the grid object capture time is greatly affected by the tree structure, and the effect is not ideal. Furthermore, the prior art proposes a LOD_OR tree spatial index structure in three-dimensional GIS. The algorithm integrates octree and R-tree, that is, the index idea of octree is applied to R-tree to limit the space, but when the algorithm is applied to the OpenGL picking operation, the capture time is still greatly affected by the tree hierarchy structure, and the capture time is uncontrollable. That is, the above improved algorithm has good effect in the specified application scenario, but for the application scenario of real-time interaction of interactive objects reaching the level of millions of data
[0004] That is, the above technology has the following problems:
[0005] 1. The user's computer graphics card configuration is uneven, and the interaction technology is limited;
[0006] 2. For human-computer interaction software with data reaching the level of tens of millions or even hundreds of millions, especially in the field of CFD, the difference between the field size and the surface size is large, and the existing technology cannot achieve efficient capture picking;
[0007] 3. For human-computer interaction software, especially human-computer interaction software with data reaching the level of tens of millions or even hundreds of millions in the field of CFD, data refresh is crucial, and the above technology cannot meet the data refresh requirements of large data volume.
[0008] From the above, how to improve the efficiency of man-machine interaction based on aircraft unstructured grid in the process of man-machine interaction based on aircraft unstructured grid is a problem to be solved at present. SUMMARY
[0009] Therefore, the present application aims to provide an aircraft unstructured grid-based human-computer interaction method, device, equipment and storage medium, which can improve the efficiency of human-computer interaction based on aircraft unstructured grid in the process of human-computer interaction based on aircraft unstructured grid. The specific scheme is as follows:
[0010] In the first aspect, the present application provides an aircraft unstructured grid-based human-computer interaction method, comprising:
[0011] The current oriented bounding box is constructed based on the aircraft unstructured grid to be processed, and the current oriented bounding box is set as a current root node. Then, the current oriented bounding box is evenly divided into a preset number of sub bounding boxes at the current level by using a top-down recursive division method starting from the current root node, and each sub bounding box is bound to a child node of the current root node to obtain a current spatial partition structure.
[0012] It is judged whether the current level is less than a preset level threshold. If it is less than, the current level is updated, and each sub bounding box is set as a new current oriented bounding box. Then, the step of setting the current oriented bounding box as the current root node is re-jumped until the current level is not less than the preset level threshold, and the current spatial partition structure is set as a target spatial partition structure.
[0013] An interactive object grid set is generated based on a model file of the unstructured grid to be processed, and a minimum bounding box corresponding to each interactive object in the interactive object grid set is determined. Then, the minimum bounding boxes are sequentially intersected with each node in the target spatial partition structure in order of level from small to large to determine a bottom leaf node intersected with the minimum bounding box, and data of the interactive object is stored in the corresponding bottom leaf node.
[0014] It is judged whether the interactive object data is stored in each bottom leaf node, and a capture state identifier is set based on the judgment result. Then, collision detection is performed on the bounding box corresponding to each bottom leaf node with the capture state identifier set in the interactive range corresponding to the interactive instruction to obtain a target interactive object.
[0015] Optionally, the current oriented bounding box is constructed based on the aircraft unstructured grid to be processed, and the current oriented bounding box is set as a current root node. Then, the current oriented bounding box is evenly divided into a preset number of sub bounding boxes at the current level by using a top-down recursive division method starting from the current root node, and each sub bounding box is bound to a child node of the current root node to obtain a current spatial partition structure, comprising:
[0016] Determine a non-structured grid corresponding to the aircraft to be processed, and determine an overall size and a spatial position corresponding to the non-structured grid to be processed, so as to construct a current oriented bounding box containing the non-structured grid to be processed based on the overall size and the spatial position, and determine a bounding box size of the current oriented bounding box; the bounding box size of the current oriented bounding box is greater than the overall size;
[0017] Determine a preset number based on the bounding box size, and set the current oriented bounding box as a current root node, so as to divide the current oriented bounding box into the preset number of child bounding boxes in a current level by using a top-down recursive division manner starting from the current root node, and then bind each of the child bounding boxes in sequence to each of the child nodes corresponding to the current root node in sequence according to a generation order, so as to obtain a current spatial partition structure.
[0018] Optionally, it is judged whether the current level is less than a preset level threshold, if yes, the current level is updated, each of the child bounding boxes is set as a new current oriented bounding box, and then the step of setting the current oriented bounding box as the current root node is re-jumped until the current level is not less than the preset level threshold, and the current spatial partition structure is set as a target spatial partition structure, including:
[0019] It is judged whether the current level is less than a preset level threshold, if yes, a next level of the current level is set as a new current level, each of the child bounding boxes is set as a new current oriented bounding box, and then the step of setting the current oriented bounding box as the current root node is re-jumped;
[0020] If the current level is not less than the preset level threshold, the step of updating the current level is prohibited from being triggered, and the current spatial partition structure is set as the target spatial partition structure.
[0021] Optionally, an interactive object grid set is generated based on a model file of the non-structured grid to be processed, and a minimum bounding box corresponding to each of the interactive objects in the interactive object grid set is determined, and then each of the minimum bounding boxes is subjected to intersection detection with each of the nodes in the target spatial partition structure in sequence according to a level from small to large, so as to determine a bottom leaf node intersecting with the minimum bounding box, and data of the interactive object is stored into the corresponding bottom leaf node, including:
[0022] Determine the model file corresponding to the non-structured grid to be processed, and generate an interactive object grid set based on the model file, and then determine whether the model file has a target space segmentation structure, if the model file does not have a target space segmentation structure, then jump back to the step of constructing the current oriented bounding box based on the non-structured grid to be processed of the aircraft; wherein the interactive object grid set includes triangular facets, triangular short edges and points;
[0023] If the model file has a target space segmentation structure, then generate a minimum bounding box corresponding to each interactive object in the interactive object grid set using a preset minimum bounding box generation algorithm, and then perform intersection detection between the minimum bounding box and each node in the current level in turn to obtain a current intersection detection result;
[0024] Set the node corresponding to the current intersection detection result as a current to-be-detected node, and perform intersection detection between the minimum bounding box and all child nodes in the current to-be-detected node in turn to obtain a new current intersection detection result, and jump back to the step of performing intersection detection between the minimum bounding box and each node in the current level in turn until the current level is the bottom level in the target space segmentation structure;
[0025] Determine the node corresponding to the current intersection detection result as a bottom-level leaf node intersecting with the minimum bounding box, and store the data of the interactive object corresponding to the minimum bounding box into the corresponding bottom-level leaf node.
[0026] Optionally, the step of storing the data of the interactive object into the corresponding bottom-level leaf node comprises:
[0027] Determine whether the minimum bounding box of the interactive object only has an intersection relationship with the bounding box corresponding to one bottom-level leaf node, if the minimum bounding box of the interactive object only has an intersection relationship with the bounding box corresponding to one bottom-level leaf node, then uniquely store all data information of the interactive object into the bottom-level leaf node;
[0028] If the minimum bounding box of the interactive object has an intersection relationship with the bounding box corresponding to more than one bottom-level leaf node, then store all data information of the interactive object into each bottom-level leaf node intersecting with the minimum bounding box.
[0029] Optionally, the step of determining whether each bottom-level leaf node stores interactive object data and setting a capture state identifier based on the determination result comprises:
[0030] Iterate through each bottom-level leaf node in the target space segmentation structure, and determine whether the node of each bottom-level leaf node stores data of at least one interactive object;
[0031] If each of the bottom leaf nodes stores data of at least one interactive object internally, then the capture state flag corresponding to the bottom leaf node is set to a valid state; the valid state is used to indicate that there is an interactive object within the bounding box of the bottom leaf node.
[0032] If each of the underlying leaf nodes does not contain data of at least one interactive object, then the capture status flag corresponding to the underlying leaf node is set to invalid.
[0033] Optionally, the step of performing collision detection between the bounding boxes corresponding to the bottom-level leaf nodes with capture status flags within the interaction range corresponding to the interaction command, to obtain the target interaction object, includes:
[0034] After receiving an interaction instruction generated by the user's interaction operation on the interactive device, the corresponding interaction area is determined in three-dimensional space based on the interaction instruction; the interaction instruction includes screen coordinate points or coordinate ranges corresponding to the interaction operation.
[0035] The first bottom leaf node to be processed is obtained when the capture status is marked as valid, and the spatial range information corresponding to each first bottom leaf node to be processed is read. Then, the spatial geometric intersection calculation is performed between the interaction area and the spatial range information corresponding to each first bottom leaf node to be processed to obtain the calculation result.
[0036] Based on the calculation results, second bottom leaf nodes that have an intersection relationship with the interaction area are selected from each of the first bottom leaf nodes to be processed, and corresponding interaction object data is extracted from each of the second bottom leaf nodes to be processed. Then, the interaction object data is merged and stored in a preset data container to generate a preliminary selection set.
[0037] The object selection function in the preset graphics rendering library is used to generate a detection signal based on the spatial range information, and then all interactive object data in the preliminary screening set is loaded into the rendering environment;
[0038] In the rendering environment, the geometric intersection point between the detection signal and each of the interactive objects in the preliminary screening set is determined, and the interactive object to be matched is determined from each of the interactive objects in the preliminary screening set based on the geometric intersection point;
[0039] The interaction object to be matched and the geometric intersection point are judged and matched by a predetermined judgment rule and a preset matching rule to obtain a number of target interaction objects, and human-computer interaction is performed using each of the target interaction objects.
[0040] Secondly, this application provides a human-computer interaction device based on an aircraft unstructured grid, comprising:
[0041] The directed bounding box construction module is used to construct the current directed bounding box based on the unstructured mesh to be processed of the aircraft, and set the current directed bounding box as the current root node. Then, using a top-down recursive partitioning method, the current directed bounding box is divided into a preset number of sub-bounding boxes at the current level starting from the current root node, and each of the sub-bounding boxes is bound to the child node of the current root node to obtain the current spatial partitioning structure.
[0042] The spatial segmentation structure generation module is used to determine whether the current level is less than a preset level threshold. If it is less, the current level is updated and each of the sub-bounding boxes is set as the new current directed bounding box. Then, the module jumps back to the step of setting the current directed bounding box as the current root node until the current level is not less than the preset level threshold and the current spatial segmentation structure is set as the target spatial segmentation structure.
[0043] The intersection detection module is used to generate an interactive object mesh set based on the model file of the unstructured mesh to be processed, and determine the minimum bounding box corresponding to each interactive object in the interactive object mesh set. Then, based on the minimum bounding box, it performs intersection detection with each node in the target space segmentation structure in ascending order of hierarchy to determine the bottom leaf node that intersects with the minimum bounding box, and stores the interactive object data in the corresponding bottom leaf node.
[0044] The collision detection module is used to determine whether interactive object data is stored in each of the bottom leaf nodes, and to set a capture state flag based on the determination result. Then, it performs collision detection with the bounding box corresponding to each bottom leaf node with a capture state flag in the interaction range corresponding to the interactive instruction to obtain the target interactive object.
[0045] Thirdly, this application provides an electronic device, comprising:
[0046] Memory, used to store computer programs;
[0047] A processor is used to execute the computer program to implement the aforementioned human-computer interaction method based on unstructured aircraft grids.
[0048] Fourthly, this application provides a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the aforementioned human-computer interaction method based on an unstructured aircraft grid.
[0049] As can be seen from the above, before performing human-computer interaction based on the unstructured mesh of the aircraft, this application needs to construct a current directed bounding box based on the unstructured mesh to be processed of the aircraft, and set the current directed bounding box as the current root node. Using a top-down recursive partitioning method, starting from the current root node, the current directed bounding box is divided into a preset number of sub-bounding boxes at the current level, and each sub-bounding box is bound to a child node of the current root node to obtain the current spatial partitioning structure. It is then determined whether the current level is less than a preset level threshold. If it is less, the current level is updated, and each sub-bounding box is set as the new current directed bounding box. The process then jumps back to the step of setting the current directed bounding box as the current root node, until the current level is not less than the preset level threshold, and the current spatial partitioning is completed. The cut structure is set as the target space segmentation structure; an interactive object mesh set is generated based on the model file of the unstructured mesh to be processed, and the minimum bounding box corresponding to each interactive object in the interactive object mesh set is determined. Then, based on the minimum bounding box, intersection detection is performed with each node in the target space segmentation structure in ascending order of hierarchy to determine the bottom leaf node that intersects with the minimum bounding box, and the interactive object data is stored in the corresponding bottom leaf node; it is determined whether each bottom leaf node stores interactive object data, and a capture state flag is set based on the judgment result. Then, collision detection is performed with the bounding box corresponding to each bottom leaf node with the capture state flag in the interaction range corresponding to the interactive command to obtain the target interactive object.
[0050] Therefore, this application first needs to construct a current directed bounding box based on the unstructured mesh to be processed of the aircraft, and set the current directed bounding box as the current root node. Using a top-down recursive partitioning method, starting from the current root node, the current directed bounding box is divided into a preset number of sub-bounding boxes at the current level. Each sub-bounding box is then bound to a child node of the current root node to obtain the current spatial partitioning structure. Secondly, it determines whether the current level is less than a preset level threshold. If it is less, the current level is updated, and each sub-bounding box is set as a new current directed bounding box. The process then jumps back to the step of setting the current directed bounding box as the current root node, until the current level is not less than the preset level threshold, and the current spatial partitioning structure is set as the target spatial partitioning structure. The process involves first cutting the structure; then, generating an interactive object mesh set based on the model file of the unstructured mesh to be processed, and determining the minimum bounding box corresponding to each interactive object in the mesh set. Next, based on the minimum bounding box, intersection detection is performed sequentially with each node in the target space segmentation structure in ascending order of hierarchy to identify the bottom-level leaf nodes that intersect with the minimum bounding box, and the interactive object data is stored in the corresponding bottom-level leaf nodes. Finally, it is determined whether each bottom-level leaf node stores interactive object data, and a capture state flag is set based on the determination result. Then, collision detection is performed within the interaction range corresponding to the interactive command with the bounding boxes corresponding to the bottom-level leaf nodes with the capture state flag to obtain the target interactive object. This improves the efficiency of human-computer interaction based on unstructured aircraft meshes, thereby enhancing the user experience. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0052] Figure 1 This is a flowchart of a human-computer interaction method based on unstructured aircraft mesh disclosed in this application;
[0053] Figure 2 This is a schematic diagram of a specific process for dividing the bounding box into dimensions;
[0054] Figure 3 This is a schematic diagram of a specific three-dimensional R-tree projected onto a two-dimensional horizontal plane; where... Figure 3 (a) is a schematic diagram of the projection of a two-dimensional plane. Figure 3 (b) is a schematic diagram of the tree structure projection;
[0055] Figure 4 This is a schematic diagram of a specific bounding box division corresponding to the first layer disclosed in this application;
[0056] Figure 5 This is a schematic diagram of a specific bounding box division corresponding to the second layer disclosed in this application;
[0057] Figure 6 This is a schematic diagram of a specific bounding box division corresponding to the third layer disclosed in this application;
[0058] Figure 7 This is a schematic diagram of a specific bounding box division corresponding to the fourth layer disclosed in this application;
[0059] Figure 8 This is a schematic diagram illustrating a specific method of binding a bounding box to a tree node as disclosed in this application;
[0060] Figure 9 This is a schematic diagram of a specific model file disclosed in this application;
[0061] Figure 10 This is a schematic diagram of a specific unstructured interactive object mesh data generated from a model file as disclosed in this application;
[0062] Figure 11 This is a schematic diagram illustrating a specific method for constructing the minimum bounding box of an interactive object as disclosed in this application;
[0063] Figure 12 This is a schematic diagram illustrating the specific replenishment status settings disclosed in this application; wherein, Figure 12 (a) is a plan view. Figure 12 (b) is a three-dimensional schematic diagram;
[0064] Figure 13 A schematic diagram comparing the interaction times of bounding boxes created with different breadths as disclosed in this application;
[0065] Figure 14 This is a schematic diagram showing a comparison of the time consumption of a specific capture operation disclosed in this application;
[0066] Figure 15 This is a schematic diagram of a human-computer interaction device based on an unstructured mesh for an aircraft disclosed in this application.
[0067] Figure 16 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0068] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0069] Currently, research on 3D spatial indexing technology mainly focuses on octrees and 3D R-trees. However, these algorithms have certain requirements for application scenarios; they are only suitable for uniformly distributed point cloud data and not for mesh model data with varying model shapes. Furthermore, the octree algorithm has limitations; for non-uniform data, the intermediate nodes of the octree need to be further divided according to convergence conditions until convergence is achieved. Therefore, this application provides a human-computer interaction method based on unstructured aircraft meshes, which can improve the efficiency of human-computer interaction based on unstructured aircraft meshes.
[0070] See Figure 1 As shown, this embodiment of the invention discloses a human-computer interaction method based on an unstructured aircraft mesh, including:
[0071] Step S11: Construct the current directed bounding box based on the unstructured mesh to be processed of the aircraft, and set the current directed bounding box as the current root node. Then, using a top-down recursive partitioning method, divide the current directed bounding box into a preset number of sub-bounding boxes at the current level starting from the current root node, and bind each of the sub-bounding boxes to the child nodes of the current root node to obtain the current spatial partitioning structure.
[0072] In this embodiment, an octree is a commonly used spatial data structure. Each node can be represented by a cube, and each node can be divided into 8 parts (i.e., child nodes), where the sum of the volumes of these 8 child nodes equals the volume of the parent node. The specific partitioning steps are: first, establish a minimum bounding cube based on the model dimensions; then, partition this cube along 8 dimensions, decomposing it into multiple smaller cubes, such as... Figure 2 As shown, it has the advantage of fast access to the corresponding data. Furthermore, the 3D R-tree (rectangular tree) primarily partitions spatial objects. The advantages of this algorithm are high spatial indexing efficiency and fast query speed. A schematic diagram of the ray projection of a 3D R-tree onto a 2D spatial horizontal plane is shown below. Figure 3 As shown. It is understandable that the areas of rectangles in different spatial index directories can overlap.
[0073] In this embodiment, during the human-computer interaction based on the unstructured mesh of the aircraft, the first step is to create an N-ary tree of depth L according to the bounding box size. In one specific implementation, L is 10 and N is 27. That is, the N-ary tree partitioning method in this embodiment divides the three-dimensional space into 27 regular hexahedral data structures. The resulting hexahedral data structures are nodes of the 27-ary tree, and are recursively subdivided to the next level of nodes. Subsequently, the unstructured surface interaction object mesh data is constructed, and the interaction object is bound to the leaf nodes of the ary tree.
[0074] Specifically, a directed bounding box is constructed based on the unstructured mesh to be processed of the aircraft, and the current directed bounding box is set as the current root node. Then, using a top-down recursive partitioning method, the current directed bounding box is divided into a preset number of sub-bounding boxes at the current level, starting from the current root node. Each sub-bounding box is then bound to the child nodes of the current root node to obtain the current spatial partitioning structure. This can include: determining the unstructured mesh to be processed corresponding to the aircraft, and determining the overall size and spatial position corresponding to the unstructured mesh to be processed. Based on the overall size and spatial position, a current directed bounding box containing the unstructured mesh to be processed is constructed, and the bounding box size of the current directed bounding box is determined; the bounding box size of the current directed bounding box is larger than the overall size; based on the bounding box size, a preset number is determined, and the current directed bounding box is set as the current root node. Using a top-down recursive partitioning method, the current directed bounding box is divided into a preset number of sub-bounding boxes at the current level, starting from the current root node. Then, each sub-bounding box is bound to the child nodes corresponding to the current root node in sequence according to the generation order to obtain the current spatial partitioning structure.
[0075] Step S12: Determine whether the current level is less than the preset level threshold. If it is less, update the current level and set each of the sub-bounding boxes as the new current directed bounding box. Then jump back to the step of setting the current directed bounding box as the current root node until the current level is not less than the preset level threshold and set the current spatial partitioning structure as the target spatial partitioning structure.
[0076] In this embodiment, the process of constructing the current bounding box is as follows: First, construct a directed bounding box according to the size and position of the unstructured mesh model. Then, recursively divide the above directed bounding box in a top-down manner. Next, traverse all nodes in the current layer R and divide it into 27 child nodes in layer R+1. Repeat the above steps until the predefined layer number L is reached.
[0077] In one specific implementation, taking the f6 model as an example, the schematic diagrams for partitioning the directed bounding box are as follows: Figure 4 , 5 As shown in Figures 6 and 7, among which,Figure 4 This is a schematic diagram of the bounding box partitioning corresponding to the first layer. Figure 5 This is a schematic diagram of the bounding box partitioning corresponding to the second layer. Figure 6 This is a schematic diagram showing the bounding box partitioning for the third layer. Figure 7 This is a schematic diagram illustrating the bounding box partitioning for layer 4. The bounding boxes created based on the model size and larger than the model are shown below. Figure 4 As shown, the first-layer bounding box is bound to the root node of the tree. It's worth noting that during mesh optimization, the user will project the interactive object, which changes the position of the facets. To increase the versatility of the bounding box, its size is larger than the model size. Subsequently, based on the size of the first-layer bounding box, a second-layer bounding box is created. In this embodiment, there are 27 second-layer bounding boxes, and these are bound to the child nodes of the tree. This process is repeated to bind all four layers of bounding boxes to the tree nodes, as illustrated in the diagram below. Figure 8 As shown.
[0078] Specifically, the process involves determining whether the current level is less than a preset level threshold. If it is, the current level is updated, and each child bounding box is set as the new current directed bounding box. Then, the process jumps back to the step of setting the current directed bounding box as the current root node, until the current level is not less than the preset level threshold, and the current spatial partitioning structure is set as the target spatial partitioning structure. This process can include: determining whether the current level is less than the preset level threshold; if the current level is less than the preset level threshold, the next level after the current level is set as the new current level, and each child bounding box is set as the new current directed bounding box. Then, the process jumps back to the step of setting the current directed bounding box as the current root node. If the current level is not less than the preset level threshold, the step of updating the current level is prohibited, and the current spatial partitioning structure is set as the target spatial partitioning structure.
[0079] Step S13: Generate an interactive object mesh set based on the model file of the unstructured mesh to be processed, and determine the minimum bounding box corresponding to each interactive object in the interactive object mesh set. Then, based on the minimum bounding box, perform intersection detection with each node in the target space segmentation structure in ascending order of hierarchy to determine the bottom leaf node that intersects with the minimum bounding box, and store the interactive object data in the corresponding bottom leaf node.
[0080] In this embodiment, the process of constructing the interactive object mesh data of the unstructured surface and binding the interactive objects to the branch leaf nodes is as follows: First, import, for example, Figure 9 The model file shown is then used to generate the following: Figure 10The unstructured interactive object grid data is shown. Then, it is determined whether a branch tree exists. If it does not exist, the branch tree and bounding box construction steps are performed. If it exists, the minimum bounding box of the interactive object is constructed based on the interactive object's size. A schematic diagram of constructing the minimum bounding box of the interactive object is shown below. Figure 11 As shown, "Interaction Object 1" is the interaction object. Furthermore, in this embodiment, it is necessary to traverse all bounding boxes in the current layer R, and then perform intersection detection between the bounding box of the interaction object and the bounding box of the current layer of the branch tree according to the size of the bounding box of the interaction object. Find the intersecting bounding box, and obtain the R+1 layer sub-bounding box data contained in the bounding box. Then perform intersection detection again. Finally, repeat the above steps until the leaf node of the branch tree is found. Then add the current interaction object to each intersecting leaf node to increase the capture accuracy.
[0081] Specifically, an interactive object mesh set is generated based on the model file of the unstructured mesh to be processed, and the minimum bounding box corresponding to each interactive object in the interactive object mesh set is determined. Then, based on the minimum bounding box, intersection detection is performed with each node in the target space segmentation structure in ascending order of hierarchy to determine the bottom leaf node that intersects with the minimum bounding box, and the interactive object data is stored in the corresponding bottom leaf node. This can include: determining the model file corresponding to the unstructured mesh to be processed, generating an interactive object mesh set based on the model file, and then determining whether the model file has a target space segmentation structure. If the model file does not have a target space segmentation structure, the process jumps back to the step of constructing the current directed bounding box based on the unstructured mesh to be processed of the aircraft. The interactive object mesh set includes triangular facets, short sides of triangles, and points. If the model file has a target space segmentation structure, a preset minimum bounding box generation algorithm is used to generate minimum bounding boxes corresponding to each interactive object in the interactive object mesh set. Then, the minimum bounding boxes are sequentially intersected with each node in the current level to obtain the current intersection detection result. The node corresponding to the current intersection detection result is set as the current node to be detected, and the minimum bounding box is sequentially intersected with all child nodes of the current node to be detected to obtain a new current intersection detection result. Then, the process jumps back to the step of sequentially intersecting the minimum bounding box with each node in the current level until the current level is the lowest level in the target space segmentation structure. The node corresponding to the current intersection detection result is determined as the bottom leaf node that intersects with the minimum bounding box, and the data of the interactive object corresponding to the minimum bounding box is stored in the corresponding bottom leaf node.
[0082] Furthermore, storing the data of the interactive object in the corresponding bottom-level leaf nodes can include: determining whether the minimum bounding box of the interactive object intersects with the bounding box corresponding to only one bottom-level leaf node; if the minimum bounding box of the interactive object intersects with the bounding box corresponding to only one bottom-level leaf node, then all the data information of the interactive object is uniquely associated and stored in the bottom-level leaf node; if the minimum bounding box of the interactive object intersects with the bounding box corresponding to more than one bottom-level leaf node, then all the data information of the interactive object is associated and stored in each bottom-level leaf node that intersects with the minimum bounding box.
[0083] Step S14: Determine whether interactive object data is stored in each of the bottom leaf nodes, and set a capture state flag based on the determination result. Then, perform collision detection with the bounding box corresponding to each bottom leaf node with a capture state flag in the interaction range corresponding to the interactive instruction to obtain the target interactive object.
[0084] In this embodiment, the bounding box that does not contain an interactive object is set to a non-capturing state, and the bounding box that contains an interactive object is set to a captured state, depending on whether the leaf node contains an interactive object. The set states are as follows: Figure 12 As shown, where, Figure 12 (a) is a plan view. Figure 12 (b) is a 3D schematic diagram. Specifically, determining whether each bottom leaf node stores interactive object data and setting a capture state flag based on the determination result may include: traversing each bottom leaf node in the target spatial segmentation structure and determining whether each bottom leaf node stores at least one interactive object data internally; if each bottom leaf node stores at least one interactive object data internally, then the capture state flag corresponding to the bottom leaf node is set to a valid state; the valid state is used to indicate that there is an interactive object within the bounding box corresponding to the bottom leaf node; if each bottom leaf node does not store at least one interactive object data internally, then the capture state flag corresponding to the bottom leaf node is set to an invalid state.
[0085] It is worth mentioning that the collision detection in this embodiment is divided into two parts: First, a coarse screening is performed, that is, collision detection is performed between the bounding box at the screen coordinate position and the bounding box with the capture flag, and the interactive objects in the bounding box where the collision occurs are taken out and put into a container. Then, fine capture is performed, that is, image rendering technology is used to detect collisions. It is worth mentioning that OpenGL has a corresponding collision detection mechanism called Picking. The principle is to generate a ray by connecting the camera and the screen coordinates, judge the intersection of the ray with the objects in the scene, and return the intersecting objects. The container of interactive objects selected in the first step is added to OpenGL so that OpenGL can accurately select the intersecting interactive objects. The interaction time corresponding to the bounding boxes created with different widths is shown in the figure. Figure 13 As shown in the figure, the comparison chart of capture operation time is as follows: Figure 14 As shown.
[0086] Specifically, collision detection is performed between the bounding boxes corresponding to the bottom leaf nodes with capture status flags within the interaction range corresponding to the interaction command to obtain the target interaction object. This can include: after receiving the interaction command generated after the user performs an interaction operation on the interaction device, determining the corresponding interaction area in three-dimensional space based on the interaction command; the interaction command includes screen coordinate points or coordinate ranges corresponding to the interaction operation; acquiring the first bottom leaf nodes to be processed with each capture status flag in a valid state, and reading the spatial range information corresponding to each first bottom leaf node to be processed, then performing spatial geometric intersection calculation between the interaction area and the spatial range information corresponding to each first bottom leaf node to be processed to obtain the calculation result; based on the calculation result, selecting the bottom leaf nodes that are compatible with the interaction area from among the first bottom leaf nodes to be processed. In the second bottom-level leaf node of the intersection relationship, the corresponding interactive object data is extracted from each second bottom-level leaf node, and then the interactive object data is merged and stored in a preset data container to generate a preliminary screening set. The object selection function in the preset graphics rendering library is used to generate a detection signal based on the spatial range information, and then all interactive object data in the preliminary screening set is loaded into the rendering environment. In the rendering environment, the geometric intersection point between the detection signal and each interactive object in the preliminary screening set is determined, and the interactive object to be matched is determined from each interactive object in the preliminary screening set based on the geometric intersection point. The interactive object to be matched and the geometric intersection point are judged and matched using the predetermined judgment rule and the preset matching rule to obtain several target interactive objects, and human-computer interaction is performed using each target interactive object.
[0087] As can be seen from the above, the embodiments of this application first need to construct the current directed bounding box based on the unstructured mesh to be processed of the aircraft, and set the current directed bounding box as the current root node. Using a top-down recursive partitioning method, starting from the current root node, the current directed bounding box is divided into a preset number of sub-bounding boxes at the current level, and each sub-bounding box is bound to the child node of the current root node to obtain the current spatial partitioning structure. Second, it is determined whether the current level is less than a preset level threshold. If it is less, the current level is updated, and each sub-bounding box is set as the new current directed bounding box. The process jumps back to the step of setting the current directed bounding box as the current root node until the current level is not less than the preset level threshold, and the current spatial partitioning structure is set as the target space. The process involves several steps: First, a spatial segmentation structure is established. Then, based on the model file of the unstructured mesh to be processed, a set of interactive object meshes is generated. The minimum bounding box corresponding to each interactive object in the set is determined. Next, based on the minimum bounding box, intersection detection is performed sequentially with each node in the target spatial segmentation structure in ascending order of hierarchy to identify the bottom-level leaf nodes that intersect with the minimum bounding box. The interactive object data is then stored in the corresponding bottom-level leaf nodes. Finally, it is determined whether each bottom-level leaf node stores interactive object data. Based on the determination result, a capture state flag is set. Then, collision detection is performed within the interaction range corresponding to the interactive command with the bounding boxes corresponding to the bottom-level leaf nodes with the capture state flag to obtain the target interactive object. This improves the efficiency of human-computer interaction based on unstructured aircraft meshes, thereby enhancing the user experience.
[0088] Accordingly, see Figure 15 As shown, this application also provides a human-computer interaction device based on an aircraft unstructured grid, comprising:
[0089] The directed bounding box construction module 11 is used to construct the current directed bounding box based on the unstructured mesh to be processed of the aircraft, and set the current directed bounding box as the current root node. Then, using a top-down recursive partitioning method, the current directed bounding box is divided into a preset number of sub-bounding boxes at the current level starting from the current root node, and each of the sub-bounding boxes is bound to the child node of the current root node to obtain the current spatial partitioning structure.
[0090] The spatial segmentation structure generation module 12 is used to determine whether the current level is less than the preset level threshold. If it is less, the current level is updated and each of the sub-bounding boxes is set as the new current directed bounding box. Then, the module jumps back to the step of setting the current directed bounding box as the current root node until the current level is not less than the preset level threshold and the current spatial segmentation structure is set as the target spatial segmentation structure.
[0091] The intersection detection module 13 is used to generate an interactive object mesh set based on the model file of the unstructured mesh to be processed, and determine the minimum bounding box corresponding to each interactive object in the interactive object mesh set. Then, based on the minimum bounding box, it performs intersection detection with each node in the target space segmentation structure in ascending order of hierarchy to determine the bottom leaf node that intersects with the minimum bounding box, and stores the interactive object data in the corresponding bottom leaf node.
[0092] The collision detection module 14 is used to determine whether interactive object data is stored in each of the bottom leaf nodes, and to set a capture state flag based on the determination result. Then, it performs collision detection with the bounding box corresponding to each bottom leaf node with a capture state flag in the interaction range corresponding to the interactive instruction to obtain the target interactive object.
[0093] In some specific embodiments, the directed bounding box construction module 11 may specifically include:
[0094] A bounding box size determination unit is used to determine the unstructured mesh to be processed corresponding to the aircraft, and to determine the overall size and spatial position corresponding to the unstructured mesh to be processed, so as to construct a current directed bounding box containing the unstructured mesh to be processed based on the overall size and the spatial position, and to determine the bounding box size of the current directed bounding box; the bounding box size of the current directed bounding box is larger than the overall size;
[0095] The bounding box equalization unit is used to determine a preset number based on the bounding box size, and set the current directed bounding box as the current root node. It uses a top-down recursive partitioning method to divide the current directed bounding box into a preset number of sub-bounding boxes at the current level starting from the current root node. Then, each of the sub-bounding boxes is bound to the corresponding child nodes of the current root node in sequence according to the generation order to obtain the current spatial partitioning structure.
[0096] In some specific embodiments, the spatial segmentation structure generation module 12 may specifically include:
[0097] The current level determination unit is used to determine whether the current level is less than a preset level threshold. If the current level is less than the preset level threshold, the next level of the current level is set as the new current level, and each of the sub-bounding boxes is set as the new current directed bounding box. Then, the process jumps back to the step of setting the current directed bounding box as the current root node.
[0098] The target spatial segmentation structure determination unit is used to prevent the step of updating the current level from being triggered if the current level is not less than the preset level threshold, and to set the current spatial segmentation structure as the target spatial segmentation structure.
[0099] In some specific embodiments, the intersection detection module 13 may specifically include:
[0100] The model file determination unit is used to determine the model file corresponding to the unstructured mesh to be processed, generate an interactive object mesh set based on the model file, and then determine whether the model file has a target space segmentation structure. If the model file does not have a target space segmentation structure, the unit jumps back to the step of constructing the current directed bounding box based on the unstructured mesh to be processed of the aircraft. The interactive object mesh set includes triangular facets, short sides of triangles, and points.
[0101] The intersection detection result determination unit is used to generate minimum bounding boxes corresponding to each interactive object in the interactive object mesh set using a preset minimum bounding box generation algorithm if the model file has a target space segmentation structure, and then perform intersection detection between the minimum bounding boxes and each node in the current level in sequence to obtain the current intersection detection result.
[0102] The step jump unit is used to set the node corresponding to the current intersection detection result as the current node to be detected, and to perform intersection detection between the minimum bounding box and all child nodes of the current node to be detected in turn to obtain a new current intersection detection result, and then jump back to the step of performing intersection detection between the minimum bounding box and each node in the current level in turn, until the current level is the lowest level in the target space segmentation structure;
[0103] The first data storage unit is used to determine the node corresponding to the current intersection detection result as the bottom leaf node that intersects with the minimum bounding box, and to store the data of the interaction object corresponding to the minimum bounding box into the corresponding bottom leaf node.
[0104] In some specific embodiments, the intersection detection module 13 may specifically include:
[0105] The intersection relationship determination unit is used to determine whether the minimum bounding box of the interactive object intersects with the bounding box corresponding to only one bottom leaf node. If the minimum bounding box of the interactive object intersects with the bounding box corresponding to only one bottom leaf node, then all data information of the interactive object is uniquely associated and stored in the bottom leaf node.
[0106] The second data storage unit is used to associate and store all data information of the interactive object with each of the bottom leaf nodes that intersect with the minimum bounding box if the minimum bounding box of the interactive object has an intersection relationship with the bounding box corresponding to a bottom leaf node.
[0107] In some specific embodiments, the collision detection module 14 may specifically include:
[0108] The leaf node traversal unit is used to traverse each bottom leaf node in the target space partitioning structure and determine whether each bottom leaf node has data of at least one interactive object stored internally.
[0109] The first capture state flag setting unit is used to set the capture state flag corresponding to the bottom leaf node to a valid state if the node of each bottom leaf node has data of at least one interactive object stored in association with the node; the valid state is used to indicate that there is an interactive object within the bounding box of the bottom leaf node.
[0110] The second capture state flag setting unit is used to set the capture state flag corresponding to the bottom leaf node to an invalid state if the node of each bottom leaf node does not have data of at least one interactive object associated with it.
[0111] In some specific embodiments, the collision detection module 14 may specifically include:
[0112] An interactive area determination unit is used to determine a corresponding interactive area in three-dimensional space based on an interactive instruction generated after a user performs an interactive operation on an interactive device; the interactive instruction includes screen coordinate points or coordinate ranges corresponding to the interactive operation.
[0113] The calculation result determination unit is used to obtain the first bottom leaf node to be processed that is identified as a valid state in each capture state, and read the spatial range information corresponding to each first bottom leaf node to be processed. Then, it performs spatial geometric intersection calculation between the interaction area and the spatial range information corresponding to each first bottom leaf node to be processed to obtain the calculation result.
[0114] The filtering set determination unit is used to filter out the second bottom leaf nodes that have an intersection relationship with the interaction area from each of the first bottom leaf nodes to be processed based on the calculation results, extract the corresponding interaction object data from each of the second bottom leaf nodes to be processed, and then merge and store each of the interaction object data into a preset data container to generate a preliminary filtering set.
[0115] The detection signal generation unit is used to generate a detection signal based on the spatial range information by utilizing the object selection function in the preset graphics rendering library, and then load all interactive object data in the preliminary screening set into the rendering environment.
[0116] A geometric intersection point determination unit is used to determine the geometric intersection point between the detection signal and each of the interactive objects in the preliminary screening set in the rendering environment, and to determine the interactive object to be matched from each of the interactive objects in the preliminary screening set based on the geometric intersection point;
[0117] The target interaction object determination unit is used to determine and match the interaction object to be matched with the geometric intersection point using predetermined judgment rules and preset matching rules to obtain a number of target interaction objects, so as to use each of the target interaction objects for human-computer interaction.
[0118] Furthermore, embodiments of this application also disclose an electronic device, Figure 16 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the human-computer interaction method based on unstructured aircraft grids disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0119] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0120] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0121] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including computer programs capable of performing the human-computer interaction method based on an aircraft unstructured grid executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0122] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned human-computer interaction method based on an unstructured aircraft mesh. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0123] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0124] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0125] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0126] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0127] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for human-machine interaction based on unstructured mesh of an aircraft, characterized in that, The method comprises the following steps: constructing a current oriented bounding box based on a non-structured grid to be processed of an aircraft, setting the current oriented bounding box as a current root node, then equally dividing the current oriented bounding box into a preset number of child bounding boxes at a current level by using a top-down recursive division manner starting from the current root node, and binding each of the child bounding boxes to a child node of the current root node to obtain a current spatial partition structure; judging whether the current level is smaller than a preset level threshold, if yes, updating the current level, setting each of the child bounding boxes as a new current oriented bounding box, then re-jumping to the step of setting the current oriented bounding box as the current root node until the current level is not smaller than the preset level threshold, and setting the current spatial partition structure as a target spatial partition structure; generating an interactive object grid set based on a model file of the non-structured grid to be processed, determining a minimum bounding box corresponding to each interactive object in the interactive object grid set, then performing intersection detection between the minimum bounding boxes and each node in the target spatial partition structure in order of level from small to large to determine a bottom-level leaf node intersecting with the minimum bounding box, and storing data of the interactive object into the corresponding bottom-level leaf node; judging whether interactive object data is stored in each of the bottom-level leaf nodes, setting a capture state identifier based on the judgment result, then performing collision detection between a bounding box corresponding to each bottom-level leaf node provided with the capture state identifier and an interactive range corresponding to an interactive instruction to obtain a target interactive object.
2. The aircraft non-structural mesh-based human-machine interaction method of claim 1, wherein, The method of constructing a current oriented bounding box based on a non-structured grid to be processed of an aircraft, setting the current oriented bounding box as a current root node, then equally dividing the current oriented bounding box into a preset number of child bounding boxes at a current level by using a top-down recursive division manner starting from the current root node, and binding each of the child bounding boxes to a child node of the current root node to obtain a current spatial partition structure, comprises the following steps: determining a non-structured grid to be processed corresponding to an aircraft, determining an overall size and a spatial position corresponding to the non-structured grid to be processed, constructing a current oriented bounding box containing the non-structured grid to be processed based on the overall size and the spatial position, and determining a bounding box size of the current oriented bounding box; the bounding box size of the current oriented bounding box is larger than the overall size; determining a preset number based on the bounding box size, setting the current oriented bounding box as a current root node, then equally dividing the current oriented bounding box into the preset number of child bounding boxes at a current level by using a top-down recursive division manner starting from the current root node, and binding each of the child bounding boxes to each child node corresponding to the current root node in order of generation to obtain a current spatial partition structure.
3. The aircraft non-structural mesh-based human-machine interaction method of claim 1, wherein, The step of judging whether the current level is less than the preset level threshold, if yes, setting a next level of the current level as a new current level, setting each of the sub bounding boxes as a new current directional bounding box, and then rejumping to the step of setting the current directional bounding box as the current root node, until the current level is not less than the preset level threshold, and setting the current spatial partition structure as the target spatial partition structure, comprises: The step of judging whether the current level is less than the preset level threshold, if yes, setting a next level of the current level as a new current level, setting each of the sub bounding boxes as a new current directional bounding box, and then rejumping to the step of setting the current directional bounding box as the current root node, until the current level is not less than the preset level threshold, and setting the current spatial partition structure as the target spatial partition structure, comprises: If the current level is not less than the preset level threshold, the step of updating the current level is prohibited, and the current spatial partition structure is set as the target spatial partition structure.
4. The aircraft non-structural mesh-based human-machine interaction method of claim 1, wherein, The step of generating the interactive object mesh set based on the model file of the to-be-processed unstructured mesh, and determining the minimum bounding box corresponding to each interactive object in the interactive object mesh set, and then performing intersection detection between the minimum bounding box and each node in the target spatial partition structure in order based on the level from small to large, to determine the bottom-level leaf node intersecting with the minimum bounding box, and storing the data of the interactive object into the corresponding bottom-level leaf node, comprises: The step of determining the model file corresponding to the to-be-processed unstructured mesh, and generating an interactive object mesh set based on the model file, and then judging whether the model file exists the target spatial partition structure, if not, rejumping to the step of constructing the current directional bounding box based on the to-be-processed unstructured mesh of the aircraft, wherein the interactive object mesh set comprises a triangular facet, a triangular short side and a point; If the model file exists the target spatial partition structure, a minimum bounding box corresponding to each interactive object in the interactive object mesh set is generated by using a preset minimum bounding box generation algorithm, and then the minimum bounding box and each node in the current level are subjected to intersection detection to obtain a current intersection detection result; The node corresponding to the current intersection detection result is set as a current to-be-detected node, and the minimum bounding box and all child nodes in the current to-be-detected node are subjected to intersection detection in order to obtain a new current intersection detection result, and the step of performing intersection detection between the minimum bounding box and each node in the current level is rejumped to until the current level is the bottommost level in the target spatial partition structure; The node corresponding to the current intersection detection result is determined as the bottom-level leaf node intersecting with the minimum bounding box, and the data of the interactive object corresponding to the minimum bounding box is stored into the corresponding bottom-level leaf node.
5. The aircraft non-structural mesh-based human-machine interaction method of claim 1, wherein, The step of storing the data of the interactive object into the corresponding bottom-level leaf node, comprises: determine whether the minimum bounding box of the interactive object only has an intersection relationship with the bounding box corresponding to one bottom-level leaf node, and if the minimum bounding box of the interactive object only has an intersection relationship with the bounding box corresponding to one bottom-level leaf node, store all data information of the interactive object in the bottom-level leaf node in a unique manner; if the minimum bounding box of the interactive object has an intersection relationship with the bounding boxes corresponding to more than one bottom-level leaf node, store all data information of the interactive object in each bottom-level leaf node that has an intersection relationship with the minimum bounding box.
6. The aircraft non-structural mesh-based human-machine interaction method of claim 1, wherein, The judgment of whether the interactive object data is stored in each bottom-level leaf node and the setting of the capture state identifier based on the judgment result include: traverse each bottom-level leaf node in the target space segmentation structure, and determine whether at least one interactive object data is associated and stored in the node interior of each bottom-level leaf node; if at least one interactive object data is associated and stored in the node interior of each bottom-level leaf node, set the capture state identifier corresponding to the bottom-level leaf node to an effective state; the effective state is used to represent that there is an interactive object in the bounding box range corresponding to the bottom-level leaf node; if at least one interactive object data is not associated and stored in the node interior of each bottom-level leaf node, set the capture state identifier corresponding to the bottom-level leaf node to an invalid state.
7. The aircraft non-structural mesh-based human-machine interaction method according to any one of claims 1 to 6, characterized in that, The collision detection of the bounding boxes corresponding to each bottom-level leaf node with the set capture state identifier in the interactive range corresponding to the interactive instruction to obtain the target interactive object includes: after receiving the interactive instruction generated after the user performs an interactive operation on the interactive device, determine the corresponding interactive region in the three-dimensional space based on the interactive instruction; the interactive instruction includes a screen coordinate point or a coordinate range corresponding to the interactive operation; obtain each first bottom-level leaf node to be processed with an effective capture state identifier, read the spatial range information corresponding to each first bottom-level leaf node to be processed, and then perform spatial geometric intersection calculation on the interactive region and the spatial range information corresponding to each first bottom-level leaf node to be processed to obtain a calculation result; based on the calculation result, filter out second bottom-level leaf nodes to be processed that have an intersection relationship with the interactive region from each first bottom-level leaf node to be processed, extract corresponding interactive object data from each second bottom-level leaf node to be processed, and then merge and store each interactive object data in a preset data container to generate a preliminary filtering set; use the object selection function in the preset graphics rendering library and generate a detection signal based on the spatial range information, and then load all interactive object data in the preliminary filtering set into a rendering environment; determine the geometric intersection point between the detection signal and each interactive object in the preliminary filtering set in the rendering environment, and determine the interactive object to be matched from each interactive object in the preliminary filtering set based on the geometric intersection point. The predetermined determination rule and the preset matching rule are used to determine and match the to-be-matched interactive object and the geometric intersection point, to obtain a plurality of target interactive objects, and to perform human-computer interaction by using each of the target interactive objects.
8. A human-machine interaction device based on an unstructured mesh of an aircraft, characterized in that, The method comprises the steps of: a directional bounding volume construction module, configured to construct a current directional bounding volume based on a to-be-processed unstructured grid of an aircraft, set the current directional bounding volume as a current root node, and then use a top-down recursive division manner to divide the current directional bounding volume into a preset number of child bounding volumes at a current level from the current root node, and bind each of the child bounding volumes to a child node of the current root node to obtain a current spatial partition structure; a spatial partition structure generation module, configured to determine whether the current level is less than a preset level threshold, if yes, update the current level, and set each of the child bounding volumes as a new current directional bounding volume, then jump back to the step of setting the current directional bounding volume as the current root node until the current level is not less than the preset level threshold, and set the current spatial partition structure as a target spatial partition structure; an intersection detection module, configured to generate an interactive object grid set based on a model file of the to-be-processed unstructured grid, determine a minimum bounding box corresponding to each interactive object in the interactive object grid set, and then perform intersection detection between the minimum bounding boxes and each node in the target spatial partition structure in order of level from small to large based on the minimum bounding boxes to determine a bottom leaf node intersecting with the minimum bounding box, and store data of the interactive object in the corresponding bottom leaf node; a collision detection module, configured to determine whether interactive object data is stored in each of the bottom leaf nodes, set a capture state identifier based on the determination result, and then perform collision detection between the bounding boxes corresponding to each bottom leaf node with the set capture state identifier and an interactive range corresponding to an interactive instruction to obtain a target interactive object.
9. An electronic device, comprising: The method comprises the steps of: a memory, configured to save a computer program; a processor, configured to execute the computer program to implement the human-computer interaction method based on the unstructured grid of the aircraft according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A computer program is saved, and the computer program is executed by a processor to implement the human-computer interaction method based on the unstructured grid of the aircraft according to any one of claims 1 to 7.
Citation Information
Patent Citations
Implementation method of real-time collision detection system
CN102509317A
Human-computer interaction method and device for large-scale grid, equipment and medium
CN116702657A