Virtual object rendering method and device

By converting the three-dimensional mesh model into a two-dimensional planar mesh model and reconstructing it using an intelligent recovery algorithm, the problem of large resource consumption and poor details during virtual objects rendering is solved, and efficient rendering and high-quality image output is achieved.

CN118967902APending Publication Date: 2024-11-15SHIYOU OASIS (SHANGHAI) DIGITAL TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411027389.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In virtual scenes, in order to ensure the rendering effect of virtual objects, the model usually contains a large number of polygonal faces, which leads to an increase in resource consumption during rendering. Reducing the faces in traditional methods will lead to loss of model details and affect image quality.

Method used

By obtaining the three-dimensional original mesh model, using geometric processing to convert it into a two-dimensional planar mesh model, segmenting the bounding box into a face sheet model, and using an intelligent recovery algorithm to convert it back to a three-dimensional reconstruction mesh model for rendering.

Benefits of technology

While reducing resource consumption, retain model details, improve rendering efficiency and image quality, and improve the realism and vividness of virtual objects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118967902A_ABST
    Figure CN118967902A_ABST
Patent Text Reader

Abstract

The invention discloses a rendering method and device of a virtual object. The method comprises the following steps: acquiring a three-dimensional original grid model of a virtual object to be rendered, and converting the original grid model into a two-dimensional planar grid model by utilizing a geometric processing method; determining a bounding box of the two-dimensional planar mesh model, segmenting the bounding box into a plurality of patches, and generating a patch model based on the plurality of patches; converting the patch model from a two-dimensional model to a three-dimensional model by using an intelligent recovery algorithm to obtain a three-dimensional reconstruction grid model; and rendering the virtual object to be rendered based on the three-dimensional reconstruction grid model. According to the method and the device, the technical problem of poor details rendered under the condition of few used resources when the virtual object is rendered is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to a method and device for rendering a virtual object. Background Art

[0002] In virtual scenes, in order to ensure the rendering effect of virtual objects, models usually contain a large number of polygonal faces. However, as the number of faces increases, the resources required to render these models will also increase significantly, resulting in a decrease in rendering efficiency. In traditional methods, this problem is usually solved by directly reducing the number of model faces. Although this method can effectively reduce the resource usage during the rendering process, it will also lead to a serious loss of model details. As a result, the rendered virtual objects appear less vivid and realistic, and the overall image quality is affected. Therefore, how to reduce the number of faces while retaining the model details is a technical problem that needs to be solved urgently.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present application provide a method and device for rendering a virtual object, so as to at least solve the technical problem of poor details rendered when rendering a virtual object with few resources used.

[0005] According to one aspect of an embodiment of the present application, a method for rendering a virtual object is provided, comprising: obtaining a three-dimensional original mesh model of the virtual object to be rendered, and converting the original mesh model into a two-dimensional plane mesh model using a geometric processing method; determining a bounding box of the two-dimensional plane mesh model, dividing the bounding box into a plurality of facets, and generating a facet model based on the plurality of facets; converting the facet model from a two-dimensional model back to a three-dimensional model using an intelligent recovery algorithm to obtain a three-dimensional reconstructed mesh model; and rendering the virtual object to be rendered based on the three-dimensional reconstructed mesh model.

[0006] According to another aspect of an embodiment of the present application, a rendering device for a virtual object is also provided, including: an acquisition module, configured to acquire a three-dimensional original mesh model of a virtual object to be rendered, and convert the original mesh model into a two-dimensional plane mesh model using a geometric processing method; a generation module, configured to determine a bounding box of the two-dimensional plane mesh model, divide the bounding box into a plurality of facets, and generate a facet model based on the plurality of facets; a reconstruction module, configured to convert the facet model from a two-dimensional back to a three-dimensional model using an intelligent recovery algorithm to obtain a three-dimensional reconstructed mesh model; and a rendering module, configured to render the virtual object to be rendered based on the three-dimensional reconstructed mesh model.

