Drawing method, drawing device and equipment of three-dimensional object and storage medium

By building a hierarchical enclosure box at the system engine layer and performing interleaving operations, determining the three-dimensional object to be drawn, solving the problems of high computing resource consumption and low drawing efficiency in traditional methods, and achieving more efficient three-dimensional object drawing.

CN119810302APending Publication Date: 2025-04-11ZHUHAI MOJIE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311305072.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-09
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

When dealing with complex scenes, the traditional three-dimensional object drawing method needs to traverse and draw each object, resulting in more computing resources consumption and less drawing efficiency.

Method used

The first level enclosure box is constructed on several initial three-dimensional objects at the system engine layer, and the three-dimensional object to be drawn is determined through interleaving operations, thereby drawing the three-dimensional object based on the three-dimensional object to be drawn.

Benefits of technology

By filtering out the three-dimensional objects to be drawn, the drawing efficiency of the three-dimensional objects is improved and the consumption of computing resources is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810302A_ABST
    Figure CN119810302A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a three-dimensional object drawing method and device, equipment and a storage medium. The three-dimensional object drawing method is characterized by comprising the following steps: constructing a corresponding first-level bounding box for a plurality of initial three-dimensional objects in a system engine layer; performing intersection operation on each first-level bounding box, and determining a to-be-drawn three-dimensional object; and drawing the three-dimensional object based on the three-dimensional object to be drawn. The embodiment of the invention aims to improve the drawing efficiency of the three-dimensional object and reduce the consumption of computing resources in the drawing process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method for drawing a three-dimensional object, a device for drawing a three-dimensional object, a computer device, and a computer-readable storage medium. Background Art

[0002] 3D rendering is a graphics technique used to present objects in three dimensions on a computer screen. It is the process of converting objects and scenes in the three-dimensional world into two-dimensional images so that users can view and interact with them on the screen. 3D rendering is essential for fields such as scientific visualization, engineering design, medical image processing, and geographic information systems because it enables people to visually present and understand complex three-dimensional data and scenes.

[0003] In the related art, when dealing with complex 3D scenes, traditional 3D object drawing methods require traversing and drawing each object, which may result in a large amount of computing work, leading to high resource consumption during the computing process. In addition, traditional methods usually require visibility detection of each object in the scene to determine which objects should be drawn, resulting in slow drawing efficiency of 3D objects in the scene. Summary of the invention

[0004] The present application provides a three-dimensional object drawing method, a three-dimensional object drawing device, a computer device and a computer-readable storage medium, aiming to improve the drawing efficiency of the three-dimensional object and reduce the computing resource consumption during the drawing process.

[0005] To achieve the above object, the present application provides a method for drawing a three-dimensional object, the method comprising:

[0006] Construct corresponding first-level bounding boxes for a number of initial three-dimensional objects at the system engine layer;

[0007] Performing an intersection operation on each of the first-level bounding boxes to determine a three-dimensional object to be drawn;

[0008] Drawing a three-dimensional object is performed based on the three-dimensional object to be drawn.

[0009] To achieve the above objectives, the present application also provides a three-dimensional object drawing device, comprising:

[0010] A construction module, the construction module is used to construct corresponding first-level bounding boxes for a number of initial three-dimensional objects at the system engine layer;

[0011] A determination module, the determination module is used to perform an intersection operation on each of the hierarchical bounding boxes to determine a three-dimensional object to be drawn;

[0012] A drawing module is used to draw a three-dimensional object based on the three-dimensional object to be drawn.

[0013] In addition, to achieve the above-mentioned purpose, the present application also provides a computer device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the steps of the three-dimensional object drawing method provided in any one of the embodiments of the present application when executing the computer program.

[0014] In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the steps of the three-dimensional object drawing method described in any one of the embodiments of the present application.

[0015] The three-dimensional object drawing method, three-dimensional object drawing device, computer equipment and computer-readable storage medium disclosed in the embodiments of the present application can construct corresponding first-level bounding boxes for a number of initial three-dimensional objects at the system engine layer, and perform an intersection operation on each level of bounding boxes to determine the three-dimensional object to be drawn, so that the three-dimensional object can be drawn based on the three-dimensional object to be drawn. The present application aims to achieve the screening of the three-dimensional object to be drawn from a number of initial three-dimensional objects through the intersection operation, thereby improving the drawing efficiency of the three-dimensional objects in the scene and reducing the consumption of computing resources during the drawing process. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0017] Figure 1 It is a flowchart of a method for drawing a three-dimensional object provided in an embodiment of the present application;

