A method for real-time calculation and display of entity bounding box data in games

By calculating and displaying the physical enclosing box data in real time in the game, the existing image labeling efficiency and poor accuracy are solved, and the efficiency and accuracy of automatic labeling and data set generation are improved.

CN114288657BActive Publication Date: 2025-05-02HUNAN XINGLAN ZHIYUAN NETWORK TECHNOLOGY CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111470114.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-03
Publication Date
2025-05-02
Estimated Expiration
2041-12-03

AI Technical Summary

Technical Problem

The existing image annotation efficiency and poor accuracy lead to insufficient data set generation efficiency and accuracy.

Method used

The method of calculating and displaying the physical enclosure box data in real time in the game. By intercepting the calls of Directx3D graphics API functions and system functions, obtaining game data, and mapping different types of entities into the world coordinate system, calculating the vertex coordinates of the enclosure box, and drawing the enclosure box in real time using DirectX11 graphics API.

Benefits of technology

Automatic labeling is realized, which reduces labor intensity and significantly improves data set generation efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114288657B_ABST
    Figure CN114288657B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for real-time calculation and display of entity bounding box data in a game, the method comprising: writing a core function, intercepting the call of Directx3D graphics API function and system function, obtaining a core object function, calling a game core function function, and compiling to generate a dll database file mydll.dll; modifying the DirectX3D runtime dynamic link library file, using the dll database file to load a self-written mydll.dll file, and injecting it into the game process; in the running process of the game, intercepting and recording the call of Directx3D graphics API function and system function through mydll.dll, and obtaining game data; based on each drawcall of the current frame GPU, separating the currently drawn model object according to its type definition, mapping different types of entities to the world coordinate system, and obtaining the world coordinates of the model vertices and key points; drawing and rendering a bounding box according to the bounding box data of the game, refreshing each frame, and drawing in real time. The present invention solves the problems of low efficiency and poor precision of existing image annotation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a method for real-time calculation and display of entity bounding box data in a game. Background Art

[0002] One of the important reasons for the rapid development of computer vision in recent years is the emergence of various large-scale data sets. Data labeling is the process of processing artificial intelligence learning data by data processing personnel with the help of labeling tools such as BasicFinder. Usually, the types of data labeling include: image labeling, voice labeling, text labeling, video labeling, etc. The basic forms of labeling include 2D labeling frames, 3D labeling frames, text transcription, image dotting, target object contour lines, etc.

[0003] Image annotation and video annotation can actually be collectively referred to as image annotation according to the work content of data annotation, because videos are also composed of continuous playback of images (as we all know, 1 second of video contains 25 frames of images, and each frame is an image). In real-world application scenarios, face recognition and autonomous driving vehicle recognition are often used for image data annotation. Take autonomous driving as an example. How does a vehicle identify vehicles, pedestrians, obstacles, green belts, and even the sky when driving automatically? Image annotation is different from voice annotation, because images include morphology, target points, and structural divisions. Text labeling alone cannot meet data requirements. Therefore, graphic data annotation requires a relatively complex process. Data labelers need to mark the outlines of different target markers with different colors, and then label the corresponding outlines, using labels to outline the content within the outlines. This allows the model to recognize different markers in the image.

[0004] However, traditional data annotation basically relies on the process of "collection (shooting images or recording video and audio) → manual data annotation → data set generation", which is time-consuming and laborious. Therefore, a better solution is needed, which is game-based data collection, annotation and automatic synthesis, which can reduce the workload of annotation personnel to a certain extent and greatly improve the efficiency and accuracy of data set generation. Summary of the invention

[0005] To this end, the present invention provides a method for real-time calculation and display of entity bounding box data in a game to solve the problems of low efficiency and poor accuracy of existing image annotation.

[0006] In order to achieve the above object, the present invention provides the following technical solutions:

[0007] According to a first aspect of the present invention, a method for real-time calculation and display of entity bounding box data in a game is disclosed, the method comprising:

