Movatterモバイル変換


[0]ホーム

URL:


CN118967902A - Method and device for rendering virtual objects - Google Patents

Method and device for rendering virtual objects
Download PDF

Info

Publication number
CN118967902A
CN118967902ACN202411027389.9ACN202411027389ACN118967902ACN 118967902 ACN118967902 ACN 118967902ACN 202411027389 ACN202411027389 ACN 202411027389ACN 118967902 ACN118967902 ACN 118967902A
Authority
CN
China
Prior art keywords
model
dimensional
patch
patches
mesh model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411027389.9A
Other languages
Chinese (zh)
Inventor
纪智辉
赵川江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shiyou Oasis Shanghai Digital Technology Co ltd
Original Assignee
Shiyou Oasis Shanghai Digital Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shiyou Oasis Shanghai Digital Technology Co ltdfiledCriticalShiyou Oasis Shanghai Digital Technology Co ltd
Priority to CN202411027389.9ApriorityCriticalpatent/CN118967902A/en
Publication of CN118967902ApublicationCriticalpatent/CN118967902A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

The application discloses a virtual object rendering method and device. Wherein 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 plane grid model by using a geometric processing method; determining a boundary box of the two-dimensional plane grid model, dividing the boundary box into a plurality of patches, and generating a patch model based on the patches; converting the patch model from two dimensions back to a three-dimensional model by using an intelligent recovery algorithm to obtain a three-dimensional reconstruction grid model; rendering the virtual object to be rendered based on the three-dimensional reconstructed mesh model. The method and the device solve the technical problem that the detail rendered under the condition of less used resources is poor when the virtual object is rendered.

Description