[0007] In an embodiment of the present application, a three-dimensional original mesh model of a virtual object to be rendered is obtained, and the original mesh model is converted into a two-dimensional plane mesh model using a geometric processing method; a bounding box of the two-dimensional plane mesh model is determined, the bounding box is divided into a plurality of facets, and a facet model is generated based on the plurality of facets; using an intelligent recovery algorithm, the facet model is converted from a two-dimensional model back to a three-dimensional model to obtain a three-dimensional reconstructed mesh model; and the virtual object to be rendered is rendered based on the three-dimensional reconstructed mesh model, thereby solving the technical problem of poor details rendered when rendering virtual objects with few resources used. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0009] Figure 1 is a flowchart of a method for rendering a virtual object according to an embodiment of the present application;

[0010] Figure 2 is a flowchart of another method for rendering a virtual object according to an embodiment of the present application;

[0011] Figure 3 is a flow chart of a method for obtaining an original three-dimensional mesh model and converting it into a two-dimensional plane mesh model according to an embodiment of the present application;

[0012] Figure 4 is a flow chart of a method for determining a bounding box of a two-dimensional plane mesh model and generating a patch model according to an embodiment of the present application;

[0013] Figure 5 is a flow chart of a method for converting a patch model from a two-dimensional model back to a three-dimensional model according to an embodiment of the present application;

[0014] Figure 6 is a flow chart of another method for converting a patch model from a two-dimensional model back to a three-dimensional model according to an embodiment of the present application;

[0015] Figure 7 is a flow chart of a method for identifying internal faces in the two-dimensional patch model according to an embodiment of the present application;

[0016] Figure 8 is a structural schematic diagram of a virtual object rendering device according to an embodiment of the present application;

[0017] Fig. 9 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0018] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only 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 should fall within the scope of protection of the present application.

[0019] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0020] According to an embodiment of the present application, a method for rendering a virtual object is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0021] Figure 1 is a method for rendering a virtual object according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0022] Step S102: obtaining a three-dimensional original mesh model of a virtual object to be rendered, and converting the original mesh model into a two-dimensional plane mesh model using a geometric processing method.

[0023] The original three-dimensional mesh model of the virtual object to be rendered is obtained, a projection method is selected, and the vertices of the original mesh model are projected onto a two-dimensional plane according to the selected projection method; the projected vertices are connected into patches to generate the two-dimensional plane mesh model. In this way, the resources required for rendering are effectively reduced, while the main structure and details of the model are retained, and the rendering efficiency and image quality are improved.

[0024] Step S104: determine a bounding box of the two-dimensional plane mesh model, divide the bounding box into a plurality of facets, and generate a facet model based on the plurality of facets.

[0025] Determine the minimum and maximum coordinates of all vertices of the two-dimensional plane mesh model, and determine the bounding box based on the minimum and maximum coordinates; based on the distribution of the two-dimensional plane mesh model, adaptively divide the bounding box into the multiple facets of different sizes; generate the facet model based on the geometric shape and position of each facet in the multiple facets. This application significantly improves rendering efficiency and accuracy by adaptively dividing and optimizing the two-dimensional plane mesh model, while effectively retaining model details, reducing the consumption of rendering resources, and enhancing the realism and vividness of virtual objects.

[0026] Step S106: using an intelligent recovery algorithm, convert the patch model from a two-dimensional model back into a three-dimensional model to obtain a three-dimensional reconstructed mesh model.

[0027] Utilize an intelligent recovery algorithm to delete the internal faces of the mesh model. For example, use the intelligent recovery algorithm to analyze the mesh model and identify the internal faces of the mesh model, wherein the internal faces are internal structural faces that do not affect the appearance; delete the identified internal faces and retain only the external faces of the mesh model. Based on the vertices on the mesh model from which the internal faces have been deleted, re-divide the internal faces of the mesh model from which the internal faces have been deleted to obtain the three-dimensional reconstructed mesh model. For example, extract all vertices from the mesh model from which the internal faces have been deleted, construct an adjacency graph of the vertices based on the extracted vertices, and re-divide the internal faces of the mesh model from which the internal faces have been deleted using a triangulation algorithm based on the adjacency graph; combine the re-divide patches according to topological relationships to obtain the three-dimensional reconstructed mesh model.