[0008] Write core functions, intercept calls to Directx3D graphics API functions and system functions, obtain core object functions, call game core function functions, and compile to generate a dll database file mydll.dll;

[0009] Modify the DirectX3D runtime dynamic link library file, use the dll database file to load the self-written mydll.dll file, and inject it into the game process;

[0010] During the game, calls to Directx3D graphics API functions and system functions are intercepted and recorded through mydll.dll to obtain game data;

[0011] Based on each drawcall of the current frame GPU, the currently drawn model objects are separated according to their type definitions, different types of entities are mapped to the world coordinate system, and the world coordinates of the model vertices and key points are obtained;

[0012] Draw and render the bounding box according to the game's bounding box data, refresh each frame, and draw in real time.

[0013] Furthermore, during the running of the game, the calls to Directx3D graphics API functions and system functions are intercepted and recorded through mydll.dll, and after obtaining the game data:

[0014] For each frame's drawcall, get each instance of all models in this drawing, as well as the instance's vertices, normals, tangents, faces, UVs, and model types.

[0015] Furthermore, the mapping of different types of entities into the world coordinate system includes the mapping of vehicle entities and human entities; all vertices of the entity are mapped into the world coordinate system, and the length, width and height vertex coordinates of the bounding box are obtained by calculation, and the three-dimensional model is rotated around the vertical axis to calculate the rotation matrix, and the world coordinates corresponding to the vertices of the bounding box are obtained by the vertex coordinates and the rotation matrix calculation.

[0016] Furthermore, the specific mapping process of the vehicle entity is as follows:

[0017] Traverse the vertices of the vehicle model to obtain the maximum value Pos_max and minimum value Pos_min of x, y, and z of all vertices of the vehicle model in the world coordinate system, as well as the coordinate Pos_center of the center point;

[0018] The length, width, height and eight vertex coordinates of the 3D bounding box of the vehicle model in the local coordinate system are calculated by subtracting the components of the maximum value Pos_max and the minimum value Pos_min and taking the absolute value;

[0019] The rotation matrix is ​​calculated by rotating the current entity model around the vertical axis Z axis;

[0020] Multiply the calculated coordinates of the eight vertices by the calculated rotation matrix, and then add the coordinate Pos_center of the model center point to obtain the world coordinates corresponding to the eight vertices of the OBB bounding box.

[0021] Furthermore, the specific mapping process of the character entity is as follows:

[0022] Traverse the coordinates of several key nodes of the character model skeleton, as well as the maximum value Pos_max and minimum value Pos_min of x, y, and z of all nodes in the character model in the world coordinate system, and the coordinate Pos_center of the center point;

[0023] The length, width, height and eight vertex coordinates of the 3D bounding box of the character model in the local coordinate system are calculated by subtracting the components of the maximum value Pos_max and the minimum value Pos_min and taking the absolute value;

[0024] The rotation matrix is ​​calculated by rotating the current entity model around the vertical axis Z axis;

[0025] Multiply the calculated coordinates of the eight vertices by the calculated rotation matrix, and then add the coordinate Pos_center of the model center point to obtain the world coordinates corresponding to the eight vertices of the AABB bounding box.

[0026] Furthermore, the traversed several key nodes of the character model skeleton include: coordinates of the top of the head, fingers, wrists, elbows, hips, calves, ankles, and soles.

[0027] Furthermore, the mapping of different types of entities to the world coordinate system for the planar two-dimensional model traverses the coordinates of several key nodes of the entity model, and after projection transformation, converts the world coordinates of each key point into screen coordinates, and obtains the maximum value Pos_max and minimum value Pos_min of x and y of all key nodes in the screen coordinate system through traversal calculation, as well as the coordinate Pos_center of the center point, and the length, width and four vertex coordinates of the 2D bounding box of the model in the screen coordinate system are calculated by subtracting each component of the maximum value Pos_max and the minimum value Pos_min and taking the absolute value.

[0028] Furthermore, the real-time drawing process is: using DirectX11 graphics API for rendering, according to the game's bounding box data, the camera's internal and external food and the game's Context, calling DirectX11 graphics API to draw the 3D bounding box in the Context with a wireframe, and can refresh each frame to achieve real-time drawing.

