A method, apparatus and storage medium for simplifying a three-dimensional model
By converting the 3D model into a set of connected graphs, determining simplification weights based on the properties and topological information of the triangular facets, and gradually removing edges, the problem of topological structure destruction during the 3D model simplification process is solved, achieving efficient 3D model simplification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ARCSOFT CORP LTD
- Filing Date
- 2023-11-29
- Publication Date
- 2026-05-19
AI Technical Summary
In existing technologies, 3D model simplification algorithms are prone to triangle degradation, which can damage the original model's topological structure.
By transforming the mesh of the 3D model into a set of multiple connected graphs, the simplification weights of the triangle edges are determined based on the vertex attributes and topological information of the triangle patches. Edges to be simplified are then deleted, and the model is gradually simplified to ensure the integrity of the model's topological structure.
This effectively avoids triangle degradation, ensuring that the simplified 3D model maintains the original model topology and reduces computational and storage requirements.
Smart Images

Figure CN117994478B_ABST
Abstract
Description
Technical Field
[0001] This article relates to three-dimensional data processing technology, and in particular to a method, apparatus and storage medium for simplifying three-dimensional models. Background Technology
[0002] 3D models offer a better sense of depth and realism compared to 2D models, but they also generate a massive amount of data. This vast amount of 3D data poses a significant challenge to a computer's computing, display, and storage capabilities. Simplifying 3D models while still meeting the requirements for rendering and simulation can reduce the amount of storage space required and accelerate computer processing.
[0003] In existing technologies, vertex clustering algorithms used to simplify 3D models are prone to triangle degradation, which can damage the original model topology. Summary of the Invention
[0004] This application provides a method, apparatus, and storage medium for simplifying a three-dimensional model, which can ensure that the simplified three-dimensional model still maintains the original model topology.
[0005] This application provides a method for simplifying a three-dimensional model, the method comprising:
[0006] The mesh of the 3D model is transformed into multiple sets of connected graphs, wherein each set of connected graphs includes multiple connected graphs;
[0007] For each of the connected graphs, the simplified weights of the triangle edges of all triangles in the connected graph are determined based on the vertex attributes of the triangles in the connected graph and the topological information of the triangles in the connected graph.
[0008] Among the triangular edges of all triangular patches, the edges to be simplified are determined based on the simplification weights of all triangular edges and the basic simplification error, and the 3D model is simplified based on the edges to be simplified.
[0009] As an exemplary embodiment, determining the simplified weights of the triangle edges of all triangles in the connected graph based on the vertex attributes and topological information of the triangles in the connected graph includes:
[0010] Based on the number of vertex attributes of the triangle edges in the connected graph, the correspondence of vertex attributes between the two vertices of the triangle edges, and the number of adjacent triangle faces of the triangle edges, the simplified weights of the triangle edges of all triangle faces are determined.
[0011] As an exemplary embodiment, determining the simplified weights of the triangle edges of all triangles in the connected graph based on the vertex attributes and topological information of the triangles in the connected graph includes:
[0012] Based on the vertex attributes of the triangular facets in the connected graph and the topological information of the triangular facets in the connected graph, determine the type of the triangle edges of each triangular facet;
[0013] The simplified weight of each triangle edge is determined based on its type.
[0014] As an exemplary embodiment, determining the type of the triangle edges of each triangle facet based on the vertex attributes of the triangle facets in the connected graph and the topological information of the triangle facets in the connected graph includes:
[0015] The type of triangle edge for each triangle is determined based on the number of vertex attributes of the triangle edge in the connected graph, the correspondence of vertex attributes between two vertices of the triangle edge, and the number of adjacent triangle faces of the triangle edge.
[0016] As an exemplary embodiment, determining the type of the triangle edge of each triangle facet based on the number of vertex attributes of the triangle edge in the connected graph, the correspondence of vertex attributes between two vertices of the triangle edge, and the number of adjacent triangle faces of the triangle edge includes:
[0017] If a triangle has only one adjacent triangular facet, then the triangle is determined to be a physical edge.
[0018] If a triangle has two adjacent triangular faces and both vertices of the triangle have a set of vertex attributes, then the triangle is determined to be a simplified edge.
[0019] If a triangle edge has two adjacent triangular faces, and each of the two vertices of the triangle edge has multiple sets of vertex attributes, and the multiple sets of vertex attributes can correspond sequentially in both geometric topology and texture topology, then the triangle edge is determined to be a texture edge.
[0020] If a triangle has two adjacent triangular faces, and each of the two vertices of the triangle has multiple sets of vertex attributes, and the multiple sets of vertex attributes cannot correspond sequentially in the geometric topology and texture topology, then the triangle is determined to be a pivot edge.
[0021] As an exemplary embodiment, determining the simplified weight of the corresponding triangle side based on the type of each triangle side includes:
[0022] When the triangle edge is a simplified edge or a textured edge, the simplification weight of the triangle edge is within the first weight range;
[0023] When the triangle sides are physical sides, the simplified weights of the triangle sides are within the second weight range;
[0024] When the triangle's edge is a pivot edge, the simplified weight of the triangle's edge is within the third weight range;
[0025] The simplification weights of the simplified edges and texture edges are higher than the simplification weights of the physical edges, and the simplification weights of the physical edges are higher than the simplification weights of the hub edges.
[0026] As an exemplary embodiment, the simplified weight of the physical edge is determined according to a preset coefficient and a proportional coefficient, wherein the proportional coefficient is determined according to the proportion of the physical edge among all triangle edges in the connected graph to which the physical edge belongs.
[0027] As an exemplary embodiment, the basic simplification error of the triangle sides includes at least a geometric error; the method for calculating the geometric error includes:
[0028] For each set of connected graphs, a directed distance field is generated based on the vertex geometry information and the geometric topology of the triangular facets contained in the set of connected graphs.
[0029] The directed distance fields of all connected graph sets other than the set to which the triangle edge belongs are used as constraints for solving the quadratic error metric matrix of the geometric error.
[0030] Solve the quadratic error metric matrix under the given constraints to obtain the geometric error of the triangle's sides.
[0031] As an exemplary embodiment, the basic simplification error of the triangle side further includes at least one or more of the following: normal error, texture coordinate error, and tangent error.
[0032] As an exemplary embodiment, after simplifying the 3D model based on the edges to be simplified, the method further includes:
[0033] Based on the change in the included angle of the second-order adjacent faces of the simplified target vertex corresponding to the edge to be simplified, determine whether the triangular facets will fold after simplification.
[0034] In the event of triangular facet folding, restore the simplified edge that was replaced by the target vertex and the vertex attributes of the simplified edge, and increase the simplification weight and / or basic simplification error of the simplified edge.
[0035] As an exemplary embodiment, determining whether triangular facet folding occurs after simplification based on the change in the included angle of the second-order adjacent faces of the simplified target vertex corresponding to the edge to be simplified includes:
[0036] If the change in the included angle is greater than or equal to the included angle threshold, it is determined that a triangular facet folds after simplification.
[0037] As an exemplary embodiment, before determining the simplified weights of the triangle edges of all triangles in the connected graph based on the vertex attributes and topological information of the triangles in the connected graph for each of the connected graphs, the method further includes:
[0038] In the set of all connected graphs, each connected graph whose number of triangles is less than or equal to a preset threshold for the number of triangles is selected as a candidate connected graph.
[0039] The following steps are performed iteratively: In all the latest candidate connected graphs, the connected graph with the smallest weight is deleted as the target connected graph, and the preset triangle number threshold is updated according to the number of triangles in the target connected graph; new candidate connected graphs are selected from the remaining candidate connected graphs according to the updated preset triangle number threshold, until no candidate connected graphs are available.
[0040] As an exemplary embodiment, the preset threshold for the number of triangular facets is determined based on the total number of triangular facets in the three-dimensional model, the target simplification ratio of the three-dimensional model, and the coarse simplification ratio.
[0041] As an exemplary embodiment, the method for calculating the weights of the connected graph includes:
[0042] For each of the connected graphs, the connected graph weight in its set of connected graphs is determined based on the weight parameters of the connected graph, wherein the weight parameters include one or more of the following: the area of the connected graph, the sum of all vertex voxels, the number of vertices, and the number of triangles.
[0043] As an exemplary embodiment, determining the connection graph weight of the connected graph in its set of connected graphs based on the weight parameters of the connected graph includes:
[0044] For any type of weight parameter value of the connected graph, determine the proportion of the weight parameter value among the weight parameter values of all connected graphs included in the corresponding connected graph set;
[0045] Normalize the proportions of all types of weight parameter values;
[0046] The weights of the connected graph are determined based on the proportions of all types of weight parameter values after normalization.
[0047] As an exemplary embodiment, determining the edge to be simplified based at least on the simplification weights of all triangle edges and the basic simplification error includes:
[0048] The target simplification error of the corresponding triangle edge is determined based on the simplification weight of each triangle edge, the basic simplification error of each triangle edge, and the connected graph weight of the connected graph to which each triangle edge belongs.
[0049] The side to be simplified is determined based on the target simplification error of all triangle sides.
[0050] As an exemplary embodiment, before simplifying the 3D model based on the edges to be simplified, the method further includes:
[0051] Determine the skeletal binding data and / or deformation animation data of the target vertex, wherein the target vertex is used to replace the edge to be simplified.
[0052] As an exemplary embodiment, the determination of the skeletal binding data of the target vertex includes:
[0053] Based on the distances between the target vertex and the two vertices of the edge to be simplified, determine the initial weights between the skeletal points corresponding to the two vertices and the target vertex;
[0054] The weights between the target vertex and each bone point are determined based on the initial weights, the index weights of the two vertices corresponding to each bone point, and the binding weights of the two vertices corresponding to each bone point.
[0055] Based on the weight between the target vertex and each bone point, a preset number of bone points are selected as the bone binding data for the target vertex.
[0056] As an exemplary embodiment, the deformation animation data for determining the target vertex includes:
[0057] Overlay deformation animation data onto all vertices of the adjacent triangle facets of the edge to be simplified to obtain the updated edge of the adjacent triangle facets;
[0058] Simplified vertices with deformation animation data are generated based on the edges of the updated adjacent triangles;
[0059] The deformation animation data of the target vertex is determined based on the data difference between the target vertex and the simplified vertex.
[0060] As an exemplary embodiment, the step of converting the mesh of the 3D model into a set of multiple connected graphs includes:
[0061] Remove non-two-dimensional manifold meshes from the three-dimensional model and retain the two-dimensional manifold meshes;
[0062] The two-dimensional manifold mesh in the three-dimensional model is transformed into a set of multiple connected graphs.
[0063] The simplification device for three-dimensional models provided in this application embodiment includes:
[0064] The transformation module is configured to transform the mesh of a 3D model into multiple sets of connected graphs, wherein each set of connected graphs includes multiple connected graphs;
[0065] The determination module is configured to, for each connected graph, determine the simplified weights of the triangle edges of all triangles in the connected graph based on the vertex attributes of the triangles in the connected graph and the topological information of the triangles in the connected graph.
[0066] The simplification module is configured to determine the edges to be simplified from the triangle edges of all triangle patches based on the simplification weights of all triangle edges and the basic simplification error, and to simplify the 3D model based on the edges to be simplified.
[0067] The computer-readable storage medium provided in the embodiments of this application stores one or more programs, which can be executed by one or more processors to implement the methods described in any of the preceding embodiments.
[0068] The simplification device for three-dimensional models provided in this application includes a memory and a processor. The memory stores a program, which, when read and executed by the processor, implements the method described in any of the previous embodiments.
[0069] Compared with related technologies, the technical solution described in this application simplifies the 3D model by deleting the edges to be simplified; and when determining the simplified edges, the vertex attributes and topological information of the triangular facets are considered. The importance of all triangle edges is determined by the vertex attributes and topological information of the triangular facets, thereby simplifying the 3D model step by step according to the importance of the triangle edges. This avoids the clustering and collapse of vertices during the simplification process, solves the problem that vertex clustering algorithms can easily cause triangle degradation and destroy the original model topology, and ensures that the simplified 3D model can still maintain the original model topology.
[0070] Other features and advantages of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the application. Other advantages of this application can be realized and obtained by means of the solutions described in the description and the accompanying drawings. Attached Figure Description
[0071] The accompanying drawings are used to provide an understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0072] Figure 1 A simplified flowchart of the method for creating a three-dimensional model as provided in the embodiments of this application;
[0073] Figure 2A A schematic diagram of the geometric topology of a triangular facet provided in an embodiment of this application;
[0074] Figure 2B A schematic diagram of the texture topology of a triangular facet provided in an embodiment of this application;
[0075] Figure 3A A simplified edge diagram provided for an embodiment of this application;
[0076] Figure 3B A schematic diagram of a textured edge provided for an embodiment of this application;
[0077] Figure 3C A schematic diagram of a hub edge provided in an embodiment of this application;
[0078] Figure 3D A schematic diagram of a physical edge provided for an embodiment of this application;
[0079] Figure 4A This is a simplified connected graph diagram provided in an embodiment of this application;
[0080] Figure 4B A simplified connected graph diagram provided in this application embodiment;
[0081] Figure 5 A simplified 3D model provided in the embodiments of this application is shown in a folded diagram;
[0082] Figure 6 A schematic diagram illustrating how the skeleton binding data changes after the triangular facet changes, as provided in the embodiments of this application.
[0083] Figure 7 A flowchart illustrating the deformation animation data for determining a target vertex, provided in an embodiment of this application;
[0084] Figure 8 A simplified device structure diagram of the three-dimensional model provided in the embodiments of this application;
[0085] Figure 9 A simplified device structure diagram of another three-dimensional model provided for an embodiment of this application. Detailed Implementation
[0086] This application describes several embodiments, but these descriptions are exemplary and not restrictive, and it will be apparent to those skilled in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with, or may replace, any feature or element of any other embodiment.
[0087] This application includes and contemplates combinations of features and elements known to those skilled in the art. The embodiments, features, and elements disclosed in this application may also be combined with any conventional features or elements to form a unique inventive scheme as defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other inventive schemes to form another unique inventive scheme as defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in this application may be implemented individually or in any suitable combination. Therefore, the embodiments are not limited except by the limitations imposed by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.
[0088] Furthermore, in describing representative embodiments, the specification may have presented methods and / or processes as a specific sequence of steps. However, the method or process should not be limited to the specific order of steps described herein, to the extent that it does not depend on such a specific order. As will be understood by those skilled in the art, other sequences of steps are also possible. Therefore, the specific order of steps set forth in the specification should not be construed as a limitation of the claims. Moreover, the claims concerning the method and / or process should not be limited to the steps performed in the written order, and those skilled in the art will readily understand that these orders can be varied and still remain within the spirit and scope of the embodiments of this application.
[0089] This application provides a method for simplifying three-dimensional models, such as... Figure 1 As shown, the method includes:
[0090] Step S101: The mesh of the 3D model is converted into multiple sets of connected graphs; wherein each set of connected graphs includes multiple connected graphs.
[0091] In scenarios such as virtual character creation and animation production, a 3D model composed of multiple triangular facets can be used to represent people or objects in a scene. When simplifying a 3D model, it can be divided into multiple mesh sets, and simplification can be performed on each mesh set separately. For example, in a 3D character model, the body, hair, face, upper garment, and pants are different mesh sets. For example, in the embodiments of this application, a mesh set can be further transformed into a connected graph set, that is, a mesh set includes multiple connected graphs, and a connected graph includes multiple triangular facets.
[0092] A connected graph means that there must be a path between any two vertices in the graph.
[0093] Step S102: For each connected graph, based on the vertex attributes of the triangle facets in the connected graph and the topological information of the triangle facets in the connected graph, determine the simplified weights of the triangle edges of all triangle facets in the connected graph.
[0094] The vertex attributes include one or more of the following: texture coordinates, normals, tangents, and colors, where texture coordinates refer to the mapping relationship between vertices and texture maps;
[0095] The topological information of the triangular facets includes: geometric topology and texture topology; the geometric topology refers to the logical relationship of the triangular facets formed by the vertices of the three-dimensional space coordinates in the model; the texture topology refers to the logical relationship of the triangular facets formed by the vertices in the two-dimensional texture space. Figure 2A As an example of the geometric topology of a triangular facet, a square is composed of two triangular facets, and the vertices of the two triangular facets that make up the square are logically geometrically topological. Figure 2B This is an example of a texture topology for triangular facets. Texture topology refers to the logical relationships between these vertices forming triangular facets in a two-dimensional texture space, such as... Figure 2B In this context, since each vertex may correspond to multiple texture coordinates, the texture topology may not necessarily correspond completely to the geometric topology. A connected geometric topology may have a disconnected texture topology.
[0096] The vertex attributes and topological information of a triangle can reflect the complexity of its relationship with other surrounding triangles. This complexity can then be used to determine the triangle's weight during the simplification process—the simplification weight. For example, triangles with lower complexity have higher simplification weights.
[0097] Step S103: Among the triangular edges of all triangular patches, determine the edges to be simplified based on at least the simplification weights of all triangular edges and the basic simplification error; simplify the three-dimensional model based on the edges to be simplified.
[0098] For example, as mentioned earlier, each triangle facet has a corresponding simplification weight for its triangle edge; and the basic simplification error of the triangle edge is determined based on the error that occurs during the simplification process according to its own attribute characteristics, which include the normal error, texture coordinate error, color error, etc. of the triangle edge during the simplification process.
[0099] In this embodiment, one or more triangle edges are selected as edges to be simplified based on the simplification weight of each triangle edge and the magnitude of the basic simplification error. There is no limit to the number of edges to be simplified. For example, a higher simplification weight indicates a higher priority for deletion.
[0100] In this embodiment, the 3D model can be simplified by deleting the edges to be simplified. The 3D model simplification method described in this application considers the vertex attributes and topological information of the triangular facets when determining the simplified edges. Then, the importance of all triangle edges is determined by the vertex attributes and topological information of the triangular facets. The 3D model is then gradually simplified according to the importance of the triangle edges, avoiding the aggregation and collapse of vertices during the simplification process. This solves the problem that vertex clustering algorithms can easily cause triangle degradation and destroy the original model topology, ensuring that the simplified 3D model can still maintain the original model topology.
[0101] In an exemplary embodiment, determining the simplified weights of the triangular edges of all triangular faces in the connected graph based on the vertex attributes and topological information of the triangular faces in the connected graph includes:
[0102] Based on the number of vertex attributes of the triangle edges in the connected graph, the correspondence of vertex attributes between the two vertices of the triangle edges, and the number of adjacent triangle faces of the triangle edges, the simplified weights of the triangle edges of all triangle faces are determined.
[0103] For example, the importance of a triangle edge is determined based on the number of vertex attributes of the triangle edge in the connected graph, the correspondence of vertex attributes between two vertices of the triangle edge, and the number of adjacent triangle faces of the triangle edge. The lower the importance of the triangle edge, the greater its simplification weight, and the greater the probability that the triangle edge will be simplified; conversely, the higher the importance of the triangle edge, the smaller its simplification weight, and the lower the probability that the triangle edge will be simplified.
[0104] For example, the importance of a triangle edge is determined based on the number of vertex attributes of the triangle edge in the connected graph, the correspondence of vertex attributes between two vertices of the triangle edge, and the number of adjacent triangle faces of the triangle edge, including at least one of the following:
[0105] The fewer the number of vertex attributes of the triangle's sides, the lower the importance of the triangle's sides;
[0106] The more the vertex attributes of the two vertices of the triangle edge correspond in the topological information of the triangle facet they belong to, the lower the importance of the triangle edge.
[0107] The fewer the number of adjacent triangular faces of a triangle's edge, the lower the importance of that triangle's edge.
[0108] In practice, the importance of a triangle edge can be determined by comprehensively considering the number of vertex attributes of the triangle edge, the correspondence of the vertex attributes of the two vertices of the triangle edge in the topological information of the triangle facet in which they are located, and the number of adjacent triangle facets of the triangle edge.
[0109] In an exemplary embodiment, determining the simplified weights of the triangle edges of all triangles in the connected graph based on the vertex attributes and topological information of the triangles in the connected graph includes:
[0110] Based on the vertex attributes and topological information of the triangular facets in the connected graph, the type of triangle edge of each triangular facet is determined. In this embodiment, the type of triangle edge may include: physical edge, simplified edge, texture edge, or hub edge. The vertex attributes and topological information of the triangular facets containing each type of triangle edge are different, so the type of triangle edge of the triangular facet can be determined based on the vertex attributes and topological information of the triangular facet.
[0111] The simplified weight of each triangle edge is determined based on its type.
[0112] Different types of triangles have different degrees of importance for their sides, so the simplified weights of the triangle sides can be determined based on their type.
[0113] In this embodiment, the type of triangle side is determined first, and then the corresponding simplified weight is determined based on the type of triangle side, which is more feasible.
[0114] In an exemplary embodiment, determining the type of the triangle edges of each triangle facet based on the vertex attributes and topological information of the triangle facets in the connected graph includes:
[0115] The type of triangle edge for each triangle is determined based on the number of vertex attributes of the triangle edge in the connected graph, the correspondence of vertex attributes between two vertices of the triangle edge, and the number of adjacent triangle faces of the triangle edge.
[0116] For example, the number of vertex attributes of a triangle edge, the correspondence of vertex attributes between two vertices of a triangle edge, and the number of adjacent triangle faces are constrained to each other. The type of triangle edge can be determined based on the number of vertex attributes of a triangle edge, the correspondence of vertex attributes between two vertices of a triangle edge, the number of adjacent triangle faces, and the constrained relationship.
[0117] In an exemplary embodiment, determining the type of triangle edge for each triangle facet based on the number of vertex attributes of the triangle edge in the connected graph, the correspondence of vertex attributes between two vertices of the triangle edge, and the number of adjacent triangle faces of the triangle edge includes:
[0118] If a triangle has only one adjacent triangular facet, then the triangle is determined to be a physical edge.
[0119] If a triangle has two adjacent triangular faces and both vertices of the triangle have a set of vertex attributes, then the triangle is determined to be a simplified edge.
[0120] If a triangle edge has two adjacent triangular faces, and each of the two vertices of the triangle edge has multiple sets of vertex attributes, and the multiple sets of vertex attributes can correspond sequentially in both geometric topology and texture topology, then the triangle edge is determined to be a texture edge.
[0121] If a triangle has two adjacent triangular faces, and each of the two vertices of the triangle has multiple sets of vertex attributes, and the multiple sets of vertex attributes cannot correspond sequentially in the geometric topology and texture topology, then the triangle is determined to be a pivot edge.
[0122] Figures 3A-3D Examples of simplified edges, textured edges, pivot edges, and physical edges are given respectively. Figure 3A The simplified edge AB shown has two adjacent triangular faces, and both vertices A and B of the simplified edge AB have a set of vertex attributes; Figure 3B The texture edge AB shown has two adjacent triangular faces, and vertex A of texture edge AB has two attributes, uv0 and uv1, and vertex B has two attributes, uv2 and uv3. The same attribute uv0 and uv2 correspond to the geometric and texture properties of the left triangular face, and the same attribute uv1 and uv3 correspond to the geometric and texture properties of the right triangular face. That is, each vertex attribute can be sequentially matched in the geometric topology and the texture topology. Figure 3CThe pivot edge AB shown also has two adjacent triangular faces. The two vertices A and B of the pivot edge AB each have two attributes. However, the attribute uv1 of vertex A corresponds to the geometric and texture properties of the upper right triangular face, and the attribute uv3 of vertex B corresponds to the geometric and texture properties of the lower right triangular face. That is, each vertex attribute cannot correspond sequentially in the geometric topology and texture topology. Figure 3D The physical edge AB has only one adjacent triangular facet, and vertices A and B each have only one attribute.
[0123] In one exemplary embodiment, determining the simplified weights of the triangle sides based on the type of each triangle side includes:
[0124] When the triangle edge is a simplified edge or a textured edge, the simplification weight of the triangle edge is within the first weight range;
[0125] When the triangle sides are physical sides, the simplified weights of the triangle sides are within the second weight range;
[0126] When the triangle's edge is a pivot edge, the simplified weight of the triangle's edge is within the third weight range;
[0127] The simplification weights of the simplified edges and texture edges are higher than the simplification weights of the physical edges, and the simplification weights of the physical edges are higher than the simplification weights of the hub edges; the first weight range, the second weight range, and the third weight range can be set.
[0128] In this application embodiment, different simplification weights are assigned to different types of triangle edges. Simplified edges and texture edges are relatively "unimportant edges", so they are given higher simplification weights to increase the probability of being simplified. Smaller simplification weights are assigned to pivot edges to reduce the probability of being simplified, which can reduce the probability of texture confusion. Appropriate simplification of physical edges can avoid adverse effects such as excessive shrinkage of the 3D model and obvious edge sharpening caused by oversimplification of physical edges.
[0129] In an exemplary embodiment, the simplification weight of the physical edge can be determined based on a preset coefficient and a proportional coefficient. The proportional coefficient is determined based on the proportion of physical edges among all triangle edges in the connected graph to which the physical edge belongs. For example, the proportional coefficient is the reciprocal of the proportion of physical edges among all triangle edges in the connected graph to which the physical edge belongs. For instance, if the number of physical edges among all triangle edges in the connected graph to which the physical edge belongs is h, and the total number of triangle edges in the connected graph to which the physical edge belongs is x, then the proportional coefficient is x / h. That is, the more physical edges there are, the smaller the proportional coefficient, the smaller the simplification weight corresponding to the physical edge, and the lower the probability of the physical edge being simplified; conversely, the fewer physical edges there are, the larger the proportional coefficient, the larger the simplification weight corresponding to the physical edge, and the higher the probability of the physical edge being simplified. This avoids over-simplification of physical edges when there are too many physical edges in the connected graph, reducing adverse phenomena such as excessive shrinkage and obvious edge sharpening in the 3D model during the simplification process.
[0130] In one exemplary embodiment, the basic simplification error of the triangle sides includes at least: geometric error;
[0131] The method for calculating the geometric error includes:
[0132] For each set of connected graphs, a directed distance field is generated based on the vertex geometry information and the geometric topology of the triangular facets contained in the set of connected graphs; wherein, the vertex geometry information includes: vertex three-dimensional coordinate information;
[0133] The geometric error is calculated using a Quadric Error Metric (QEM) matrix, and the directed distance fields of all connected graph sets other than the set to which the triangle edge belongs are used as constraints for solving the QEM matrix.
[0134] Solve the quadratic error metric matrix under the given constraints to obtain the geometric error of the triangle's sides.
[0135] The embodiments of this application employ a quadratic error measurement method, which can calculate the quadratic error matrix of each triangle side. This optimized error measurement of the triangle sides makes it easier to distinguish each vertex in the model, enabling a more accurate description of the shape and surface details of the object. Secondly, the matrix-based quadratic error measurement method can effectively avoid problems such as the disappearance of cusp features and local oversimplification that exist in other quadratic error measurement algorithms, thereby better preserving the geometric characteristics of the 3D model.
[0136] Furthermore, this application's embodiments introduce a directed distance field as a constraint condition for calculating geometric errors, which can ensure that the three-dimensional geometric coordinates of the target vertex obtained after simplifying the triangle sides based on the geometric errors will not overlap with connected graph sets outside of its own connected graph set, thus avoiding the occurrence of penetration phenomena.
[0137] In an exemplary embodiment, the basic simplification error of the triangle edge may further include one or more of the following: normal error, texture coordinate error, and tangent error. The normal error, texture coordinate error, and tangent error can all be calculated using a quadratic error metric (QEM) matrix. The aforementioned basic simplification errors can be defined by setting a set G, which includes all adjacent triangle faces of the edge to be simplified that do not contain the edge to be simplified at either end. All basic simplification errors can be expressed as the sum of the distances from the attribute of the target vertex corresponding to the edge to be simplified to each adjacent triangle face in set G, where the attribute is a normal, texture coordinate, tangent, etc.
[0138] In this embodiment, when calculating the basic simplification error of the triangle sides, at least one of the normal error, texture error, and tangent error is also taken into consideration. This can be seen to better maintain the stability of normals, textures, and tangents and reduce the occurrence of texture spread.
[0139] For example, the basic simplification error of the triangle sides also includes color error.
[0140] For example, geometric error, normal error, texture coordinate error, tangent error, and color error can be simultaneously calculated as the basic simplified errors of the triangle edges. Specifically, a quadratic error metric optimization matrix is constructed based on the 3D geometric information, normal vector, texture coordinates, tangent vector, and color information of the triangle edges. For the geometric error, normal error, texture coordinate error, tangent error, and color error of the triangle edges, the simplified errors of the triangle edges are calculated, and the target vertex data, including geometric coordinates, normal vector, texture coordinates, tangent vector, and color information, is obtained.
[0141] After determining the simplification weight and basic simplification error of each triangle edge, in an exemplary embodiment, the edge to be simplified is determined based on the simplification weight and basic simplification error of each triangle edge, including:
[0142] The target simplification error for each triangle side is determined based on the simplification weight of each triangle side and the basic simplification error.
[0143] The edges to be simplified are determined based on the target simplification error of all triangle edges.
[0144] In one exemplary embodiment, determining the target simplification error for a corresponding triangle edge based on the simplification weight of each triangle edge and the basic simplification error includes:
[0145] The reduction weight of each triangle side is multiplied by the basic reduction error to obtain the target reduction error of the corresponding triangle side.
[0146] In one exemplary embodiment, for simplified edges and texture edges, the target simplification error is equal to their base simplification error, i.e., the simplification weight is equal to 1; for physical edges, the target simplification error is equal to the product of the simplification weight and the base simplification error, wherein the simplification weight of the physical edge is determined according to a preset coefficient and a scaling factor; for hub edges, they may not participate in the simplification process, and the target simplification error is 0. In this embodiment, hub edges do not participate in simplification, and texture edges and physical edges maintain limited simplification, which can ensure the continuity of the texture and geometry of the 3D model.
[0147] In one exemplary embodiment, determining the edge to be simplified based on the target simplification error of all triangle edges includes:
[0148] In each set of connected graphs, select the triangle edge with the smallest target simplification error as the edge to be simplified.
[0149] In an exemplary embodiment, simplifying the 3D model based on the edges to be simplified includes:
[0150] In each connected graph set, the edge to be simplified and its vertex data are deleted and replaced with the target vertex, and the topological relationship of the vertex of the edge to be simplified is transferred to the target vertex; Figure 4A As a connected graph before simplification, V i and V j Let these be the two vertices of the edge to be simplified; Figure 4B Representing the simplified connected graph, Figure 4A Replace the triangular facet filled with horizontal lines in the middle with the target vertex V';
[0151] After replacing the triangle edges with target vertices, determine whether the preset target simplification ratio has been reached. If not, repeat the following steps: calculate the target simplification error of all triangle edges on the second-order adjacency faces of each vertex in each connected graph set; determine the edge to be simplified based on the target simplification error; in each connected graph set, delete the edge to be simplified and its vertex data, replace them with target vertices, and transfer the topological relationship of the vertex of the edge to be simplified to the target vertex; until the preset target simplification ratio is reached. The target simplification ratio can be represented by the ratio of the number of simplified triangle faces to the number of triangle faces before simplification; for example, it can also be the ratio of the number of simplified triangle edges to the number of triangle edges before simplification; for example, it can also be the ratio of the number of simplified triangle vertices to the number of triangle vertices before simplification.
[0152] In one exemplary embodiment, the method further includes:
[0153] Before determining the simplified weights of the triangle edges of all triangles in each connected graph based on the vertex attributes and topological information of the triangles in the connected graph, a coarse simplification of the 3D model can be performed first, including:
[0154] In the set of all connected graphs, each connected graph whose number of triangles is less than or equal to a preset threshold for the number of triangles is selected as a candidate connected graph.
[0155] The following steps are performed iteratively: In all the newly obtained candidate connected graphs, the connected graph with the smallest weight is deleted as the target connected graph, and the preset triangle number threshold is updated based on the number of triangles in the target connected graph; new candidate connected graphs are selected from the remaining candidate connected graphs based on the updated preset triangle number threshold, until no candidate connected graphs are available. The preset triangle number threshold is used to select the set of connected graphs that meet the requirements during the coarse simplification process. The connected graph weights are determined based on the weight parameters of each connected graph, such as the connected graph area, the sum of voxels of vertices, the number of vertices, the number of triangles, etc.
[0156] In this embodiment of the application, before simplifying the three-dimensional model according to the edges to be simplified, the three-dimensional model is first coarsely simplified by deleting connected graphs that meet the threshold for the number of triangular faces, which can improve the simplification efficiency.
[0157] In an exemplary embodiment, the preset threshold for the number of triangles is determined based on the total number of triangles in the 3D model, the target simplification ratio, and the coarse simplification ratio of the 3D model. The total number of triangles refers to the total number of triangles in the entire 3D model. The target simplification ratio is a pre-set proportion of triangles to be removed during the simplification process out of all triangles. The coarse simplification ratio is a pre-set proportion of triangles to be removed during coarse simplification out of the total number of triangles determined by the target simplification ratio. Both the target simplification ratio and the coarse simplification ratio can be set according to scene requirements.
[0158] In an exemplary embodiment, the preset threshold for the number of triangular faces is determined based on the total number of triangular faces in the 3D model, the target simplification ratio of the 3D model, and the coarse simplification ratio, including:
[0159] The threshold for the number of triangular facets is the product of the total number of triangular facets, the target simplification ratio, and the coarse simplification ratio.
[0160] For example, assuming the coarse simplification ratio is λ = 10%, the total number of triangular faces is n = 3000, and the target simplification ratio is 50%, which means that the goal is to remove n * 50% = 1500 triangular faces from the total number of triangular faces, then the threshold for the number of triangular faces is λ × n × 50% = 150, that is, coarse simplification requires the removal of 150 triangular faces.
[0161] In one exemplary embodiment, the coarse simplification process includes:
[0162] From all connected graph sets, select connected graphs whose number of triangles is less than or equal to a preset threshold for the number of triangles. This will result in multiple connected graphs. All of these connected graphs will be used as candidate connected graphs. Then, among all the candidate connected graphs, select the connected graph with the smallest weight as the target connected graph and delete all triangles from the target connected graph.
[0163] The number of triangles in the target connected graph is subtracted from the preset threshold for the number of triangles to obtain the updated threshold for the number of triangles. Then, connected graphs with a number of triangles less than or equal to the updated threshold are selected from the remaining set of connected graphs as candidate connected graphs for the next round. In the new round of candidate connected graphs, the connected graph with the lowest weight is selected and deleted, and the threshold for the number of triangles is updated again. This process is repeated until no candidate connected graphs are available, at which point the coarse simplification process ends.
[0164] For example, assuming the preset threshold for the number of triangles is 150, in all connected graph sets, each connected graph with less than 150 triangles is considered a candidate connected graph. All triangles in the connected graph with the lowest weight among all candidate connected graphs are deleted. Assuming the total number of deleted triangles is 100, the updated threshold for the number of triangles is 50. The process continues by selecting connected graphs with less than 50 triangles and the lowest weight from the remaining connected graph set, and deleting all their triangles, until no candidate connected graph can be selected based on the updated threshold for the number of triangles. The coarse simplification process then ends. For example, after a certain loop, the updated threshold for the number of triangles is 10, but there are no connected graphs with a number of triangles less than or equal to 10, so the coarse simplification process ends.
[0165] In an exemplary embodiment, the method for calculating the connected graph weights includes:
[0166] For each of the connected graphs, the connected graph weight in its set of connected graphs is determined based on the weight parameters of the connected graph. The weight parameters include one or more of the following: the area of the connected graph, the sum of all vertex voxels, the number of vertices, and the number of triangles. The area of the connected graph can be determined by the sum of the areas of all triangles in the connected graph. The sum of all vertex voxels refers to the sum of the number of voxels of all vertices contained in the connected graph. A voxel is a volume pixel in three-dimensional space, which is the basic unit that constitutes a three-dimensional image or model, similar to a pixel in a two-dimensional image, but representing the volume of a cube in three-dimensional space.
[0167] In an exemplary embodiment, determining the connected graph weights of the connected graph within its set of connected graphs based on the weight parameters of the connected graph includes:
[0168] For any type of weight parameter value of the connected graph, determine the proportion of the weight parameter value among the weight parameter values of all connected graphs included in the corresponding connected graph set;
[0169] Normalize the proportions of all types of weight parameter values;
[0170] The weights of the connected graph are determined based on the proportions of all types of weight parameter values after normalization.
[0171] For example, determining the connected graph weights based on the proportion of normalized weight parameter values of all types includes:
[0172] The weight of the connected graph is the weight obtained by weighting and summing the proportions of all normalized weight parameter values.
[0173] For example, let the weight parameters of a connected graph be: the area of the connected graph, the sum of all vertex voxels, the number of vertices, and the number of triangles.
[0174] The area of the connected graph is divided by the area of all connected graphs in the connected graph set to which the connected graph belongs, to obtain the ratio p1 of the area of the connected graph; the sum of all vertex voxels of the connected graph is divided by the sum of all vertex voxels in the connected graph set to which the connected graph belongs, to obtain the ratio p2 of the sum of all vertex voxels; the number of vertices in the connected graph is divided by the number of vertices in the connected graph set to which the connected graph belongs, to obtain the ratio p3 of the number of vertices; the number of triangles in the connected graph is divided by the number of triangles in the connected graph set to which the connected graph belongs, to obtain the ratio p4 of the number of triangles.
[0175] Normalizing p1, p2, p3, and p4 yields normalized p1', p2', p3', and p4', where...
[0176] p1' = p1 / (p1+p2+p3+p4);
[0177] p2' = p2 / (p1+p2+p3+p4);
[0178] p3' = p3 / (p1+p2+p3+p4);
[0179] p4' = p4 / (p1+p2+p3+p4);
[0180] The weight of the connected graph is equal to the weighted sum of p1', p2', p3' and p4'. For example, let the weight of the connected graph be α, α = α1×p1' + α2×p2' + α3×p3' + α4×p4', where α1, α2, α3 and α4 are the weights of the corresponding weight parameters, and all of them are settable weights.
[0181] In an exemplary embodiment, where the connectivity weights of the connected graph to which the triangle edges belong need to be determined, the step of determining the edge to be simplified, at least based on the simplification weights of all triangle edges and the basic simplification error, includes:
[0182] The target simplification error of the corresponding triangle edge is determined based on the simplification weight of each triangle edge, the basic simplification error of each triangle edge, and the connected graph weight of the connected graph to which each triangle edge belongs.
[0183] The edge to be simplified is determined based on the target simplification error of all triangle edges. For example, the triangle edge with the smallest target simplification error is selected as the edge to be simplified.
[0184] In one exemplary embodiment, the target simplification error of a corresponding triangle edge is determined based on the simplification weight of each triangle edge, the basic simplification error of each triangle edge, and the connectivity weight of the connected graph to which each triangle edge belongs, including:
[0185] The target simplification error of the corresponding triangle's edge is obtained by multiplying the simplified weight of each triangle's edge, the basic simplification error, and the connected graph weight of the connected graph to which the triangle's edge belongs.
[0186] In one exemplary embodiment, after simplifying the 3D model based on the edges to be simplified, the method further includes:
[0187] Based on the change in the included angle of the second-order adjacent faces of the simplified target vertex corresponding to the edge to be simplified, it is determined whether the triangle face will be flipped after simplification; the second-order adjacent face of a vertex can be understood as the triangle face of a first-order neighbor B of a vertex A that does not contain vertex A.
[0188] In the event of triangular facet folding, restore the simplified edge that was replaced by the target vertex and the vertex attributes of the simplified edge, and increase the simplification weight and / or basic simplification error of the simplified edge.
[0189] Figure 5 This is a schematic diagram illustrating the folding effect in the simplified 3D model. Before simplification, all vertices are located on the same plane; after simplification, the target vertex P replaces the original triangle side AB, and the triangular faces S1 and S4, and S2 and S3 are no longer on the same plane, resulting in folding and disrupting the overall structure of the original 3D model.
[0190] When a flip occurs, the reduction of the face that caused the flip can be considered a failure. To avoid flipping, the mesh state before the reduction can be rolled back, and the simplification error of the simplified edge that caused the flip can be improved, that is, the probability of the triangle edge being identified as a simplified edge can be reduced.
[0191] In an exemplary embodiment, determining whether a fold occurs after simplification based on the change in the included angle of the second-order adjacent faces of the simplified target vertex corresponding to the edge to be simplified includes:
[0192] If the change in the included angle is greater than or equal to the included angle threshold, it is determined that a triangular facet folds after simplification.
[0193] In an exemplary embodiment, the change in the included angle can be represented by the absolute value of the difference between θ and φ, where θ is the angle between the first-order and second-order adjacent faces of the edge to be simplified before simplification, and φ is the angle between the first-order and second-order adjacent faces of the target point after simplification. The included angle threshold can be set; for example, the included angle threshold is...
[0194] In one exemplary embodiment, the method further includes:
[0195] Before simplifying the 3D model based on the edge to be simplified, determine the skeletal binding data and / or deformation animation data of the target vertex, wherein the target vertex is used to replace the edge to be simplified.
[0196] With the development of 3D animation and graphics rendering technologies, 3D models (especially 3D character models) have begun to possess skeletal binding data and / or deformation animation data. This application's embodiments consider the skeletal binding data and / or deformation animation data of the simplified target vertices when simplifying the 3D model. When a triangle changes, the skeletal binding data changes accordingly, such as... Figure 6 As shown, just as when the human skeleton rotates and shifts, the muscles attached to the skeleton will also change with the spatial transformation of the skeleton, and the original skeleton binding data and deformation animation data will also change. In this embodiment, the changes in skeleton binding data and deformation animation data were taken into account during the simplification process, so as to achieve the effect of preserving the original 3D model's skeleton binding and deformation animation.
[0197] In one exemplary embodiment, determining the skeletal binding data of the target vertex includes:
[0198] Based on the distances between the target vertex and the two vertices of the edge to be simplified, the initial weights between the bone points corresponding to the two vertices and the target vertex are determined; for example, the greater the distance between the target vertex and the vertex of the edge to be simplified, the smaller the initial weight of the bone point corresponding to the vertex of the edge to be simplified to the target vertex.
[0199] Based on the initial weights, the index weights of the two vertices corresponding to each bone point, and the binding weights of the two vertices corresponding to each bone point, the weights between the target vertex and each bone point are determined. The index weights of each bone point corresponding to each of the two vertices and that vertex can be set; the binding weights of each bone point corresponding to each of the two vertices and that vertex can also be set. For example, the comprehensive weight from the vertex to the bone point can be obtained by multiplying the initial weights of each vertex of the edge to be simplified, the index weights of each bone point to the corresponding vertex, and the binding weights of each bone point to the corresponding vertex. Then, the comprehensive weights of the two vertices of the edge to be simplified are summed to obtain the weight from the target vertex to the bone point.
[0200] Based on the weight between the target vertex and each bone point, a preset number of bone points are selected as the bone binding data for the target vertex.
[0201] During the simplification process, the vertices of the edge to be simplified already possess skeletal binding data, including binding weights and index weights. Therefore, this data can be directly used when calculating the skeletal binding data of the target vertex. Each vertex of the edge to be simplified corresponds to a certain number of bone points. Furthermore, the bone points corresponding to two vertices of the edge to be simplified can be the same or different.
[0202] For example, consider an edge to be simplified, with endpoints M and N, a target vertex P, and a skeletal point S. Assume the distance between P and M is 0.3, and the distance between P and N is 0.7; the binding weight of M to S is 0.9, and its index weight is 0.5; the binding weight of N to S is 0.2, and its index weight is 0. Then the weight of the target vertex P to the skeletal point S is:
[0203] The binding weight of M to S × (1 - distance between P and M) × index weight of M to S + binding weight of N to S × (1 - distance between P and N) × index weight of N to S; that is,
[0204] 0.9×(1-0.3)×0.5+0.2×(1-0.7)×0.
[0205] As shown above, the weight of the target vertex relative to all bone points is calculated, and several of the larger weights are selected as the bone binding data for the target vertex.
[0206] In one exemplary embodiment, determining the deformation animation data of the target vertex includes:
[0207] The deformation animation data is superimposed on all vertices of the adjacent triangle facet of the edge to be simplified to obtain the updated edge of the adjacent triangle facet; similarly, the edge to be simplified is also an edge of the adjacent triangle facet.
[0208] Simplified vertices with deformation animation data are generated based on the edges of the updated adjacent triangles;
[0209] Based on the data difference between the target vertex and the simplified vertex, the deformation animation data of the target vertex is determined. This data includes the vertex's geometric, normal, tangent, and texture coordinate attributes.
[0210] The flowchart for determining the deformation animation data of the target vertex is as follows: Figure 7 As shown, Figure 7 The edge to be simplified is edge AB. All vertices of the adjacent triangles of edge AB are superimposed with the deformation animation data to obtain the updated triangles. The target vertex Q is determined based on the edges of the updated triangles. The target vertex P is determined based on the original edge to be simplified AB. The difference between the target vertex Q and the target vertex P is calculated. The deformation animation data of the target vertex P is determined based on the difference.
[0211] In one exemplary embodiment, converting the mesh of the 3D model into a set of multiple connected graphs includes:
[0212] Remove non-two-dimensional manifold meshes from the three-dimensional model and retain the two-dimensional manifold meshes;
[0213] The two-dimensional manifold mesh in the three-dimensional model is transformed into a set of multiple connected graphs.
[0214] The determination of a two-dimensional manifold mesh can be carried out through the following steps: First, check whether each triangle edge is shared by more than two triangle faces. If so, then both triangles are non-two-dimensional manifolds. After filtering out non-two-dimensional manifold meshes, the remaining ones are two-dimensional manifold meshes.
[0215] In an exemplary embodiment, simplifying the 3D model based on the edges to be simplified includes:
[0216] The two-dimensional manifold mesh is simplified based on the edges to be simplified;
[0217] The simplified two-dimensional manifold mesh is integrated with the non-two-dimensional manifold mesh to obtain a simplified three-dimensional model.
[0218] Since non-two-dimensional manifold meshes are discontinuous structures, simplification will result in significant structural changes. Therefore, the embodiments of this application do not simplify non-two-dimensional manifold meshes, thus maintaining the topology of the original three-dimensional model.
[0219] The following is a specific application example to illustrate the three-dimensional model simplification method described in the above embodiments of this application.
[0220] For 3D models, especially complex 3D models (such as those with complex triangular facet topologies), simplification steps may include:
[0221] The process involves acquiring the geometric data and topological information of all mesh sets in a 3D model, as well as the vertices on all triangles within each mesh set, the binding weights of vertices to bones, the deformation animation data of vertices, and the vertex attribute data. Specifically, the geometric data of a vertex may include its 3D coordinates, the topological information of the vertex includes texture topology and geometric topology, and the vertex attribute data includes texture coordinates, normals, tangents, and color information. Texture coordinates represent the mapping relationship between vertices and texture maps.
[0222] Traverse the set of meshes, filter out non-2D manifold meshes, retain 2D manifold meshes, and transform the retained 2D manifold meshes into multiple connected graph sets;
[0223] The weight of each connected graph in each set of connected graphs is calculated based on the area of the connected graph, the sum of all vertex voxels, the number of vertices, and the number of triangles.
[0224] Based on a predetermined threshold for the number of triangular faces, a coarse simplification of the 3D model is achieved by removing all triangular faces from connected graphs with lower weights.
[0225] In each coarsely simplified connected graph, the simplification weight of each triangle edge is calculated based on the vertex attributes and topological information of the triangle facets. The basic simplification error of each triangle edge is calculated through quadratic metric error. The target simplification error of each triangle edge is calculated based on the simplification weight of each triangle edge, the basic simplification error of each triangle edge, and the connected graph weight of the connected graph to which each triangle edge belongs. The triangle edge with the smallest target simplification error is selected as the edge to be simplified.
[0226] Determine the skeletal binding data and / or deformation animation data of the target vertex corresponding to the edge to be simplified;
[0227] The process of simplifying the 3D model based on the edges to be simplified involves deleting the edges to be simplified and the vertex data on the edges, replacing them with the target vertices, and transferring the topological relationships of the original edges and vertices to the target vertices. The simplification process is iteratively executed until the number of triangle edges or vertices reaches the preset target simplification ratio of the 3D model.
[0228] After each deletion of an edge to be simplified, check whether the triangular facets in the fine simplification iteration have folded. If folding occurs, roll back the state and double the target simplification error of the edge to be simplified.
[0229] After the iterative simplification is completed, a simplified two-dimensional manifold mesh is obtained. In the two-dimensional manifold mesh, the edges at the boundary with the non-two-dimensional manifold mesh are pivot edges, so the edges at this point will not be simplified, and the original topological information is preserved. Therefore, the simplified two-dimensional manifold mesh can be integrated with the filtered non-two-dimensional manifold mesh to construct a simplified three-dimensional model.
[0230] This application also provides a device for simplifying three-dimensional models, such as... Figure 8 As shown, the device includes:
[0231] The conversion module 801 is configured to convert the mesh of a 3D model into a set of multiple connected graphs, wherein each set of connected graphs includes multiple connected graphs;
[0232] In scenarios such as virtual character creation and animation production, a 3D model composed of multiple triangular facets can be used to represent people or objects in the scene. When simplifying the 3D model, it can be divided into multiple mesh sets, and simplification can be performed on each mesh set separately. For example, in a 3D character model, the body, hair, face, upper garment, and pants are different mesh sets. For example, in the embodiments of this application, a mesh set can be further transformed into a connected graph set, that is, a mesh set includes multiple connected graphs, and a connected graph includes multiple triangular facets.
[0233] A connected graph means that there must be a path between any two vertices in the graph.
[0234] The determination module 802 is configured to, for each connected graph, determine the simplified weights of the triangle edges of all triangles in the connected graph based on the vertex attributes of the triangles in the connected graph and the topological information of the triangles in the connected graph.
[0235] The vertex attributes include one or more of the following: texture coordinates, normals, tangents, and colors, where texture coordinates refer to the mapping relationship between vertices and texture maps;
[0236] The topological information of the triangular facets includes: geometric topology and texture topology; the geometric topology refers to the logical relationship of the triangular facets formed by the vertices of the three-dimensional space coordinates in the model; the texture topology refers to the logical relationship of the triangular facets formed by the vertices in the two-dimensional texture space.
[0237] The vertex attributes and topological information of a triangle can reflect the complexity of its relationship with other surrounding triangles, thus determining its weight in the simplification process—the simplification weight. For example, when the complexity is low, the corresponding triangle has a higher simplification weight.
[0238] The simplification module 803 is configured to determine the edge to be simplified from the triangle edges of all triangle patches based on the simplification weights of all triangle edges and the basic simplification error, and to simplify the 3D model based on the edge to be simplified.
[0239] For example, as mentioned earlier, each triangle facet has a corresponding simplification weight for its triangle edge; and the basic simplification error of the triangle edge is determined based on the error that occurs during the simplification process according to its own attribute characteristics, which include the normal error, texture coordinate error, color error, etc. of the triangle edge during the simplification process.
[0240] In this embodiment, one or more triangle edges are selected as edges to be simplified based on the simplification weight of each triangle edge and the magnitude of the basic simplification error. There is no limit to the number of edges to be simplified.
[0241] In this embodiment, the 3D model can be simplified by deleting the edges to be simplified.
[0242] The 3D model simplification device described in this application considers the vertex attributes and topological information of the triangular facets when determining the simplified edges. It then determines the importance of all triangle edges based on the vertex attributes and topological information of the triangular facets, thereby gradually simplifying the 3D model according to the importance of the triangle edges. This avoids the aggregation and collapse of vertices during the simplification process, solves the problem that vertex clustering algorithms can easily cause triangle degradation and destroy the original model topology, and ensures that the simplified 3D model can still maintain the original model topology.
[0243] This application also provides another device for simplifying three-dimensional models, such as... Figure 9 As shown, the device includes a memory 901 and a processor 902. The memory 901 stores a program that, when read and executed by the processor 902, implements the method for simplifying the three-dimensional model as described in any of the previous embodiments.
[0244] The simplification apparatus for three-dimensional models described in this application embodiment can realize the simplification method for three-dimensional models as described in any previous embodiment, and therefore has the technical effects of the simplification method for three-dimensional models as described in any previous embodiment.
[0245] This application also provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the simplification method for three-dimensional models as described in any of the preceding embodiments.
[0246] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
Claims
1. A method for simplifying a three-dimensional model, the method comprising: The mesh of the 3D model is transformed into multiple sets of connected graphs, wherein each set of connected graphs includes multiple connected graphs; For each of the connected graphs, the simplified weights of the triangle edges of all triangles in the connected graph are determined based on the vertex attributes of the triangles in the connected graph and the topological information of the triangles in the connected graph. Among the triangle edges of all triangle patches, the edges to be simplified are determined based on the simplification weights of all triangle edges and the basic simplification error, and the 3D model is simplified based on the edges to be simplified. The step of determining the simplified weights of the triangle edges of all triangles in the connected graph based on the vertex attributes and topological information of the triangles in the connected graph includes: Based on the number of vertex attributes of the triangle edges in the connected graph, the correspondence of vertex attributes between two vertices of the triangle edges, and the number of adjacent triangle faces of the triangle edges, the simplified weights of the triangle edges of all triangle faces are determined. or, Based on the vertex attributes of the triangular facets in the connected graph and the topological information of the triangular facets in the connected graph, determine the type of the triangle edges of each triangular facet; The simplified weight of each triangle's edge is determined based on its type.
2. The method according to claim 1, characterized in that, The step of determining the type of triangle edges for each triangle based on the vertex attributes and topological information of the triangles in the connected graph includes: The type of triangle edge for each triangle is determined based on the number of vertex attributes of the triangle edge in the connected graph, the correspondence of vertex attributes between two vertices of the triangle edge, and the number of adjacent triangle faces of the triangle edge.
3. The method according to claim 2, characterized in that, The step of determining the type of triangle edge for each triangle facet based on the number of vertex attributes of the triangle edge in the connected graph, the correspondence of vertex attributes between two vertices of the triangle edge, and the number of adjacent triangle faces of the triangle edge includes: If a triangle has only one adjacent triangular facet, then the triangle is determined to be a physical edge. If a triangle has two adjacent triangular faces and both vertices of the triangle have a set of vertex attributes, then the triangle is determined to be a simplified edge. If a triangle edge has two adjacent triangular faces, and each of the two vertices of the triangle edge has multiple sets of vertex attributes, and the multiple sets of vertex attributes can correspond sequentially in both geometric topology and texture topology, then the triangle edge is determined to be a texture edge. If a triangle has two adjacent triangular faces, and each of the two vertices of the triangle has multiple sets of vertex attributes, and the multiple sets of vertex attributes cannot correspond sequentially in the geometric topology and texture topology, then the triangle is determined to be a pivot edge.
4. The method according to any one of claims 1 to 3, characterized in that, The step of determining the simplified weight of the corresponding triangle side based on the type of each triangle side includes: When the triangle edge is a simplified edge or a textured edge, the simplification weight of the triangle edge is within the first weight range; When the triangle sides are physical sides, the simplified weights of the triangle sides are within the second weight range; When the triangle's edge is a pivot edge, the simplified weight of the triangle's edge is within the third weight range; The simplification weights of the simplified edges and texture edges are higher than the simplification weights of the physical edges, and the simplification weights of the physical edges are higher than the simplification weights of the hub edges.
5. The method according to claim 4, characterized in that, The simplified weight of the physical edge is determined according to a preset coefficient and a proportional coefficient, wherein the proportional coefficient is determined according to the proportion of the physical edge among all triangle edges in the connected graph to which the physical edge belongs.
6. The method according to claim 1, characterized in that, The basic simplification error of the triangle sides includes at least geometric errors; the calculation method for the geometric errors includes: For each set of connected graphs, a directed distance field is generated based on the vertex geometry information and the geometric topology of the triangular facets contained in the set of connected graphs. The directed distance fields of all connected graph sets other than the set to which the triangle edge belongs are used as constraints for solving the quadratic error metric matrix of the geometric error. Solve the quadratic error metric matrix under the given constraints to obtain the geometric error of the triangle's sides.
7. The method according to claim 6, characterized in that, The basic simplification error of the triangle side also includes at least one or more of the following: normal error, texture coordinate error, and tangent error.
8. The method according to claim 1, characterized in that, After simplifying the 3D model based on the edges to be simplified, the method further includes: Based on the change in the included angle of the second-order adjacent faces of the simplified target vertex corresponding to the edge to be simplified, determine whether the triangular facets will fold after simplification. In the event of triangular facet folding, restore the simplified edge that was replaced by the target vertex and the vertex attributes of the simplified edge, and increase the simplification weight and / or basic simplification error of the simplified edge.
9. The method according to claim 8, characterized in that, The step of determining whether triangular facets fold after simplification based on the change in the included angle of the second-order adjacent faces of the simplified target vertex corresponding to the edge to be simplified includes: If the change in the included angle is greater than or equal to the included angle threshold, it is determined that a triangular facet folds after simplification.
10. The method according to claim 1, characterized in that, Before determining the simplified weights of the triangle edges of all triangles in each connected graph based on the vertex attributes and topological information of the triangles in the connected graph, the method further includes: In the set of all connected graphs, each connected graph whose number of triangles is less than or equal to a preset threshold for the number of triangles is selected as a candidate connected graph. The following steps are performed iteratively: In all the latest candidate connected graphs, the connected graph with the smallest weight is deleted as the target connected graph, and the preset triangle number threshold is updated according to the number of triangles in the target connected graph; new candidate connected graphs are selected from the remaining candidate connected graphs according to the updated preset triangle number threshold, until no candidate connected graphs are available.
11. The method according to claim 10, characterized in that, The preset threshold for the number of triangular facets is determined based on the total number of triangular facets in the 3D model, the target simplification ratio, and the coarse simplification ratio of the 3D model.
12. The method according to claim 10, characterized in that, The method for calculating the weights of the connected graph includes: For each of the connected graphs, the connected graph weight in its set of connected graphs is determined based on the weight parameters of the connected graph, wherein the weight parameters include one or more of the following: the area of the connected graph, the sum of all vertex voxels, the number of vertices, and the number of triangles.
13. The method according to claim 12, characterized in that, Determining the connected graph weights within its set of connected graphs based on the weight parameters of the connected graph includes: For any type of weight parameter value of the connected graph, determine the proportion of the weight parameter value among the weight parameter values of all connected graphs included in the corresponding connected graph set; Normalize the proportions of all types of weight parameter values; The weights of the connected graph are determined based on the proportions of all types of weight parameter values after normalization.
14. The method according to claim 12 or 13, characterized in that, The determination of the edge to be simplified, based at least on the simplification weights of all triangle edges and the basic simplification error, includes: The target simplification error of the corresponding triangle edge is determined based on the simplification weight of each triangle edge, the basic simplification error of each triangle edge, and the connected graph weight of the connected graph to which each triangle edge belongs. The side to be simplified is determined based on the target simplification error of all triangle sides.
15. The method according to claim 1, characterized in that, Before simplifying the 3D model based on the edges to be simplified, the method further includes: Determine the skeletal binding data and / or deformation animation data of the target vertex, wherein the target vertex is used to replace the edge to be simplified.
16. The method according to claim 15, characterized in that, The skeletal binding data for determining the target vertex includes: Based on the distances between the target vertex and the two vertices of the edge to be simplified, determine the initial weights between the skeletal points corresponding to the two vertices and the target vertex; The weights between the target vertex and each bone point are determined based on the initial weights, the index weights of the two vertices corresponding to each bone point, and the binding weights of the two vertices corresponding to each bone point. Based on the weight between the target vertex and each bone point, a preset number of bone points are selected as the bone binding data for the target vertex.
17. The method according to claim 15, characterized in that, The deformation animation data for determining the target vertex includes: Overlay deformation animation data onto all vertices of the adjacent triangle facets of the edge to be simplified to obtain the updated edge of the adjacent triangle facets; Simplified vertices with deformation animation data are generated based on the edges of the updated adjacent triangles; The deformation animation data of the target vertex is determined based on the data difference between the target vertex and the simplified vertex.
18. The method for simplifying a three-dimensional model according to claim 1, characterized in that, The process of converting the mesh of the 3D model into a set of multiple connected graphs includes: Remove non-two-dimensional manifold meshes from the three-dimensional model and retain the two-dimensional manifold meshes; The two-dimensional manifold mesh in the three-dimensional model is transformed into a set of multiple connected graphs.
19. A device for simplifying a three-dimensional model, characterized in that, The device includes: The transformation module is configured to transform the mesh of a 3D model into multiple sets of connected graphs, wherein each set of connected graphs includes multiple connected graphs; The determination module is configured to, for each connected graph, determine the simplified weights of the triangle edges of all triangles in the connected graph based on the vertex attributes of the triangles in the connected graph and the topological information of the triangles in the connected graph. The simplification module is configured to determine the edges to be simplified from the triangle edges of all triangle patches based on the simplification weights of all triangle edges and the basic simplification error, and to simplify the 3D model based on the edges to be simplified. The determining module determines the simplified weights of the triangle edges of all triangles in the connected graph based on the vertex attributes and topological information of the triangles in the connected graph, including: Based on the number of vertex attributes of the triangle edges in the connected graph, the correspondence of vertex attributes between two vertices of the triangle edges, and the number of adjacent triangle faces of the triangle edges, the simplified weights of the triangle edges of all triangle faces are determined. or, Based on the vertex attributes of the triangular facets in the connected graph and the topological information of the triangular facets in the connected graph, determine the type of the triangle edges of each triangular facet; The simplified weight of each triangle's edge is determined based on its type.
20. A computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the method as described in any one of claims 1 to 18.
21. A device for simplifying three-dimensional models, characterized in that, The apparatus includes a memory and a processor, the memory storing a program that, when read and executed by the processor, implements the method of any one of claims 1 to 18.