[0028] This application uses an intelligent recovery algorithm to delete the internal faces of the patch model and re-divide and reconstruct it, effectively reducing the consumption of rendering computing resources, while retaining the appearance details and structural integrity of the model, and improving the efficiency and accuracy of the three-dimensional reconstructed mesh model.

[0029] Step S108: rendering the virtual object to be rendered based on the three-dimensional reconstructed mesh model.

[0030] The 3D reconstructed mesh model that has undergone the above processing is finally rendered and output to generate high-quality rendered images or animations. This process includes frame buffer processing and color mixing to ensure that the final output meets the expected visual effects.

[0031] Figure 2 Another method for rendering a virtual object according to an embodiment of the present application is as follows: Figure 2As shown, the method comprises the following steps:

[0032] Step S202, obtaining the original three-dimensional mesh model and converting it into a two-dimensional plane mesh model.

[0033] like Figure 3 As shown, the method for obtaining the original three-dimensional mesh model and converting it into a two-dimensional plane mesh model includes the following steps:

[0034] Step S2022, obtaining the original mesh model.

[0035] Obtain the 3D mesh model of the virtual object to be rendered from the storage or real-time data stream. The model contains the geometric information and texture data of the virtual object. By obtaining the 3D mesh model from the storage or real-time data stream, the geometric information and texture data of the rendered object can be ensured to be complete and accurate, thus providing the necessary data foundation for subsequent conversion and processing, and ensuring the authenticity and detail richness of the final rendering effect.

[0036] Step S2024, select the projection mode.

[0037] Select a projection method, such as vertex projection or perspective projection. This embodiment adopts the vertex projection method to project all vertices of the original mesh model onto a two-dimensional plane according to the selected projection method. This is achieved by calculating the coordinates of each vertex on the two-dimensional plane. This embodiment selects vertex projection to ensure that the projection result of the three-dimensional model on the two-dimensional plane retains the geometric information of the original model as much as possible. In this way, the projected two-dimensional plane mesh model can more accurately reflect the structure and shape of the three-dimensional model, ensuring the accuracy of subsequent processing.

[0038] Step S2026, generating a two-dimensional plane mesh model.

[0039] The projected vertices are connected in the original mesh model to generate patches to form a two-dimensional plane mesh model. For example, according to the patches (polygons connected by vertices) in the original mesh model, the projected vertices are connected on a two-dimensional plane. The original topology is maintained to ensure that the two-dimensional plane mesh model correctly represents the geometric information of the original three-dimensional model. The two-dimensional plane mesh model is composed of the projected vertices and their connection relationships.

[0040] The present application generates patches by connecting the projected vertices in accordance with the patches in the original mesh model to form a two-dimensional plane mesh model, thereby maintaining the consistency of the original geometry and topological structure, simplifying the calculation process, improving processing efficiency, and facilitating subsequent operations and visual displays.

[0041] This embodiment generates a projected two-dimensional plane mesh model according to the connection mode in the original mesh model, so as to maintain the geometric and topological consistency of the original model. This not only simplifies the calculation process, but also ensures the accuracy of the representation of the model on the two-dimensional plane, which is convenient for subsequent operation and visualization.

[0042] Step S204, determining the bounding box of the two-dimensional plane mesh model and generating a patch model.

[0043] like Figure 4 As shown, the method for determining the bounding box of a two-dimensional plane mesh model and generating a patch model includes the following steps:

[0044] Step S2042, determine the bounding box.