[0029] According to a second aspect of the present invention, a device for real-time calculation and display of entity bounding box data in a game is disclosed, the device comprising:

[0030] An interception unit, a database generation unit, a mapping unit, a world coordinate generation unit, and a rendering unit;

[0031] The interception unit intercepts the calls of Directx3D graphics API functions and system functions and records them;

[0032] The database generation unit calls the game core function and compiles to generate a dll database file mydll.dll;

[0033] The mapping unit traverses multiple vertices and key points of the model to calculate the length, width, height and vertex coordinates of the bounding box in the local coordinate system;

[0034] The world coordinate generation unit calculates the world coordinates corresponding to each vertex of the bounding box according to the vertex coordinates and the rotation matrix;

[0035] The rendering unit calls the DirectX11 graphics API to draw a bounding box in the Context using a wireframe according to the calculated world coordinates.

[0036] According to a third aspect of the present invention, a system for real-time calculation and display of entity bounding box data in a game is disclosed, the system for real-time calculation and display of entity bounding box data in a game comprising: at least one processor, at least one memory;

[0037] The memory is used to store one or more program instructions;

[0038] The processor is used to run one or more program instructions to execute any one of the methods for calculating and displaying entity bounding box data in real time in a game.

[0039] According to a fourth aspect of the present invention, a computer-readable storage medium is disclosed, wherein the computer storage medium comprises one or more program instructions, wherein the one or more program instructions are used to be executed by a system for calculating and displaying entity bounding box data in real time in a game to perform any one of the methods for calculating and displaying entity bounding box data in real time in a game.

[0040] The present invention has the following advantages:

[0041] The invention discloses a method for real-time calculation and display of entity bounding box data in a game, which intercepts the call of Directx3D graphics API function and system function, calls the core function function of the game, compiles and generates a dll database file, separates the currently drawn model object according to its type definition based on each drawcall of the current frame GPU, maps different types of entities to the world coordinate system, obtains the world coordinates of the model vertices and key points, and then calls DirectX11 graphics API according to the bounding box data of the game to draw the corresponding bounding box in the context with a wireframe, and can be refreshed every frame to achieve real-time drawing. Automatic labeling reduces labor intensity and greatly improves the efficiency and accuracy of data set generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.

[0043] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.

[0044] Figure 1 A flow chart of a method for real-time calculation and display of entity bounding box data in a game provided by an embodiment of the present invention;

[0045] Figure 2 A schematic diagram of the structure of a device for real-time calculation and display of entity bounding box data in a game provided by an embodiment of the present invention;

[0046] Figure 3 A schematic diagram of the structure of a system for real-time calculation and display of entity bounding box data in a game provided by an embodiment of the present invention;

[0047] In the figure: 1-interception unit, 2-database generation unit, 3-mapping unit, 4-world coordinate generation unit, 5-rendering unit, 6-memory, 7-processor. DETAILED DESCRIPTION

[0048] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] Example

[0050] This embodiment discloses a method for real-time calculation and display of entity bounding box data in a game, the method comprising:

[0051] Write core functions, intercept calls to Directx3D graphics API functions and system functions, obtain core object functions, call game core function functions, and compile to generate a dll database file mydll.dll;

[0052] Modify the DirectX3D runtime dynamic link library file, use the dll database file to load the self-written mydll.dll file, and inject it into the game process;

[0053] During the game, calls to Directx3D graphics API functions and system functions are intercepted and recorded through mydll.dll to obtain game data;

[0054] Based on each drawcall of the current frame GPU, the currently drawn model objects are separated according to their type definitions, different types of entities are mapped to the world coordinate system, and the world coordinates of the model vertices and key points are obtained;

[0055] Draw and render the bounding box according to the game's bounding box data, refresh each frame, and draw in real time.

[0056] The bounding box algorithm is a method to find the optimal bounding space of a discrete point set. The basic idea is to use a slightly larger geometric body with simpler characteristics (called a bounding box) to approximately replace a complex geometric object.