[0018] Figure 2 This is a schematic diagram of a first scene of a method for drawing a three-dimensional object provided in an embodiment of the present application;

[0019] Figure 3 is a schematic diagram of a process for determining a target three-dimensional object provided in an embodiment of the present application;

[0020] Figure 4 It is a schematic diagram of a process of drawing a three-dimensional object provided in an embodiment of the present application;

[0021] Figure 5is a schematic block diagram of a three-dimensional object drawing device provided in an embodiment of the present application;

[0022] Figure 6 It is a schematic block diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0024] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor do they have to be executed in the order described. For example, some operations / steps can also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions. In addition, although the functional modules are divided in the device schematic, in some cases, the module division can be different from that in the device schematic.

[0025] The term "and / or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0026] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0027] See also Figure 1 as well as Figure 2 , Figure 1 It is a flowchart of a method for drawing a three-dimensional object provided in an embodiment of the present application; Figure 2 is a schematic diagram of a first scene of a method for drawing a three-dimensional object provided in an embodiment of the present application. Figure 1 As shown, the three-dimensional object drawing method includes steps S11 to S14.

[0028] Step S11: construct corresponding first-level bounding boxes for a number of initial three-dimensional objects at the system engine layer.

[0029] The initial three-dimensional object is a three-dimensional object to be considered in the process of drawing the three-dimensional object. The three-dimensional object may include buildings, character models, cars, landscape elements, etc., depending on the application scenario, such as virtual worlds, video games, movie special effects, simulators, and engineering visualization, etc., which is not limited in this application.

[0030] The first-level bounding box is a level bounding box corresponding to the initial three-dimensional object.

[0031] It is understandable that in the process of drawing a three-dimensional object, there is usually a corresponding scene containing multiple initial three-dimensional objects. The present application aims to process the initial three-dimensional objects in the scene to present the final three-dimensional visual effect in the scene.

[0032] It should be noted that the system engine layer refers to the underlying software layer in computer graphics or game engines, which is responsible for managing and coordinating various graphics processing tasks, including 3D rendering, object position updates, camera view control, etc. The system engine layer is usually located at the bottom of graphics rendering and provides an interface for upper-level applications to perform graphics operations efficiently. The system engine layer usually has the function of optimizing and managing graphics resources to ensure the smoothness and performance of graphics rendering.

[0033] Furthermore, the hierarchical bounding box is an algorithm for approximating complex geometric objects. It gradually approximates the shape of the object by using bounding boxes at different levels, thereby achieving fast bounding box calculation and collision detection for the object. In the hierarchical bounding box algorithm, a rough bounding box is initially used to enclose the entire object, and then the bounding box is divided into smaller bounding boxes, which are gradually refined until the required accuracy is achieved. Therefore, the embodiment of the present application can construct corresponding first-level bounding boxes for several initial three-dimensional objects to express the shape of the initial three-dimensional objects.

[0034] Optionally, the structure type of the first-level bounding box is an axis-aligned bounding box structure, and corresponding first-level bounding boxes are constructed for several initial three-dimensional objects in the system engine layer, including: constructing corresponding first-level bounding boxes for several initial three-dimensional objects in the drawing component of the system engine layer.

[0035] Each layer in the drawing component introduces an axis-aligned bounding box structure, which is used to construct the structure type of the first-level bounding box into an axis-aligned bounding box structure.

[0036] Specifically, for each initial three-dimensional object, a corresponding hierarchical bounding box may be determined by a drawing component of the system engine layer.

[0037] The drawing component is a module in the system engine layer, which is responsible for managing and processing graphics rendering, such as drawing three-dimensional objects on the screen to create visualization effects. It should be noted that this application does not limit the type of drawing components, such as SurfaceFlinger, Wayland, and Mutter. This application takes SurfaceFlinger as an example for illustration.