Virtual object rendering method and device
Technical Field
The present application relates to the field of image processing, and in particular, to a virtual object rendering method and apparatus.
Background
In a virtual scene, in order to ensure the rendering effect of a virtual object, a model generally contains a large number of polygonal faces. However, as the number of facets increases, the resources required to render these models also increase significantly, resulting in reduced rendering efficiency. In the conventional method, the problem is usually solved by directly reducing the die surface number. Although the method can effectively reduce the occupation of resources in the rendering process, the method also causes serious loss of model details, and as a result, the rendered virtual object is not vivid enough and has influence on the overall image quality. Therefore, how to reduce the number of faces while keeping model details is a technical problem to be solved.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the application provides a virtual object rendering method and device, which at least solve the technical problem that the detail rendered under the condition of less used resources is poor when the virtual object is rendered.
According to an aspect of an embodiment of the present application, there is provided a virtual object rendering method including: acquiring a three-dimensional original grid model of a virtual object to be rendered, and converting the original grid model into a two-dimensional plane grid model by using a geometric processing method; determining a boundary box of the two-dimensional plane grid model, dividing the boundary box into a plurality of patches, and generating a patch model based on the patches; converting the patch model from two dimensions back to a three-dimensional model by using an intelligent recovery algorithm to obtain a three-dimensional reconstruction grid model; rendering the virtual object to be rendered based on the three-dimensional reconstructed mesh model.
According to another aspect of the embodiment of the present application, there is also provided a virtual object rendering apparatus, including: the system comprises an acquisition module, a geometric processing module and a rendering module, wherein the acquisition module is configured to acquire a three-dimensional original grid model of a virtual object to be rendered and convert the original grid model into a two-dimensional plane grid model by utilizing the geometric processing method; a generation module configured to determine a bounding box of the two-dimensional planar mesh model, divide the bounding box into a plurality of patches, and generate a patch model based on the plurality of patches; the reconstruction module is configured to convert the patch model from two dimensions back to a three-dimensional model by using an intelligent recovery algorithm to obtain a three-dimensional reconstruction grid model; a rendering module configured to render the virtual object to be rendered based on the three-dimensional reconstructed mesh model.
In the embodiment of the application, a three-dimensional original grid model of a virtual object to be rendered is obtained, and the original grid model is converted into a two-dimensional plane grid model by utilizing a geometric processing method; determining a boundary box of the two-dimensional plane grid model, dividing the boundary box into a plurality of patches, and generating a patch model based on the patches; converting the patch model from two dimensions back to a three-dimensional model by using an intelligent recovery algorithm to obtain a three-dimensional reconstruction grid model; the virtual object to be rendered is rendered based on the three-dimensional reconstruction grid model, and the technical problem that the detail rendered under the condition of less used resources is poor when the virtual object is rendered is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a flow chart of a method of rendering a virtual object according to an embodiment of the application;
FIG. 2 is a flow chart of another virtual object rendering method according to an embodiment of the application;
FIG. 3 is a flow chart of a method of acquiring an original three-dimensional mesh model and converting to a two-dimensional planar mesh model in accordance with an embodiment of the present application;
FIG. 4 is a flow chart of a method of determining bounding boxes of a two-dimensional planar mesh model and generating a patch model in accordance with an embodiment of the present application;
FIG. 5 is a flow chart of a method of converting a patch model from two dimensions back to a three-dimensional model in accordance with an embodiment of the present application;
FIG. 6 is a flow chart of another method of converting a patch model from two dimensions back to a three-dimensional model in accordance with an embodiment of the present application;
FIG. 7 is a flow chart of a method of identifying an interior surface in the two-dimensional patch model according to an embodiment of the present application;
Fig. 8 is a schematic structural view of a virtual object rendering apparatus according to an embodiment of the present application;
fig. 9 shows a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an embodiment of the present application, there is provided a virtual object rendering method, it being noted that the steps shown in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is shown in the flowchart, in some cases the steps shown or described may be performed in an order different from that herein.
Fig. 1 is a method for rendering a virtual object according to an embodiment of the present application, as shown in fig. 1, the method including the steps of:
Step S102, a three-dimensional original grid model of a virtual object to be rendered is obtained, and the original grid model is converted into a two-dimensional plane grid model by utilizing a geometric processing method.
Acquiring a three-dimensional original grid model of a virtual object to be rendered, selecting a projection mode, and projecting vertexes of the original grid model to a two-dimensional plane according to the selected projection mode; and connecting the projected vertexes into a patch, and generating the two-dimensional plane grid model. In this way, the resources required by rendering are effectively reduced, the main structure and details of the model are reserved, and the rendering efficiency and the image quality are improved.
Step S104, determining a boundary box of the two-dimensional plane grid model, dividing the boundary box into a plurality of patches, and generating a patch model based on the patches.
Determining minimum coordinates and maximum coordinates of all vertexes of the two-dimensional plane grid model, and determining the boundary frame based on the minimum coordinates and the maximum coordinates; adaptively dividing the boundary box into a plurality of patches with different sizes based on the distribution condition of the two-dimensional plane grid model; the patch model is generated based on a geometry and a position of each of the plurality of patches. According to the method, the rendering efficiency and the rendering precision are remarkably improved through self-adaptive segmentation and optimization of the two-dimensional plane grid model, meanwhile, model details are effectively reserved, the consumption of rendering resources is reduced, and the sense of reality and the vividness of the virtual object are improved.
And S106, converting the patch model from two dimensions back to a three-dimensional model by using an intelligent recovery algorithm to obtain a three-dimensional reconstruction grid model.
And deleting the inner face of the patch model by using an intelligent recovery algorithm. For example, analyzing the patch model using the smart restoration algorithm, identifying an interior face of the patch model, wherein the interior face is an interior structural face that does not affect appearance; the identified interior faces are deleted leaving only the exterior faces of the patch model. And based on the vertexes on the patch model from which the internal surface is deleted, carrying out internal surface repartition on the patch model from which the internal surface is deleted, and obtaining the three-dimensional reconstruction grid model. For example, all vertices are extracted from the patch model from which the internal surface is deleted, an adjacency graph of vertices is constructed based on the extracted vertices, and internal surface repartition is performed on the patch model from which the internal surface is deleted by using a triangulation algorithm based on the adjacency graph; and combining the repartitioned patches according to the topological relation to obtain the three-dimensional reconstruction grid model.
According to the application, the internal face of the patch model is deleted by utilizing the intelligent recovery algorithm, and is re-divided and rebuilt, so that the consumption of rendering calculation resources is effectively reduced, meanwhile, the appearance detail and structural integrity of the model are reserved, and the efficiency and the precision of the three-dimensional reconstruction grid model are improved.
And step S108, rendering the virtual object to be rendered based on the three-dimensional reconstruction grid model.
And finally rendering and outputting the processed three-dimensional reconstruction grid model to generate a high-quality rendering image or animation. This process includes frame buffering and color mixing to ensure that the final output meets the desired visual effect.
Fig. 2 is another virtual object rendering method according to an embodiment of the present application, as shown in fig. 2, the method includes the steps of:
Step S202, an original three-dimensional grid model is obtained and converted into a two-dimensional plane grid model.
As shown in fig. 3, the method for acquiring the original three-dimensional grid model and converting the original three-dimensional grid model into the two-dimensional planar grid model comprises the following steps:
In step S2022, the original mesh model is acquired.
A three-dimensional mesh model of the virtual object to be rendered is obtained from a stored or real-time data stream. The model contains geometric information and texture data of the virtual object. By acquiring the three-dimensional grid model from the stored or real-time data stream, the integrity and accuracy of the geometric information and texture data of the rendering object can be ensured, so that a necessary data basis is provided for subsequent conversion and processing, and the authenticity and detail richness of the final rendering effect are ensured.
In step S2024, a projection method is selected.
A projection mode, such as vertex projection or perspective projection, is selected. In this embodiment, a vertex projection mode is adopted, and all vertices of the original mesh model are projected to a two-dimensional plane according to a selected projection mode. By calculating the coordinates of each vertex on a two-dimensional plane. The selection of vertex projection in this embodiment can 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. Therefore, the projected two-dimensional plane grid model can reflect the structure and shape of the three-dimensional model more accurately, and the accuracy of subsequent processing is ensured.
In step S2026, a two-dimensional planar mesh model is generated.
And generating the surface patch from the projected vertexes according to the connection mode in the original grid model to form a two-dimensional plane grid model. For example, projected vertices are connected on a two-dimensional plane according to patches (polygons connected by vertices) in the original mesh model. The original topology is maintained to ensure that the two-dimensional planar mesh model correctly represents the geometric information of the original three-dimensional model. And constructing a two-dimensional plane grid model by the projected vertexes and the connection relation of the vertexes.
According to the application, the projected vertexes are connected in the surface patch connection mode in the original grid model to generate the surface patch, so that the two-dimensional plane grid model is formed, the consistency of the original geometry and the topological structure can be maintained, the calculation process is simplified, the processing efficiency is improved, and the follow-up operation and the visual display are convenient.
According to the method and the device, the projected two-dimensional plane grid model is generated according to the connection mode in the original grid model, so that the geometric and topological structure consistency of the original model can be maintained. Therefore, the calculation process is simplified, the accuracy of the representation of the model on a two-dimensional plane is ensured, and the follow-up operation and visual display are facilitated.
Step S204, determining a bounding box of the two-dimensional planar mesh model and generating a patch model.
As shown in fig. 4, the method of determining the bounding box of the two-dimensional planar mesh model and generating the patch model includes the steps of:
Step S2042, a bounding box is determined.
And finding out the minimum coordinates and the maximum coordinates of all the vertexes of the two-dimensional plane grid model, and calculating a boundary frame, wherein the boundary frame is a rectangular area surrounding the whole plane grid model. For example, the minimum and maximum coordinates are initialized, and the minimum and maximum coordinates are initialized to very large and very small values, respectively. Then, all vertices are traversed. Each vertex in the two-dimensional planar mesh model is examined one by one. For each vertex, its abscissa and ordinate are recorded and compared with the current minimum and maximum coordinates. If the abscissa of a vertex is less than the currently recorded minimum abscissa, the minimum abscissa is updated. Likewise, if the abscissa of a vertex is greater than the currently recorded maximum abscissa, the maximum abscissa is updated. The comparison and update procedure for the ordinate is the same. Finally, a bounding box is calculated. After the inspection and comparison of all vertices is completed, the minimum and maximum coordinates have been updated to the minimum and maximum values of all vertices in the mesh model. The two coordinate points may define a rectangular region, i.e. a bounding box. This bounding box can completely enclose the entire two-dimensional planar mesh model, ensuring that all vertices are contained. According to the method and the device, the range of the two-dimensional plane grid model can be defined through determining the boundary box, and all vertexes are guaranteed to be contained in the two-dimensional plane grid model, so that a foundation is provided for subsequent patch generation and optimization, the generated patches can be guaranteed to completely cover the model, and the integrity and the accuracy of the model are improved.
Step S2044, dividing the bounding box, and generating a patch.
In the grid segmentation, a dynamic adjustment method can be adopted to generate the patches adapting to the density change. The method comprises the following specific steps:
1) And (5) density mapping.
First, a density distribution is mapped to each region of the grid. The segmentation granularity for each region may be determined using the density value. For example, a density threshold may be set, when the density is above which the mesh is subdivided into more patches, and when the density is below which the mesh-divided patches are larger. In this embodiment, by mapping the density distribution to each region of the grid and determining the segmentation granularity according to the density value, the grid subdivision process can be adaptively optimized, so that the high-density region has more patches to capture details, and the low-density region uses 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.
2) And (5) subdividing the grids.
And subdividing the grid according to the density mapping result. In the high density region, finer meshes are achieved by increasing the number of patches and decreasing the size of the patches, which can better accommodate the details of the dense region. In contrast, in the low density region, the mesh is simplified by reducing the number of patches and increasing the size of the patches, thereby improving the calculation efficiency. According to the embodiment, the grid is subdivided according to the density mapping result, finer grids are realized by increasing the number of the patches in the high-density area and reducing the size of the patches, and the details of the dense area are better captured; the number of the patches is reduced and the size of the patches is increased in a low-density area, and the grid structure is simplified, so that the calculation efficiency is improved, the model is ensured to have detail expressive force and the overall performance is optimized.
3) And (5) dough sheet generation.
Patches are generated within each subdivided sub-grid. From the subdivided grid, a corresponding number and size of patches may be generated to accommodate the different density regions. The generation of the patches may be accomplished by triangular mesh, quadrilateral mesh, or other polygonal mesh methods. The embodiment can flexibly adapt to various geometric requirements by using a triangular grid, a quadrilateral grid or other polygonal grid methods, and improves the expressive force and the processing efficiency of the model.
4) And (5) optimizing and adjusting the dough sheet.
After the dough sheet is produced, the dough sheet is integrated. All the generated patches are integrated, ensuring that they can fully cover the bounding box and correctly represent the structure of the two-dimensional planar mesh model. The connection and alignment of the panels are checked and fine-tuned to ensure that the boundaries of the panels are smoothly connected, avoiding breakage or overlap. The method and the device can ensure smooth connection of the boundaries of the patches and avoid fracture or overlapping, so that the overall consistency and visual consistency of the model are improved.
Through the steps, the boundary frame can be adaptively segmented into a plurality of patches according to the distribution condition of the two-dimensional plane grid model, so that the geometric information and detail requirements of the model can be better adapted.
Step S2046, a patch model is generated.
1) The patch data is parsed and collected.
The vertex coordinates of each patch are obtained and their positions are recorded. Based on the vertex coordinates, the connection mode of the face sheets is determined. The normal vector for each patch is calculated from the vertex coordinates, which may be determined, for example, using the cross product of the vertex coordinates. In some embodiments, there is a texture mapping requirement, then the texture coordinates of each patch are obtained. Position adjustment is performed on each patch to ensure their correct position in the model, e.g. translating the vertex coordinates according to the position data of the patch, if the patch needs to be rotated, a rotation matrix is calculated and applied to the vertex coordinates; all processed patches are combined into one complete model, e.g. the vertex coordinates of all patches are combined into one vertex list, the normal vectors of all patches are combined, and in case texture is used, the texture coordinates of all patches are combined.
According to the method, the geometric information of the patches is extracted, the vertex coordinates of each patch are obtained, the positions of the vertex coordinates are recorded, the connection mode of the patches can be accurately determined, and the normal vector can be calculated. In case texture mapping is required, texture coordinates of the patch can also be obtained. By adjusting the position of each patch, such as translation and rotation, the correct position of each patch in the model is ensured, and all processed patches are integrated into a complete model, including the combination of vertex coordinates, normal vectors and texture coordinates, so that the geometric accuracy and visual effect of the model are ensured.
Step S206, converting the patch model from two dimensions back to three dimensions by using an intelligent recovery algorithm.
As shown in fig. 5, the method of converting the patch model from two dimensions back to three dimensional model comprises the steps of:
In step S2062, the inner face is deleted.
The internal faces in the patch model are identified and deleted using an intelligent restoration algorithm. The inner surface is a structural surface which does not affect the appearance. By identifying and deleting the internal surfaces in the patch model, the model structure can be simplified, redundant data can be reduced, so that the rendering efficiency of the model is improved, the consumption of computing resources is reduced, and the appearance and detail are ensured to be unchanged.
In step S2064, a vertex adjacency graph is constructed.
All remaining vertices are extracted from the patch model with the interior face deleted, and an adjacency graph is constructed based on the remaining vertices. Each vertex in the adjacency graph is connected to its neighboring vertices by an edge. For a three-dimensional model, adjacency graphs represent the topological relationship between vertices. Traversing all vertexes and establishing an adjacency graph according to the connection relation between the vertexes. Each vertex will have an edge connected to its neighboring vertex in the graph. The embodiment is helpful for ensuring the consistency and accuracy of the model structure and improving the quality of the final three-dimensional reconstruction.
In step S2066, triangulation is performed.
Triangulation is performed using the adjacency graph, dividing the patch model into triangular patches. Let the patch set be { T1, T2,..tm }, where each patch Ti is made up of three vertices. Each patch consists of three vertices v1, v2, v 3. The connection between vertices is represented by edges, and the collection of edges can be used to represent the topology of the patch. Each vertex is assigned a unique index for quick lookup and connection in subsequent steps. Let the vertex set be { V1, V2,..vn }, where each vertex Vi corresponds to a unique index i. An index is assigned to each edge, and two vertices of each edge are recorded. 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, a quick lookup and connection is ensured while clearly representing the topological relationship between the vertex and edge.
All generated triangular patches { T1, T2 were traversed, a. Tm, each patch is combined together in a topological relationship. For each patch Ti, its three vertices { v1, v2, v3} are added to the vertex list. If a vertex already exists, this step is skipped. The patch Ti and its vertex index are added to the patch list. When combining the patches, the shared edges between the patches are detected and processed. A shared edge is an edge that is common to both panels and can be used to ensure the consistency of the grid. For each patch edge, it is checked whether other patches also contain the edge. If present, the edges of the two patches are merged, ensuring the consistency of the grid. After merging the shared edges, redundant vertices, edges, and patches are further removed to improve the quality and efficiency of the mesh. The embodiment can ensure the consistency and consistency of the grids by traversing all the generated triangle patches and combining the triangle patches according to the topological relation. In addition, by checking and merging the shared edges, smooth connection between the patches is ensured, breakage and overlapping are avoided, and the quality and efficiency of the grid are optimized, so that the final model is more accurate and efficient.
A normal vector is computed for each patch to ensure that the model has the correct lighting effect when rendered. The normal vector is typically the normal vector of the patch, and can be calculated from the vertex coordinates. Texture is added to the model and the texture coordinates for each vertex are calculated. Texture coordinates may be used to map the image to the model surface to increase visual effects. According to the method and the device for calculating the normal vector of each patch, the accurate and true illumination effect of the model in rendering is ensured. And the normal vector is calculated through the vertex coordinates, so that the illumination calculation precision is optimized. And adding textures to the model and calculating the texture coordinates of each vertex, so that the image can be accurately mapped to the surface of the model, thereby enhancing the visual effect and enabling the final rendering result to have more detail and sense of reality.
And combining all the vertexes, edges and the surface patches into a final three-dimensional grid data structure to obtain the three-dimensional reconstruction grid model. The data structures may be object-oriented classes or may be in a data format required by a graphics API (e.g., openGL, directX, etc.). Further optimization is performed on the generated mesh, for example, repeated vertices are removed, common 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, which can form a complete three-dimensional reconstructed mesh model. In this way, the data formats required by the object-oriented class or graphics APIs (e.g., openGL, directX, etc.) may be accommodated. By further optimizing the generated grid, such as removing repeated vertices, merging common edges and smoothing the grid surface, the visual effect and the expression quality of the model can be remarkably improved, and more real and detailed rendering results are ensured.
Step S208, rendering the virtual object based on the three-dimensional reconstruction grid model.
An appropriate rendering engine is selected (e.g., openGL, directX, unity, unreal Engine). The rendering pipeline is set up, including stages of vertex shading, rasterization, fragment shading, and the like. Post-processing effects (e.g., antialiasing, depth of field, color correction) are applied to improve image quality.
The embodiment of the application also provides a method for converting a two-dimensional patch model into a three-dimensional model, as shown in fig. 6, comprising the following steps:
step S602, identifying an internal surface in the two-dimensional patch model, and deleting the internal surface from the patch model.
As shown in fig. 7, the method of identifying the internal face in the two-dimensional patch model includes the steps of:
Step S6022, determining the directivity of the sides.
First, edge vectorization. For each edge, a direction may be determined using a counter-clockwise direction (left hand rule), typically selecting the smallest vertex as a starting point to normalize the direction, and then determining the normal vector of the patch based on the direction of the edge.
Step S6024, internal face recognition.
Dividing a two-dimensional plane of the patch model according to the scanning lines, counting the intersection points of each scanning line and the normal vector, constructing an intersection point list, and judging the areas inside and outside the scanning lines. Finally, the intersection points are ordered according to the scanning line direction. The area between the intersections is marked as the inner face.
Step S604 constructs an adjacency graph based on the patch model from which the internal surface is deleted.
All remaining vertices are extracted from the patch model with the interior face deleted, and an adjacency graph is constructed based on the remaining vertices. Each vertex in the adjacency graph is connected to its neighboring vertices by an edge. For a three-dimensional model, adjacency graphs represent the topological relationship between vertices. Traversing all vertexes and establishing an adjacency graph according to the connection relation between the vertexes. Each vertex will have an edge connected to its neighboring vertex in the graph. The embodiment is helpful for ensuring the consistency and accuracy of the model structure and improving the quality of the final three-dimensional reconstruction.
Step S606, triangulating the patch model with the internal surface deleted based on the adjacency graph, and converting the patch model into a three-dimensional reconstruction grid model.
1) Unique indexes are assigned to vertices and edges.
Each vertex is assigned a unique index and an index table is built for quick lookup and concatenation. Each edge is assigned a unique index and an edge index table is constructed to represent the topological relationship between vertices.
2) Triangulating is performed based on the adjacency graph.
Traversing the set of patches, adding the three vertices of each patch to a vertex list. It is checked whether each vertex is already present in the list of vertices and if not, it is added. The index information of the patches and their vertices is recorded to ensure that each patch is stored correctly.
Based on the adjacency graph, these vertices and edges are divided into a set of non-overlapping triangles, and the resulting triangles satisfy certain geometric constraints, such as maximizing minimum angles to avoid elongated triangles, thereby improving mesh quality. Finally, the obtained triangular mesh model not only can better represent the original geometric shape, but also can provide an efficient numerical calculation basis in the fields of computer graphics, finite element analysis and the like.
3) Detecting and processing shared edges
Traversing the edge of each patch, checking whether other patches also contain the edge, and identifying the shared edge. The patches containing the shared edges are combined, so that the consistency and consistency of grids are ensured, and the fracture and overlapping in the topological structure are avoided.
4) Removing redundant vertices and edges
Traversing the vertices and edges, detecting redundant vertices and edges, and removing the duplicate elements. And updating the indexes of the vertexes and the edges, removing redundant items, and improving the quality and the calculation efficiency of the grid.
5) Construction of three-dimensional reconstruction grid model
And combining the optimized vertexes, edges and patches into a complete 3D grid model, and ensuring the integrity of the topological structure. And a smoothing algorithm is applied to optimize the surface quality of the grid and reduce unnecessary sharp points and abrupt changes.
The application also provides a virtual object rendering device, as shown in fig. 8, comprising: an acquisition module 82 configured to acquire a three-dimensional original mesh model of a virtual object to be rendered, and to convert the original mesh model into a two-dimensional planar mesh model using a geometric processing method; a generation module 84 configured to determine a bounding box of the two-dimensional planar mesh model, divide the bounding box into a plurality of patches, and generate a patch model based on the plurality of patches; a reconstruction module 86 configured to convert the patch model from two dimensions back to a three-dimensional model using a machine learning based intelligent recovery algorithm, resulting in a three-dimensional reconstructed mesh model; a rendering module 88 configured to render the virtual object to be rendered based on the three-dimensional reconstructed mesh model.
It should be noted that: the virtual object rendering device provided in the above embodiment is only exemplified by the division of the above functional modules, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the virtual object rendering device and the virtual object rendering method provided in the foregoing embodiments belong to the same concept, and detailed implementation processes of the virtual object rendering device and the virtual object rendering method are shown in the method embodiments, and are not repeated herein.
Fig. 9 shows a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure. It should be noted that the electronic device shown in fig. 9 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present disclosure.
As shown in fig. 9, the electronic apparatus includes a Central Processing Unit (CPU) 1001 that 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 section 1008 into a Random Access Memory (RAM) 1003. In the RAM 1003, various programs and data required for system operation are also stored. The CPU1001, ROM 1002, and RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
The following components are connected to the I/O interface 1005: an input section 1006 including a keyboard, a mouse, and the like; an output portion 1007 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; a storage portion 1008 including a hard disk or the like; and a communication section 1009 including a network interface card such as a LAN card, a modem, or the like. The communication section 1009 performs communication processing via a network such as the internet. The 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, or the like, is installed as needed in the drive 1010, so that a computer program read out therefrom is installed as needed in the storage section 1008.
In particular, according to embodiments of the present disclosure, the processes described below with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 1009, and/or installed from the removable medium 1011. When being executed by a Central Processing Unit (CPU) 1001, performs the various functions defined in the method and apparatus of the present application. In some embodiments, the electronic device may further include an AI (ARTIFICIAL INTELLIGENCE ) processor for processing computing operations related to machine learning.
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 two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
As another aspect, the present application also provides a computer-readable medium that may be contained in the electronic device described in the above embodiment; or may exist alone without being incorporated into the electronic device.
The computer-readable medium carries one or more programs which, when executed by one of the electronic devices, cause the electronic device to implement the methods described in the embodiments below. For example, the electronic device may implement the steps of the method embodiments described above, and so on.
As another aspect, the present application also provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor. The memory stores a computer program executable by the at least one processor, which when executed by the at least one processor is adapted to cause an electronic device to perform a method of an embodiment of the application.
As another aspect, the present application also provides a computer program product comprising a computer program, wherein the computer program, when being executed by a processor of a computer, is for causing the computer to perform the method of the embodiments of the present application.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, for example, may be a logic function division, and may be implemented in another manner, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application, which are intended to be comprehended within the scope of the present application.