[0057] The most common bounding box algorithms include AABB (Axis-aligned bounding box), Sphere, Oriented bounding box 0BB and Fixed directions hull FDH (Fixed directions hulls or k-DOP). AABB (Axis-aligned bounding box) AABB is the earliest bounding box. It is defined as the smallest hexahedron that contains the object and whose sides are parallel to the coordinate axes. Therefore, only six scalars are needed to describe an AABB. AABB is relatively simple in structure and has a small storage space, but poor in compactness, especially for irregular geometric shapes. The redundant space is large, and when the object is rotated, it cannot be rotated accordingly. The object to be processed is rigid and convex, which is not suitable for complex virtual environments containing soft body deformations.

[0058] The types of bounding boxes include:

[0059] AABB is also a relatively simple bounding box. However, for long and thin objects placed diagonally, its tightness is poor. Due to the simplicity and good tightness of AABB intersection test, it has been widely used and can also be used for collision detection of soft objects.

[0060] AABB box, a 3D AABB is a simple hexahedron, each side is parallel to a coordinate plane, a rectangular bounding box is not necessarily a cube, its length, width, and height can be different from each other. Important properties of AABB:

[0061] Ymin≤Y≤Ymax

[0062] Zmin≤Z≤Zmax

[0063] The two particularly important vertices are: Pmin = [Xmin Ymin Zmin], Pmax = [Xmax Ymax Zmax].

[0064] Sphere

[0065] The bounding sphere is defined as the smallest sphere that contains the object. To determine the bounding sphere, first calculate the mean of the x, y, and z coordinates of the vertices of all elements in the set of basic geometric elements that make up the object to determine the center of the bounding sphere, and then determine the radius r by the distance between the center of the sphere and the point determined by the three maximum coordinates. The collision detection of the bounding sphere mainly compares the radius between the two spheres and the distance from the center of the sphere. The bounding sphere collision detection method is to surround the entire geometric body with a sphere. Both the geometric body and the intersection test are very simple; but its tightness is too poor. Because except for the geometric bodies that are relatively evenly distributed on the three coordinate axes, almost all of them will leave large gaps, and a lot of preprocessing time is required to construct a good hierarchical structure to approximate the object. When the object is deformed, the bounding sphere tree needs to be recalculated. Therefore, it is a less used bounding box. When the object rotates, the bounding sphere does not need to be updated, which is a better feature of the bounding sphere; when the geometric object rotates frequently, the use of the bounding sphere may get better results.

[0066] 0BB Oriented bounding box

[0067] OBB is a commonly used bounding box type. It is the smallest cuboid that contains the object and has an arbitrary direction relative to the coordinate axis. The biggest feature of OBB is its arbitrary direction, which allows it to enclose the object as tightly as possible according to the shape characteristics of the enclosed object, but it also makes its intersection test complicated. 0BB bounding box is closer to the object than AABB bounding box and bounding sphere, which can significantly reduce the number of bounding volumes, thereby avoiding intersection detection between a large number of bounding volumes. However, intersection detection between 0BBs is more time-consuming than intersection detection between AABBs or bounding spheres.

[0068] FDH Fixed directions convex hull (Fixed directions hul1s or k-DOP) FDH (k-DOP) is a special convex hull that inherits the simplicity of AABB, but in order to have good spatial compactness, it must use enough fixed directions. It is defined as a convex hull that contains the object and all its face normal vectors are taken from a fixed direction (k vectors) set. FDH surrounds the original object more tightly than other bounding volumes, and the created hierarchical tree has fewer nodes, which will reduce more redundant calculations when finding intersections, but the intersection operations between them are more complicated.

[0069] During the game, the calls to Directx3D graphics API functions and system functions are intercepted and recorded through mydll.dll. After obtaining the game data:

[0070] For each frame's drawcall, get each instance of all models in this drawing, as well as the instance's vertices, normals, tangents, faces, UVs, and model types.