[0038] SurfaceFlinger is a key component in the Android operating system, responsible for managing and rendering 2D and 3D graphics, as well as user interface elements. SurfaceFlinger ensures effective receipt and display of graphics content to provide smooth user interface, application switching, and graphics performance. SurfaceFlinger is part of the Android system, located at the system level, seamlessly integrated with applications, and provides basic support for the graphics experience of Android devices.

[0039] It can be understood that the structure type of the first-level bounding box is an axis-aligned bounding box structure, so each layer in the drawing component introduces an axis-aligned bounding box structure, which means that each layer has an axis-aligned bounding box structure associated with it. Therefore, the first-level bounding box corresponding to all initial three-dimensional objects can be obtained based on the drawing component, and the structure type of the first-level bounding box is an axis-aligned bounding box structure.

[0040] It should be noted that the axis-aligned bounding box structure is a type of hierarchical bounding box structure, which means that all edges of the hierarchical bounding box's border are parallel to the coordinate axis. Therefore, no matter how the object in the border is rotated, its bounding box will remain aligned with the coordinate axis.

[0041] Optionally, based on the above embodiment, corresponding first-level bounding boxes are constructed for several initial three-dimensional objects in the drawing component of the system engine layer, including: obtaining the diagonal vertices of each initial three-dimensional object in the drawing component; and constructing the corresponding first-level bounding boxes using the diagonal vertices of the initial three-dimensional objects.

[0042] Specifically, a coordinate axis can be pre-established in SurfaceFlinger to obtain multiple vertex coordinates of each initial three-dimensional object in the preset coordinate axis. , The coordinate point closest to the preset coordinate axis and the coordinate point farthest from the coordinate axis among the multiple vertex coordinates are determined as diagonal vertices, so that a minimum cube that can enclose the initial three-dimensional object can be constructed based on the diagonal vertices. The minimum cube is the hierarchical bounding box.

[0043] It should be noted that the present application does not limit the above-mentioned preset coordinate axes. For example, the origin of the preset coordinate axes can be established based on the center of the initial three-dimensional object or a specific point, and the axes of the preset coordinate axes can be determined according to the orientation or shape of the object.

[0044] In an embodiment of the present application, a corresponding first-level bounding box can be constructed for each initial three-dimensional object through the drawing component of the system engine layer. Since the structure of the hierarchical bounding box enables the system engine layer to manage the scene in a hierarchical manner, the management efficiency and processing efficiency of the initial three-dimensional object are improved.

[0045] Step S12: performing an intersection operation on each first-level bounding box to determine the three-dimensional object to be drawn.

[0046] The three-dimensional object to be drawn is a three-dimensional object that intersects with the ray, that is, a visible three-dimensional object that needs to be drawn; the intersection operation is an operation of determining whether the hierarchical bounding box intersects with the ray.

[0047] It should be noted that the above-mentioned ray refers to a straight line starting from a starting point and extending to infinity, which is usually used to perform intersection detection between the ray and objects in the three-dimensional scene. The ray is usually defined by a starting point (usually the camera position or the mouse click point input by the user) and a direction vector (indicating the direction in which the ray extends). In the intersection detection between the ray and the object, it is usually checked whether the ray intersects with the bounding volume of the object (such as the axis-aligned bounding box), and then further checked whether it intersects with the geometric shape of the actual object.

[0048] Specifically, for each first-level bounding box, it can be determined whether the first-level bounding box intersects with the ray. If the first-level bounding box intersects with the ray, it means that the three-dimensional object corresponding to the level bounding box is visible, so the three-dimensional object can be drawn. If the level bounding box does not intersect with the ray, it means that the three-dimensional object is invisible, so the three-dimensional object needs to be excluded.

[0049] In the embodiment of the present application, by performing an intersection operation on the hierarchical bounding box, three-dimensional objects that have no intersection with the ray can be excluded, thereby reducing unnecessary computing consumption and drawing work in the scene, and improving the drawing efficiency of three-dimensional objects in the scene.

[0050] Optionally, before performing an intersection operation on each first-level bounding box to determine the three-dimensional object to be drawn, the method includes: using a dynamic pruning strategy to screen a number of initial three-dimensional objects to obtain a target three-dimensional object.