[0045] Find the minimum and maximum coordinates of all vertices of the two-dimensional plane mesh model and calculate the bounding box, where the bounding box is a rectangular area surrounding the entire plane mesh model. For example, initialize the minimum and maximum coordinates, and initialize the minimum and maximum coordinates to very large and very small values ​​respectively. Then, traverse all vertices. Check each vertex in the two-dimensional plane mesh model one by one. For each vertex, record its horizontal coordinate and vertical coordinate, and compare them with the current minimum and maximum coordinates. If the horizontal coordinate of a vertex is less than the currently recorded minimum horizontal coordinate, update the minimum horizontal coordinate. Similarly, if the horizontal coordinate of a vertex is greater than the currently recorded maximum horizontal coordinate, update the maximum horizontal coordinate. The comparison and update process for the vertical coordinate is the same. Finally, calculate the bounding box. After completing the inspection and comparison of all vertices, the minimum and maximum coordinates have been updated to the minimum and maximum values ​​of all vertices in the mesh model. These two coordinate points can determine a rectangular area, namely the bounding box. This bounding box can completely surround the entire two-dimensional plane mesh model to ensure that all vertices are included. This embodiment can clarify the scope of the two-dimensional plane mesh model by determining the bounding box, ensuring that all vertices are included, thereby providing a basis for subsequent facet generation and optimization, ensuring that the generated facets can completely cover the model, and improving the integrity and accuracy of the model.

[0046] Step S2044, segment the bounding box and generate patches.

[0047] When performing mesh segmentation, a dynamic adjustment method can be used to generate patches that adapt to density changes. The specific steps are as follows:

[0048] 1) Density mapping.

[0049] First, the density distribution is mapped to each area of ​​the grid. The density value can be used to determine the segmentation granularity of each area. For example, a density threshold can be set, and when the density is higher than this threshold, the grid is subdivided into more small patches, and when the density is lower than this threshold, the mesh is segmented into larger patches. By mapping the density distribution to each area of ​​the grid and determining the segmentation granularity according to the density value, this embodiment can adaptively optimize the grid subdivision process, so that high-density areas have more small patches to capture details, while low-density areas use larger patches to simplify the structure, thereby improving the overall processing efficiency and rendering effect, and ensuring that the details and overall performance of the model are optimally balanced.

[0050] 2) Grid subdivision.

[0051] According to the density mapping results, the mesh is subdivided. In high-density areas, a finer mesh is achieved by increasing the number of facets and reducing the size of the facets, which can better accommodate the details of dense areas. On the contrary, in low-density areas, the mesh is simplified by reducing the number of facets and increasing the size of the facets, thereby improving computational efficiency. This embodiment subdivides the mesh according to the density mapping results, and achieves a finer mesh by increasing the number of facets and reducing the size of the facets in high-density areas to better capture the details of dense areas; in low-density areas, the number of facets is reduced and the size of the facets is increased to simplify the mesh structure, thereby improving computational efficiency and ensuring that the model has both detailed expression and optimized overall performance.

[0052] 3) Mesh generation.

[0053] Facets are generated in each subdivided subgrid. Based on the subdivided grid, faces of corresponding number and size can be generated to adapt to different density areas. The generation of faces can be completed by triangular mesh, quadrilateral mesh or other polygonal mesh methods. This embodiment can flexibly adapt to various geometric requirements and improve the expressiveness and processing efficiency of the model by using triangular mesh, quadrilateral mesh or other polygonal mesh methods.

[0054] 4) Surface optimization and adjustment.

[0055] After the meshes are generated, they are integrated. All generated meshes are integrated to ensure that they can completely cover the bounding box and correctly represent the structure of the two-dimensional plane mesh model. The connection and alignment of the meshes are checked and fine-tuned to ensure that the boundaries of the meshes can be smoothly connected to avoid breaks or overlaps. This embodiment can ensure that the boundaries of the meshes are smoothly connected to avoid breaks or overlaps, thereby improving the overall consistency and visual coherence of the model.