[0071] The mapping of different types of entities into the world coordinate system includes the mapping of vehicle entities and human entities; all vertices of the entity are mapped into the world coordinate system, and the length, width and height vertex coordinates of the bounding box are obtained by calculation. The three-dimensional model is rotated around the vertical axis to calculate the rotation matrix, and the world coordinates corresponding to the vertices of the bounding box are obtained by calculating the vertex coordinates and the rotation matrix.

[0072] The specific mapping process of vehicle entity is as follows:

[0073] Traverse the vertices of the vehicle model to obtain the maximum value Pos_max and minimum value Pos_min of x, y, and z of all vertices of the vehicle model in the world coordinate system, as well as the coordinate Pos_center of the center point;

[0074] The length, width, height and eight vertex coordinates of the 3D bounding box of the vehicle model in the local coordinate system are calculated by subtracting the components of the maximum value Pos_max and the minimum value Pos_min and taking the absolute value;

[0075] The rotation matrix is ​​calculated by rotating the current entity model around the vertical axis Z axis;

[0076] Multiply the calculated eight vertex coordinates with the calculated rotation matrix, and then add the coordinates of the model center point Pos_center to get the world coordinates of the eight vertices of the OBB bounding box, thus achieving accurate calculation of the vehicle's world coordinates.

[0077] The specific mapping process of the character entity is as follows:

[0078] Traverse the coordinates of several key nodes of the character model skeleton, as well as the maximum value Pos_max and minimum value Pos_min of x, y, and z of all nodes in the character model in the world coordinate system, and the coordinate Pos_center of the center point;

[0079] The length, width, height and eight vertex coordinates of the 3D bounding box of the character model in the local coordinate system are calculated by subtracting the components of the maximum value Pos_max and the minimum value Pos_min and taking the absolute value;

[0080] The rotation matrix is ​​calculated by rotating the current entity model around the vertical axis Z axis;

[0081] Multiply the calculated coordinates of the eight vertices by the calculated rotation matrix, and then add the coordinate Pos_center of the model center point to obtain the world coordinates corresponding to the eight vertices of the AABB bounding box.

[0082] Several key nodes of the character model skeleton are traversed, including the coordinates of the top of the head, fingers, wrists, elbows, hips, calves, ankles, and soles of the feet.

[0083] For the case where there are single or multiple character entities, for a single person, it is sufficient to calculate the world coordinates of the single person. For multiple persons, separate the targets and calculate the world coordinates one by one until all character entities are traversed.

[0084] DirectX11 graphics API is used for rendering. After we get the bounding box data of this game, the camera's internal and external food, and the game's Context, we can call DirectX11 graphics API to draw the 3D bounding box in the Context with a wireframe, and it can be refreshed every frame to achieve real-time rendering.

[0085] The world coordinate calculation process for a planar 2D entity is:

[0086] Map different types of entities to the world coordinate system. For the two-dimensional planar model, traverse the coordinates of several key nodes of the entity model. After projection transformation, convert the world coordinates of each key point into screen coordinates. The maximum value Pos_max and minimum value Pos_min of x, y of all key nodes in the screen coordinate system, as well as the coordinate Pos_center of the center point, are obtained by traversing and calculating. The length, width and four vertex coordinates of the 2D bounding box of the model in the screen coordinate system are calculated by subtracting each component of the maximum value Pos_max and the minimum value Pos_min and taking the absolute value.

[0087] DirectX11 graphics API is used for rendering. After we get the bounding box data of this game, the camera's internal and external food, and the game's context, we can call DirectX11 graphics API to draw the 2D bounding box in the context with a wireframe, and it can be refreshed every frame to achieve real-time rendering.

[0088] In another embodiment, a device for calculating and displaying entity bounding box data in real time in a game is disclosed, the device comprising:

[0089] Interception unit 1, database generation unit 2, mapping unit 3, world coordinate generation unit 4 and rendering unit 5;

[0090] The interception unit 1 intercepts the calls of Directx3D graphics API functions and system functions and records them;