[0051] Based on the above embodiment, performing an intersection operation on each level bounding box to determine the three-dimensional object to be drawn includes: performing an intersection operation on the second level bounding box corresponding to each target three-dimensional object to determine the three-dimensional object to be drawn.

[0052] Among them, the target three-dimensional object is the three-dimensional object obtained after screening by the dynamic pruning strategy, that is, the three-dimensional object that may be visible; the second-level bounding box is the level bounding box corresponding to the target three-dimensional object.

[0053] It should be noted that the dynamic pruning strategy is a technology used to optimize the calculation process, which is usually used in the fields of graphics rendering, collision detection and ray tracing. The dynamic pruning strategy can be used to determine which objects are unlikely to intersect with the ray. Since objects that do not intersect with the ray are invisible, they can be excluded to reduce the calculation cost of the three-dimensional objects in the scene.

[0054] Specifically, the present application may adopt a dynamic pruning strategy to screen several initial three-dimensional objects, so as to preliminarily exclude the initial three-dimensional objects that have no intersection with the rays, obtain the remaining target three-dimensional objects, and then perform an intersection operation on the second-level bounding box corresponding to each target three-dimensional object to determine the three-dimensional object to be drawn.

[0055] On the basis of the above embodiment, a dynamic pruning strategy is adopted to screen several initial three-dimensional objects to obtain a target three-dimensional object, including: if the initial three-dimensional object is outside the window of the system engine layer, the initial three-dimensional objects outside the window are excluded, and the remaining initial three-dimensional objects are determined as target three-dimensional objects, wherein the rays are emitted within the window; and / or, if the initial three-dimensional object does not need to be intersected, the initial three-dimensional objects that do not need to be intersected are excluded, and the remaining initial three-dimensional objects are determined as target three-dimensional objects.

[0056] It should be noted that the view window represents the visible area seen in the three-dimensional space. In the process of finding the intersection of three-dimensional objects, the ray is emitted from a pixel point in the view window. Therefore, if the initial three-dimensional object is outside the view window, it means that the initial three-dimensional object will definitely not intersect with the ray. Therefore, the initial three-dimensional objects outside the view window can be determined as target three-dimensional objects that have no intersection with the ray and are excluded from the list of objects to be drawn.

[0057] In addition, in some cases, the initial 3D object may not need to intersect with the ray. For example, in some applications, some initial 3D objects may be marked as not accepting shadow casting or invisible, so the initial 3D object can be directly determined as a 3D object that does not intersect with the ray and is excluded from the list of objects to be drawn.

[0058] In the embodiment of the present application, a dynamic pruning strategy can be used to exclude the initial three-dimensional objects that do not intersect with the ray, obtain the target three-dimensional object, and then further perform an intersection operation on the target three-dimensional object to determine the three-dimensional object to be drawn. The dynamic pruning strategy is used to implement preliminary screening of the initial three-dimensional objects, which can reduce the computational consumption of the three-dimensional objects in the scene and improve the drawing efficiency of the three-dimensional objects in the scene.

[0059] Step S14: drawing a three-dimensional object based on the three-dimensional object to be drawn.

[0060] After obtaining the 3D object to be drawn, rendering operations can be performed on it, such as fragment shader processing, rendering to frame buffer operations, and converting the geometric information of the 3D object into pixels on the screen, so as to realize the drawing of the 3D object to be drawn.

[0061] It should be noted that after a 3D object is drawn, its properties remain 3D. Drawing a 3D object only presents the visual representation of the object on a 2D screen, but the object itself still exists in 3D space. For example, when you see a drawn 3D object on the screen, you are actually seeing the projection of the 3D object on a 2D plane. The projection contains the position, size and appearance of the 3D object on the 2D plane. But it still has three spatial dimensions: length, width and height. Therefore, a 3D object still maintains its 3D properties after being drawn.

[0062] In the embodiment of the present application, a rendering operation may be performed on the three-dimensional object to be drawn after it is obtained, so as to realize the drawing of the three-dimensional object.