[0056] Through the above steps, the bounding box can be adaptively divided into multiple facets according to the distribution of the two-dimensional plane mesh model to better adapt to the geometric information and detail requirements of the model.

[0057] Step S2046, generating a patch model.

[0058] 1) Parse and collect patch data.

[0059] Get the vertex coordinates of each patch and record their positions. Based on the vertex coordinates, determine how the patches are connected. Calculate the normal vector of each patch based on the vertex coordinates, for example, it can be determined using the cross product of the vertex coordinates. In some embodiments, if texture mapping is required, obtain the texture coordinates of each patch. Adjust the position of each patch to ensure their correct position in the model, for example, translate the vertex coordinates according to the patch's position data, and if the patch needs to be rotated, calculate the rotation matrix and apply it to the vertex coordinates; combine all processed patches into a complete model, for example, merge the vertex coordinates of all patches into a vertex list, merge the normal vectors of all patches, and merge the texture coordinates of all patches when textures are used.

[0060] This embodiment extracts the geometric information of the facets, obtains the vertex coordinates of each facet and records its position, and can accurately determine the connection mode of the facets and calculate the normal vector. In the case where texture mapping is required, the texture coordinates of the facets can also be obtained. By adjusting the position of each facet, such as translation and rotation, its correct position in the model is ensured, and all processed faces are integrated into a complete model, including the merging of vertex coordinates, normal vectors and texture coordinates, so as to ensure the geometric accuracy and visual effect of the model.

[0061] Step S206: convert the mesh model from two-dimensional to three-dimensional using an intelligent recovery algorithm.

[0062] like Figure 5 As shown, the method for converting a two-dimensional mesh model back to a three-dimensional model includes the following steps:

[0063] Step S2062, delete the internal surface.

[0064] Use intelligent recovery algorithms to identify and delete internal faces in mesh models. Internal faces are structural faces that do not affect the appearance. By identifying and deleting internal faces in mesh models, the model structure can be simplified and redundant data can be reduced, thereby improving the rendering efficiency of the model and reducing the consumption of computing resources, while ensuring that the appearance and details remain unchanged.

[0065] Step S2064, construct a vertex adjacency graph.

[0066] Extract all remaining vertices from the patch model with the internal faces deleted, and build an adjacency graph based on the remaining vertices. Each vertex in the adjacency graph is connected to its adjacent vertices by edges. For a three-dimensional model, the adjacency graph represents the topological relationship between vertices. Traverse all vertices and build an adjacency graph based on the connection relationship between them. Each vertex will have an edge connected to its adjacent vertices in the graph. This embodiment helps to ensure the coherence and accuracy of the model structure and improve the quality of the final three-dimensional reconstruction.

[0067] Step S2066, perform triangulation.

[0068] Use the adjacency graph for triangulation to divide the patch model into triangular patches. Assume that the patch set is {T1, T2, ..., Tm}, where each patch Ti consists of three vertices. Each patch consists of three vertices {v1, v2, v3}. The connection relationship between vertices is represented by edges, and the set of edges can be used to represent the topological relationship of the patches. Assign a unique index to each vertex for fast search and connection in subsequent steps. Assume that the vertex set is {V1, V2, ..., Vn}, where each vertex Vi corresponds to a unique index i. Assign an index to each edge and record the two vertices of each edge. For example, edge Eij connects vertices Vi and Vj. The set of edges is {Eij}. By assigning a unique index to each vertex and edge, fast search and connection are ensured, while the topological relationship between vertices and edges is clearly represented.