[0091] The database generation unit 2 calls the game core function and compiles to generate a dll database file mydll.dll;

[0092] The mapping unit 3 traverses multiple vertices and key points of the model to calculate the length, width, height and vertex coordinates of the bounding box in the local coordinate system;

[0093] The world coordinate generation unit 4 calculates the world coordinates corresponding to each vertex of the bounding box according to the vertex coordinates and the rotation matrix;

[0094] The rendering unit 5 calls the DirectX11 graphics API to draw a bounding box in the Context using a wireframe according to the calculated world coordinates.

[0095] Complete the world coordinate calculation and rendering display of the solid model.

[0096] In yet another embodiment, a system for real-time calculation and display of entity bounding box data in a game is disclosed, the system for real-time calculation and display of entity bounding box data in a game comprising: at least one processor 7, at least one memory 6;

[0097] The memory 6 is used to store one or more program instructions;

[0098] The processor 7 is used to run one or more program instructions to execute any one of the methods for calculating and displaying entity bounding box data in real time in a game.

[0099] In yet another embodiment, a computer-readable storage medium is disclosed, wherein the computer storage medium includes one or more program instructions, wherein the one or more program instructions are used by a system for calculating and displaying entity bounding box data in real time in a game to execute any one of the methods for calculating and displaying entity bounding box data in real time in a game.

[0100] In the embodiment of the present invention, the processor may be an integrated circuit chip having the ability to process signals. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0101] The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The processor reads the information in the storage medium and completes the steps of the above method in combination with its hardware.

[0102] The storage medium may be a memory, which may be, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.

[0103] Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.

[0104] The volatile memory may be a random access memory (RAM) which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DRRAM).

[0105] The storage media described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.

[0106] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention can be implemented using a combination of hardware and software. When software is used, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. Storage media can be any available media that can be accessed by general or special-purpose computers.

[0107] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for real-time calculation and display of entity bounding box data in a game, characterized in that: The method is: Write core functions, intercept calls to Directx3D graphics API functions and system functions, obtain core object functions, call game core function functions, and compile to generate a dll database file mydll.dll; Modify the DirectX3D runtime dynamic link library file, use the dll database file to load the self-written mydll.dll file, and inject it into the game process; During the game, calls to Directx3D graphics API functions and system functions are intercepted and recorded through mydll.dll to obtain game data; Based on each drawcall of the current frame GPU, the currently drawn model objects are separated according to their type definitions, different types of entities are mapped to the world coordinate system, and the world coordinates of the model vertices and key points are obtained; Draw and render the bounding box according to the bounding box data of the game, refresh each frame, and draw in real time; During the game running process, the calls to Directx3D graphics API functions and system functions are intercepted and recorded through mydll.dll. After obtaining the game data: For each frame's drawcall, get each instance of all models in this drawing, as well as the instance's vertices, normals, tangents, faces, UVs, and model types.

2. A method for real-time calculation and display of entity bounding box data in a game as claimed in claim 1, characterized in that: The mapping of different types of entities into the world coordinate system includes the mapping of vehicle entities and human entities; all vertices of the entity are mapped into the world coordinate system, and the length, width and height vertex coordinates of the bounding box are obtained by calculation. The three-dimensional model is rotated around the vertical axis to calculate the rotation matrix, and the world coordinates corresponding to the vertices of the bounding box are obtained by calculating the vertex coordinates and the rotation matrix.

3. A method for real-time calculation and display of entity bounding box data in a game as claimed in claim 2, characterized in that: The specific mapping process of the vehicle entity is as follows: Traverse the vertices of the vehicle model to obtain the maximum value Pos_max and minimum value Pos_min of x, y, and z of all vertices of the vehicle model in the world coordinate system, as well as the coordinate Pos_center of the center point; The length, width, height and eight vertex coordinates of the 3D bounding box in the local coordinate system of the vehicle model are calculated by subtracting the components of the maximum value Pos_max and the minimum value Pos_min and taking the absolute value; The rotation matrix is ​​calculated by rotating the current entity model around the vertical axis Z axis; Multiply the calculated coordinates of the eight vertices by the calculated rotation matrix, and then add the coordinate of the model center point Pos_center to get the world coordinates corresponding to the eight vertices of the OBB bounding box.