[0063] The method for drawing three-dimensional objects disclosed in the embodiment of the present application can construct corresponding first-level bounding boxes for a number of initial three-dimensional objects at the system engine layer, and perform an intersection operation on each first-level bounding box to determine the three-dimensional object to be drawn, so that the three-dimensional object can be drawn based on the three-dimensional object to be drawn. The present application aims to screen the three-dimensional object to be drawn from a number of initial three-dimensional objects through the intersection operation, thereby improving the drawing efficiency of the three-dimensional objects in the scene and reducing the consumption of computing resources during the drawing process.

[0064] Please continue reading Figure 3 , Figure 3 1 is a flow chart of determining a target three-dimensional object provided by an embodiment of the present application. Figure 3 As shown, the target three-dimensional object can be determined through steps S121 to S122.

[0065] Step S121: performing an intersection operation on each first-level bounding box to determine whether the ray in the system engine layer intersects with the first-level bounding box.

[0066] Step S122: determining the initial three-dimensional object corresponding to the first-level bounding box intersecting with the ray as the three-dimensional object to be drawn.

[0067] For each first-level bounding box, an intersection operation may be performed to determine whether the ray intersects with the first-level bounding box. When it is determined that the ray intersects with the first-level bounding box, it means that the initial three-dimensional object corresponding to the first-level bounding box is visible, so it can be determined as the three-dimensional object to be drawn for drawing.

[0068] In an embodiment of the present application, it is possible to quickly determine whether a ray intersects with a three-dimensional object in a complex three-dimensional scene to obtain the three-dimensional object to be drawn for drawing the three-dimensional object, thereby reducing the computational cost of drawing the three-dimensional object in the scene.

[0069] Please continue reading Figure 4 , Figure 4 Schematic diagram of a process of drawing a three-dimensional object provided by an embodiment of the present application. Figure 4 As shown, the three-dimensional object can be drawn through steps S141 to S142.

[0070] Step S141: determining corresponding rendering data based on the three-dimensional object to be rendered.

[0071] Step S142: using a drawing component to draw the corresponding three-dimensional object according to the rendering data.

[0072] The rendering data at least includes vertex coordinates, normal coordinates and texture coordinates.

[0073] Furthermore, the drawing component is a module in the system engine layer, which is responsible for managing and processing graphics rendering, usually including rendering pipeline (such as vertex shader, fragment shader, etc.), lighting model, texture mapping, depth testing and blending and other functions.

[0074] It should be noted that the present application does not limit the type of drawing components, including, for example, SurfaceFlinger, Wayland, and Mutter.

[0075] Specifically, for each 3D object to be drawn, its corresponding rendering data (such as vertex coordinates, normal coordinates, texture coordinates, etc.) can be determined. And the rendering data is passed to the drawing component, so that the drawing component can use the rendering data to draw the 3D object to be drawn. Furthermore, after receiving the rendering data, the drawing component can use the rendering pipeline to draw the 3D object to the frame buffer, including transforming the vertex data, lighting calculation, texture mapping, and fragment shading, so as to generate the final pixel color, that is, to achieve the drawing of the 3D object to be drawn.

[0076] In the embodiment of the present application, rendering data corresponding to the three-dimensional object to be drawn can be obtained, and the corresponding three-dimensional object to be drawn can be drawn according to the rendering data through the drawing component.

[0077] See also Figure 5 , Figure 5 1 is a schematic block diagram of a three-dimensional object drawing device provided in an embodiment of the present application. The three-dimensional object drawing device can be configured in a server to execute the above-mentioned three-dimensional object drawing method.

[0078] like Figure 5 As shown, the three-dimensional object drawing device 200 includes: a construction module 201, a determination module 202, and a drawing module 203.

[0079] A construction module 201 is used to construct corresponding first-level bounding boxes for a number of initial three-dimensional objects at the system engine layer;

[0080] A determination module 202, configured to perform an intersection operation on each of the first-level bounding boxes to determine a three-dimensional object to be drawn;

[0081] The drawing module 203 is used to draw a three-dimensional object based on the three-dimensional object to be drawn.

[0082] The determination module 202 is further used to perform an intersection operation on each of the first-level bounding boxes to determine whether the ray in the system engine layer intersects with the first-level bounding box; and determine the initial three-dimensional object corresponding to the first-level bounding box intersecting with the ray as the three-dimensional object to be drawn.

[0083] The determination module 202 is further used to screen the initial three-dimensional objects using a dynamic pruning strategy to obtain a target three-dimensional object; perform an intersection operation on the second-level bounding box corresponding to each target three-dimensional object to determine the three-dimensional object to be drawn.

[0084] The determination module 202 is also used for excluding the initial three-dimensional objects outside the window of the system engine layer if the initial three-dimensional objects are outside the window, and determining the remaining initial three-dimensional objects as the target three-dimensional objects, wherein the rays are emitted within the window; and / or, if the initial three-dimensional objects do not need to be intersected, excluding the initial three-dimensional objects that do not need to be intersected, and determining the remaining initial three-dimensional objects as the target three-dimensional objects.

[0085] The construction module 201 is also used to construct the corresponding first-level bounding boxes for the plurality of the initial three-dimensional objects in the drawing component of the system engine layer, wherein each layer in the drawing component introduces the axis-aligned bounding box structure for constructing the structural type of the first-level bounding box into the axis-aligned bounding box structure.

[0086] The construction module 201 is further used to obtain the diagonal vertices of each of the initial three-dimensional objects in the drawing component; and construct the corresponding first-level bounding box using the diagonal vertices of the initial three-dimensional objects.

[0087] The drawing module 204 is further used to determine corresponding rendering data based on the three-dimensional object to be drawn, wherein the rendering data at least includes vertex coordinates, normal coordinates and texture coordinates; and draw the corresponding three-dimensional object to be drawn according to the rendering data through a drawing component.

[0088] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0089] The method and apparatus of the present application can be used in many general or special computing system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer terminal devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices.

[0090] Exemplarily, the above method and apparatus may be implemented in the form of a computer program. The computer program may be implemented in Figure 6 Runs on the computer device shown.

[0091] See also Figure 6 , Figure 6 1 is a schematic diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.

[0092] like Figure 6 As shown, the computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a volatile storage medium, a non-volatile storage medium and an internal memory.

[0093] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any three-dimensional object drawing method.

[0094] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0095] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any method for drawing a three-dimensional object.

[0096] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art can understand that the structure of the computer device is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0097] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0098] In some embodiments, the processor is used to run a computer program stored in a memory to implement the following steps: construct corresponding first-level bounding boxes for a number of initial three-dimensional objects at the system engine layer; perform an intersection operation on each of the first-level bounding boxes to determine the three-dimensional object to be drawn; and draw a three-dimensional object based on the three-dimensional object to be drawn.

[0099] In some embodiments, the processor is further used to perform an intersection operation on each first-level bounding box to determine whether the ray in the system engine layer intersects with the first-level bounding box; and determine the initial three-dimensional object corresponding to the first-level bounding box intersecting with the ray as the three-dimensional object to be drawn.

[0100] In some embodiments, the processor is further used to screen the initial three-dimensional objects using a dynamic pruning strategy to obtain a target three-dimensional object; perform an intersection operation on the second-level bounding box corresponding to each target three-dimensional object to determine the three-dimensional object to be drawn.

[0101] In some embodiments, the processor is also used to exclude the initial three-dimensional objects outside the window of the system engine layer if the initial three-dimensional object is outside the window, and determine the remaining initial three-dimensional objects as the target three-dimensional objects, wherein the rays are emitted within the window; and / or, if the initial three-dimensional objects do not need to be intersected, exclude the initial three-dimensional objects that do not need to be intersected, and determine the remaining initial three-dimensional objects as the target three-dimensional objects.

[0102] In some embodiments, the processor is further used to construct corresponding first-level bounding boxes for several of the initial three-dimensional objects in the drawing component of the system engine layer, wherein each layer in the drawing component introduces the axis-aligned bounding box structure to construct the structure type of the first-level bounding box into the axis-aligned bounding box structure.

[0103] In some implementations, the processor is further configured to obtain, in the drawing component, diagonal vertices of each of the initial three-dimensional objects; and construct a corresponding first-level bounding box using the diagonal vertices of the initial three-dimensional objects.