Claims (10)

Translated fromChinese
1.一种虚拟对象的渲染方法,其特征在于,包括:1. A method for rendering a virtual object, comprising:获取待渲染的虚拟对象的三维的原始网格模型,并利用几何处理方法将所述原始网格模型转换为二维平面网格模型;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.根据权利要求1所述的方法,其特征在于,利用几何处理方法将所述原始网格模型转换为二维平面网格模型,包括: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, comprising:选择投影方式,根据所选投影方式,将所述原始网格模型的顶点投影到二维平面;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.根据权利要求1所述的方法,其特征在于,确定所述二维平面网格模型的边界框,3. The method according to claim 1, characterized in that the bounding box of the two-dimensional plane mesh model is determined,将所述边界框分割为多个面片,并基于所述多个面片生成面片模型,包括: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.根据权利要求1所述的方法,其特征在于,利用智能恢复算法,将所述面片模型从二维转换回三维模型,得到三维重建网格模型,包括: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, comprising:利用智能恢复算法,删除所述面片模型的内部面;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.根据权利要求4所述的方法,其特征在于,利用智能恢复算法,删除所述面片模型的内部面,包括:5. The method according to claim 4, characterized in that deleting the internal surface of the patch model by using an intelligent recovery algorithm comprises:使用所述智能恢复算法分析所述面片模型,识别出所述面片模型的内部面,其中,所述内部面是不影响外观的内部结构面;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.根据权利要求4所述的方法,其特征在于,基于删除了所述内部面的所述面片模型上的顶点,对删除了所述内部面的所述面片模型进行内部面重新划分,得到所述三维重建网格模型,包括:6. The method according to claim 4, characterized in that, based on the vertices on the patch model with the internal faces deleted, re-dividing the internal faces of the patch model with the internal faces deleted to obtain the three-dimensional reconstructed mesh model comprises:从删除了所述内部面的所述面片模型中提取所有顶点,基于所提取的顶点构建顶点的邻接图,并基于所述邻接图利用三角剖分算法对删除了所述内部面的所述面片模型进行内部面重新划分;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.一种虚拟对象的渲染装置,其特征在于,包括:7. A virtual object rendering device, comprising:获取模块,被配置为获取待渲染的虚拟对象的三维的原始网格模型,并利用几何处理方法将所述原始网格模型转换为二维平面网格模型;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.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括存储的程序,其中,在所述程序运行时控制所述计算机可读存储介质所在设备执行权利要求1至6中任意一项所述的方法。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.一种计算机设备,其特征在于,包括:存储器和处理器,9. A computer device, comprising: a memory and a processor,所述存储器存储有计算机程序;The memory stores a computer program;所述处理器,用于执行所述存储器中存储的计算机程序,所述计算机程序运行时使得所述处理器执行权利要求1至6中任意一项所述的方法。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.一种计算机程序产品,包括计算机程序,其特征在于,该计算机程序被处理器执行时实现权利要求1至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.
CN202411027389.9A2024-07-302024-07-30 Method and device for rendering virtual objectsPendingCN118967902A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202411027389.9ACN118967902A (en)2024-07-302024-07-30 Method and device for rendering virtual objects

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202411027389.9ACN118967902A (en)2024-07-302024-07-30 Method and device for rendering virtual objects