[0069] Traverse all generated triangular patches {T1, T2, ..., Tm}, and combine each patch together according to the topological relationship. For each patch Ti, add its three vertices {v1, v2, v3} to the vertex list. If the vertex already exists, skip this step. Add the patch Ti and its vertex index to the patch list. When combining patches, detect and process the shared edges between patches. A shared edge is an edge shared by two patches, which can be used to ensure the coherence of the mesh. For the edge of each patch, check whether there are other patches that also contain the edge. If so, merge the edges of the two patches to ensure the coherence of the mesh. After merging the shared edges, further remove redundant vertices, edges and patches to improve the quality and efficiency of the mesh. This embodiment can ensure the coherence and consistency of the mesh by traversing all generated triangular patches and combining them according to the topological relationship. In addition, by checking and merging shared edges, smooth connection between patches is guaranteed, breakage and overlap are avoided, and the quality and efficiency of the mesh are optimized, making the final model more accurate and efficient.

[0070] Calculate the normal vector for each facet to ensure that the model has the correct lighting effect when rendering. The normal vector is usually the normal vector of the facet and can be calculated by the vertex coordinates. Add texture to the model and calculate the texture coordinates of each vertex. Texture coordinates can be used to map the image to the surface of the model to increase the visual effect. This embodiment calculates the normal vector of each facet to ensure that the lighting effect of the model is accurate and realistic when rendering. Calculating the normal vector through vertex coordinates optimizes the accuracy of lighting calculations. Adding texture to the model and calculating the texture coordinates of each vertex enables the image to be accurately mapped to the surface of the model, thereby enhancing the visual effect and making the final rendering result more detailed and realistic.

[0071] All vertices, edges and patches are combined into a final three-dimensional mesh data structure to obtain a three-dimensional reconstructed mesh model. The data structure can be an object-oriented class or a data format required by a graphics API (such as OpenGL, DirectX, etc.). The generated mesh is further optimized, for example, duplicate vertices are removed, shared edges are merged, and the mesh surface is smoothed to improve the visual effect of the model. In this embodiment, all vertices, edges and patches are combined into a final three-dimensional mesh data structure to form a complete three-dimensional reconstructed mesh model. In this way, it can adapt to the data format required by an object-oriented class or a graphics API (such as OpenGL, DirectX, etc.). By further optimizing the generated mesh, such as removing duplicate vertices, merging shared edges, and smoothing the mesh surface, the visual effect and performance quality of the model can be significantly improved, ensuring a more realistic and detailed rendering result.

[0072] Step S208: rendering a virtual object based on the three-dimensional reconstructed mesh model.

[0073] Choose a suitable rendering engine (such as OpenGL, DirectX, Unity, Unreal Engine). Set up the rendering pipeline, including vertex shading, rasterization, fragment shading and other stages. Apply post-processing effects (such as anti-aliasing, depth of field, color correction) to improve image quality.

[0074] The present application also provides a method for converting a two-dimensional patch model into a three-dimensional model. Figure 6 As shown, the method comprises the following steps:

[0075] Step S602: identifying internal faces in the two-dimensional mesh model, and deleting the internal faces from the mesh model.

[0076] like Figure 7 As shown, the method for identifying the internal surface in the two-dimensional patch model includes the following steps:

[0077] Step S6022, determine the directionality of the edge.

[0078] First, the edges are vectorized. To determine the direction of each edge, you can use the counterclockwise direction (left-hand rule), usually choosing the smallest vertex as the starting point to unify the direction, and then determine the normal vector of the face based on the direction of the edge.

[0079] Step S6024, internal face recognition.

[0080] The 2D plane of the patch model is divided according to the scan lines, and the intersection points of each scan line and the normal vector are counted to build a list of intersection points, and the areas inside and outside the scan lines are determined. Finally, the intersection points are sorted according to the direction of the scan lines. The area between the intersection points is marked as the internal surface.

[0081] Step S604: construct an adjacency graph based on the patch model with the internal faces deleted.

[0082] Extract all remaining vertices from the patch model with the internal faces deleted, and build an adjacency graph based on the remaining vertices. Each vertex in the adjacency graph is connected to its adjacent vertices by edges. For a three-dimensional model, the adjacency graph represents the topological relationship between vertices. Traverse all vertices and build an adjacency graph based on the connection relationship between them. Each vertex will have an edge connected to its adjacent vertices in the graph. This embodiment helps to ensure the coherence and accuracy of the model structure and improve the quality of the final three-dimensional reconstruction.