4. A method for real-time calculation and display of entity bounding box data in a game as claimed in claim 2, characterized in that: The specific mapping process of the character entity is as follows: Traverse the coordinates of several key nodes of the character model skeleton, as well as the maximum value Pos_max and minimum value Pos_min of x, y, and z of all nodes in the character model in the world coordinate system, and the coordinate Pos_center of the center point. Traverse several key nodes of the character model skeleton including: the coordinates of the top of the head, fingers, wrists, elbows, hips, calves, ankles, and soles of the feet; The length, width, height and eight vertex coordinates of the 3D bounding box of the character model in the local coordinate system are calculated by subtracting the components of the maximum value Pos_max and the minimum value Pos_min and taking the absolute value; The rotation matrix is ​​calculated by rotating the current entity model around the vertical axis Z axis; Multiply the calculated coordinates of the eight vertices by the calculated rotation matrix, and then add the coordinates of the model center point Pos_center to get the world coordinates corresponding to the eight vertices of the AABB bounding box.

5. A method for real-time calculation and display of entity bounding box data in a game as claimed in claim 2, characterized in that: The method of mapping different types of entities to the world coordinate system for a planar two-dimensional model traverses the coordinates of several key nodes of the entity model, and after projection transformation, converts the world coordinates of each key point into screen coordinates. The maximum value Pos_max and minimum value Pos_min of x and y of all key nodes in the screen coordinate system, as well as the coordinate Pos_center of the center point are obtained by traversal and calculation. The length, width and four vertex coordinates of the 2D bounding box of the model in the screen coordinate system are calculated by subtracting each component of the maximum value Pos_max and the minimum value Pos_min and taking the absolute value.

6. A method for real-time calculation and display of entity bounding box data in a game as claimed in claim 1, characterized in that: The real-time drawing process is: using DirectX11 graphics API for rendering, according to the game's bounding box data, the camera's internal and external food and the game's Context, calling DirectX11 graphics API to draw a 3D bounding box in the Context with a wireframe, and refreshing each frame to achieve real-time drawing.

7. A device for calculating and displaying entity bounding box data in real time in a game, characterized in that: The device comprises: An interception unit, a database generation unit, a mapping unit, a world coordinate generation unit, and a rendering unit; The interception unit intercepts the calls of Directx3D graphics API functions and system functions and records them; The database generation unit calls the game core function and compiles to generate a dll database file mydll.dll; The mapping unit traverses multiple vertices and key points of the model to calculate the length, width, height and vertex coordinates of the bounding box in the local coordinate system; The world coordinate generation unit calculates the world coordinates corresponding to each vertex of the bounding box according to the vertex coordinates and the rotation matrix; The rendering unit calls the DirectX11 graphics API to draw a bounding box in the Context using a wireframe according to the calculated world coordinates; During the game running process, the calls to Directx3D graphics API functions and system functions are intercepted and recorded through mydll.dll. After obtaining the game data: For each frame's drawcall, get each instance of all models in this drawing, as well as the instance's vertices, normals, tangents, faces, UVs, and model types.

8. A system for real-time calculation and display of entity bounding box data in a game, characterized in that: The system for real-time calculation and display of entity bounding box data in a game includes: at least one processor, at least one memory; The memory is used to store one or more program instructions; The processor is used to run one or more program instructions to execute the method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that: The computer storage medium includes one or more program instructions, and the one or more program instructions are used to be executed by a system for calculating and displaying entity bounding box data in real time in a game as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Automatic layout method and system of intelligent 3D (three dimensional) model

    CN103617317A

  • Data acquisition method and system based on dynamic library API interception

    CN103902284A

  • Scene image drawing method and device in game and electronic terminal

    CN110874812A

  • Three-dimensional target detection method and device, three-dimensional target grabbing method and device and electronic equipment

    CN113223091A