[0104] In some embodiments, the processor is further used to determine corresponding rendering data based on the three-dimensional object to be drawn, wherein the rendering data includes at least vertex coordinates, normal coordinates, and texture coordinates; and draw the corresponding three-dimensional object to be drawn according to the rendering data through a drawing component.

[0105] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions, and when the program instructions are executed, any three-dimensional object drawing method provided in the embodiment of the present application is implemented.

[0106] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc., equipped on the computer device.

[0107] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like.

[0108] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for drawing a three-dimensional object, characterized in that: The method comprises: Construct corresponding first-level bounding boxes for a number of initial three-dimensional objects at the system engine layer; Performing an intersection operation on each of the first-level bounding boxes to determine a three-dimensional object to be drawn; Drawing a three-dimensional object is performed based on the three-dimensional object to be drawn.

2. The method according to claim 1, characterized in that The performing an intersection operation on each of the first-level bounding boxes to determine the three-dimensional object to be drawn includes: Performing an intersection operation on each of the first-level bounding boxes to determine whether the ray in the system engine layer intersects with the first-level bounding box; An initial three-dimensional object corresponding to a first-level bounding box intersecting with the ray is determined as the three-dimensional object to be drawn.

3. The method according to claim 1, characterized in that Before performing the intersection operation on each of the first-level bounding boxes to determine the three-dimensional object to be drawn, the method includes: Using a dynamic pruning strategy to screen the initial three-dimensional objects to obtain a target three-dimensional object; The performing an intersection operation on each of the level bounding boxes to determine the three-dimensional object to be drawn includes: An intersection operation is performed on the second-level bounding box corresponding to each of the target three-dimensional objects to determine the three-dimensional object to be drawn.

4. The method according to claim 3, characterized in that The method of adopting a dynamic pruning strategy to screen a plurality of the initial three-dimensional objects to obtain a target three-dimensional object includes: If the initial three-dimensional object is outside the window of the system engine layer, the initial three-dimensional object outside the window is excluded, and the remaining initial three-dimensional objects are determined as the target three-dimensional objects, wherein the ray is emitted within the window; and / or, If the initial three-dimensional objects do not need to be intersected, the initial three-dimensional objects that do not need to be intersected are excluded, and the remaining initial three-dimensional objects are determined as the target three-dimensional objects.

5. The method according to claim 1, characterized in that The structure type of the first-level bounding box is an axis-aligned bounding box structure, and the first-level bounding boxes corresponding to the initial three-dimensional objects are constructed at the system engine layer, including: In the drawing component of the system engine layer, the first-level bounding boxes corresponding to the initial three-dimensional objects are constructed, wherein each layer in the drawing component introduces the axis-aligned bounding box structure for constructing the structure type of the first-level bounding box into the axis-aligned bounding box structure.

6. The method according to claim 5, characterized in that The constructing the first-level bounding boxes corresponding to the plurality of the initial three-dimensional objects in the drawing component of the system engine layer includes: Obtaining, in the drawing component, a diagonal vertex of each of the initial three-dimensional objects; The diagonal vertices of the initial three-dimensional object are used to construct the corresponding first-level bounding box.

7. The method according to claim 1, characterized in that The drawing of the three-dimensional object based on the three-dimensional object to be drawn includes: Determining corresponding rendering data based on the three-dimensional object to be drawn, wherein the rendering data at least includes vertex coordinates, normal coordinates and texture coordinates; The corresponding three-dimensional object to be drawn is drawn according to the rendering data by a drawing component.

8. A three-dimensional object drawing device, characterized in that: The three-dimensional object drawing device comprises: A construction module, the construction module is used to construct corresponding first-level bounding boxes for a number of initial three-dimensional objects at the system engine layer; A determination module, the determination module is used to perform an intersection operation on each of the first-level bounding boxes to determine a three-dimensional object to be drawn; A drawing module is used to draw a three-dimensional object based on the three-dimensional object to be drawn.

9. A computer device, characterized in that: include: A memory and a processor; wherein the memory is connected to the processor and is used to store a program; the processor is used to implement the steps of the method for drawing a three-dimensional object as described in any one of claims 1 to 7 by running the program stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to implement the steps of the method for drawing a three-dimensional object as described in any one of claims 1 to 7.