[0083] Step S606: triangulate the patch model with the internal faces deleted based on the adjacency graph, and convert the patch model into a three-dimensional reconstructed mesh model.

[0084] 1) Assign unique indices to vertices and edges.

[0085] Assign a unique index to each vertex and build an index table for fast lookup and connection. Assign a unique index to each edge and build an edge index table to represent the topological relationship between vertices.

[0086] 2) Triangulate based on the adjacency graph.

[0087] Traverse the patch set and add the three vertices of each patch to the vertex list. Check if each vertex already exists in the vertex list, and add it if not. Record the index information of the patch and its vertices to ensure that each patch is stored correctly.

[0088] Based on the adjacency graph, these vertices and edges are divided into a set of non-overlapping triangles. The generated triangles satisfy certain geometric constraints, such as maximizing the minimum angle to avoid thin and long triangles, thereby improving the mesh quality. Ultimately, the resulting triangular mesh model can not only better represent the original geometric shape, but also provide an efficient numerical calculation basis in computer graphics, finite element analysis and other fields.

[0089] 3) Detect and process shared edges

[0090] Traverse the edges of each patch and check whether there are other patches that also contain the edge, identify the shared edges, and merge the patches that contain the shared edges to ensure the coherence and consistency of the mesh and avoid breaks and overlaps in the topology.

[0091] 4) Remove redundant vertices and edges

[0092] Traverse vertices and edges, detect redundant vertices and edges, and remove duplicate elements. Update vertex and edge indexes, remove redundant items, and improve mesh quality and computational efficiency.

[0093] 5) Construct 3D reconstruction mesh model

[0094] Combine the optimized vertices, edges and faces into a complete 3D mesh model to ensure the integrity of the topological structure. Apply a smoothing algorithm to optimize the surface quality of the mesh and reduce unnecessary sharp edges and mutations.

[0095] The present application also provides a virtual object rendering device, such as Figure 8 As shown, it includes: an acquisition module 82, which is configured to acquire a three-dimensional original mesh model of a virtual object to be rendered, and convert the original mesh model into a two-dimensional plane mesh model by using a geometric processing method; a generation module 84, which is configured to determine a bounding box of the two-dimensional plane mesh model, divide the bounding box into a plurality of facets, and generate a facet model based on the plurality of facets; a reconstruction module 86, which is configured to convert the facet model from a two-dimensional back to a three-dimensional model by using an intelligent recovery algorithm based on machine learning, so as to obtain a three-dimensional reconstructed mesh model; and a rendering module 88, which is configured to render the virtual object to be rendered based on the three-dimensional reconstructed mesh model.

[0096] It should be noted that the virtual object rendering device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the virtual object rendering device provided in the above embodiment and the virtual object rendering method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0097] Fig. 9 FIG. 1 shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present disclosure. It should be noted that: Fig. 9 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0098] like Fig. 9 As shown, the electronic device includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for system operation are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0099] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.

[0100] In particular, according to an embodiment of the present disclosure, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, various functions defined in the method and apparatus of the present application are executed. In some embodiments, the electronic device may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0101] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0102] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0103] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0104] As another aspect, the present application further provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device.

[0105] The computer-readable medium carries one or more programs, and when the one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiments. For example, the electronic device can implement each step of the method embodiment.

[0106] As another aspect, the present application further provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program executable by the at least one processor, and the computer program is used to enable the electronic device to perform the method of the embodiment of the present application when executed by the at least one processor.

[0107] As another aspect, the present application further provides a computer program product, including a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute the method of the embodiment of the present application.

[0108] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0109] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0110] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0111] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0112] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0113] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0114] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for rendering a virtual object, characterized in that: include: Acquire a three-dimensional original mesh model of a virtual object to be rendered, and convert the original mesh model into a two-dimensional plane mesh model using a geometric processing method; Determine a bounding box of the two-dimensional plane mesh model, divide the bounding box into a plurality of facets, and generate a facet model based on the plurality of facets; Using an intelligent recovery algorithm, the patch model is converted from a two-dimensional model back to a three-dimensional model to obtain a three-dimensional reconstructed mesh model; The virtual object to be rendered is rendered based on the three-dimensional reconstructed mesh model.

2. The method according to claim 1, characterized in that The original mesh model is converted into a two-dimensional plane mesh model by using a geometric processing method, including: Selecting a projection mode, and projecting the vertices of the original mesh model onto a two-dimensional plane according to the selected projection mode; The projected vertices are connected into patches to generate the two-dimensional plane mesh model.

3. The method according to claim 1, characterized in that determining a bounding box of the two-dimensional planar mesh model, The bounding box is divided into a plurality of patches, and a patch model is generated based on the plurality of patches, comprising: Determine the minimum coordinates and the maximum coordinates of all vertices of the two-dimensional plane mesh model, and determine the bounding box based on the minimum coordinates and the maximum coordinates; Based on the distribution of the two-dimensional plane grid model, adaptively dividing the bounding box into the plurality of patches of different sizes; The patch model is generated based on the geometric shape and position of each patch in the plurality of patches.

4. The method according to claim 1, characterized in that: The surface model is converted from a two-dimensional model back to a three-dimensional model by using an intelligent recovery algorithm to obtain a three-dimensional reconstructed mesh model, including: Deleting the internal faces of the patch model using an intelligent recovery algorithm; Based on the vertices on the patch model with the internal faces deleted, the internal faces of the patch model with the internal faces deleted are re-divided to obtain the three-dimensional reconstructed mesh model.

5. The method according to claim 4, characterized in that Using an intelligent recovery algorithm, the internal faces of the patch model are deleted, including: Analyzing the patch model using the intelligent restoration algorithm to identify internal surfaces of the patch model, wherein the internal surfaces are internal structural surfaces that do not affect the appearance; The identified internal faces are deleted, and only the external faces of the patch model are retained.

6. The method according to claim 4, characterized in that Based on the vertices on the patch model from which the internal surface is deleted, re-dividing the internal surface of the patch model from which the internal surface is deleted to obtain the three-dimensional reconstructed mesh model, comprising: Extracting all vertices from the patch model from which the internal faces are deleted, constructing an adjacency graph of the vertices based on the extracted vertices, and re-dividing the internal faces of the patch model from which the internal faces are deleted by using a triangulation algorithm based on the adjacency graph; The re-divided facets are combined according to topological relationships to obtain the three-dimensional reconstructed mesh model.

7. A virtual object rendering device, characterized in that: include: An acquisition module is configured to acquire a three-dimensional original mesh model of a virtual object to be rendered, and convert the original mesh model into a two-dimensional plane mesh model using a geometric processing method; A generation module is configured to determine a bounding box of the two-dimensional plane mesh model, divide the bounding box into a plurality of facets, and generate a facet model based on the plurality of facets; A reconstruction module is configured to convert the patch model from a two-dimensional model back to a three-dimensional model using an intelligent recovery algorithm to obtain a three-dimensional reconstructed mesh model; A rendering module is configured to render the virtual object to be rendered based on the three-dimensional reconstructed mesh model.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 6.

9. A computer device, characterized in that: include: Memory and processor, The memory stores a computer program; The processor is used to execute the computer program stored in the memory, and when the computer program is run, the processor is enabled to execute the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Digital twinborn construction method and system applied to customs supervision

    CN120279198A

  • 3D map performance optimization method based on custom geometric figure one-sided structure

    CN120612440A

  • Multistage grid orthogonal slice drawing method based on line segment merging

    CN121437706A