Publications (1)

Publication NumberPublication Date
CN118967902Atrue CN118967902A (en)2024-11-15

Family

ID=93384587

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202411027389.9APendingCN118967902A (en)2024-07-302024-07-30 Method and device for rendering virtual objects

Country Status (1)

CountryLink
CN (1)CN118967902A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN120279198A (en)*2025-06-112025-07-08上海易迪尔信息技术有限公司Digital twin body construction method and system applied to customs supervision

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN120279198A (en)*2025-06-112025-07-08上海易迪尔信息技术有限公司Digital twin body construction method and system applied to customs supervision

Similar Documents

PublicationPublication DateTitle
CN113178014B (en)Scene model rendering method and device, electronic equipment and storage medium
ZachFast and high quality fusion of depth maps
JP5120926B2 (en) Image processing apparatus, image processing method, and program
CN100583084C (en)Triangulating procedural geometric objects
US8711143B2 (en)System and method for interactive image-based modeling of curved surfaces using single-view and multi-view feature curves
Sigg et al.Signed distance transform using graphics hardware
CN103559374B (en)A kind of method carrying out face disintegrated type surface subdivision on plurality of subnets lattice model
CN114820906A (en)Image rendering method and device, electronic equipment and storage medium
CN102184522A (en)Vertex data storage method, graphic processing unit and refiner
CN101599181B (en) A real-time rendering method of algebraic B-spline surface
CN116051708A (en)Three-dimensional scene lightweight model rendering method, equipment, device and storage medium
JP2011238213A (en)Hierarchical bounding of displaced parametric curves
CN113012269A (en)Three-dimensional image data rendering method and equipment based on GPU
CN110298922B (en)Three-dimensional model simplification method, device and equipment
JP2015515059A (en) Method for estimating opacity level in a scene and corresponding apparatus
US11087511B1 (en)Automated vectorization of a raster image using a gradient mesh with arbitrary topology
CN106228594A (en)Typhoon model cloud cartoon display method based on surface subdivision
CN114581596B (en) A fast rendering method of geometric shapes based on GPU driver
CN112509108A (en)GPU-based vertex ambient light shading generation method and image rendering method
CN118967902A (en) Method and device for rendering virtual objects
CN118644605A (en) 3D Gaussian-based inverse rendering method, device, equipment and storage medium
JP4165695B2 (en) Computer program for expressing non-manifold implicit functions
CN119445006B (en) Three-dimensional digital content generation method, device, system, equipment, medium and product
Liu et al.Point2Building: Reconstructing buildings from airborne LiDAR point clouds
Xiong et al.ETER: Elastic Tessellation for Real-Time Pixel-Accurate Rendering of Large-Scale NURBS Models

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp