Mesh model generation method and device, computer equipment and readable storage medium
By acquiring and processing the plane boundary lines and vertices of the target model, a stylized mesh model is generated, which solves the problems of low efficiency and insufficient diversity of mesh model generation in the prior art, and realizes efficient and diverse mesh model generation.
Patent Information
- Application Number
- CN202411998075.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-13
AI Technical Summary
In the prior art, the production of mesh objects such as spider webs requires manual construction in game or film and television scenes, resulting in inefficient generation and multiple mesh objects often lack flexibility and diversity.
By obtaining the target model, determining its plane boundary lines and vertices, and generating a mesh model based on extension processing and plane restoration, the stylized mesh model generation is achieved.
The generation efficiency of the mesh model is improved, and different mesh models are generated by different target models, which enhances the diversity and visual effects of the model.
Smart Images

Figure CN119991999A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of model making, and in particular to a mesh model generation method, apparatus, computer equipment and readable storage medium, wherein the readable storage medium is a computer-readable storage medium. Background Art
[0002] In game scenes or film and television scenes, there will be a need to make mesh objects. For example, if you need to add mesh objects such as spider webs to the scene, you usually need to manually construct the corresponding mesh model, which leads to low efficiency in model generation. When multiple mesh objects are needed, in order to improve production efficiency, changes will be made to the existing model, which also leads to the constructed mesh models being similar and lacking flexibility. Summary of the invention
[0003] The embodiments of the present application provide a mesh model generation method, apparatus, computer device and readable storage medium, which can generate a stylized mesh model based on a simple target model, thereby improving the generation efficiency of the mesh model. Different target models can generate different mesh models, thereby improving the diversity of the generated mesh models.
[0004] A method for generating a mesh model provided in an embodiment of the present application includes:
[0005] Acquire a target model, wherein the target model includes a plurality of polygonal planes connected by boundaries;
[0006] Determine the boundary lines of each plane of the target model and the first model vertex located on the boundary lines;
[0007] Based on a first position to which the target model needs to be extended, the boundary line is extended to obtain a processed model vertex corresponding to the first model vertex;
[0008] Performing plane restoration processing based on the planes to which the processed model vertices and the first model vertices belong to obtain an extended target model;
[0009] A mesh model is generated according to the extended target model.
[0010] Accordingly, an embodiment of the present application further provides a network model generating device, comprising:
[0011] An acquisition unit, used for acquiring a target model, wherein the target model includes a plane of a plurality of polygons connected by boundaries;
[0012] A determination unit, used to determine the boundary lines of each plane of the target model and the first model vertex located on the boundary lines;
[0013] An extending unit, configured to extend the boundary line based on a first position to which the target model needs to be extended, to obtain a processed model vertex corresponding to the first model vertex;
[0014] A restoration unit, configured to perform plane restoration processing based on the planes to which the processed model vertices and the first model vertices belong, to obtain an extended target model;
[0015] A generating unit is used to generate a mesh model according to the extended target model.
[0016] Correspondingly, an embodiment of the present application also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any one of the mesh model generation methods provided in the embodiments of the present application.
[0017] Correspondingly, an embodiment of the present application also provides a computer-readable storage medium, which is used to store a computer program, and the computer program is loaded by a processor to execute any mesh model generation method provided in the embodiment of the present application.
[0018] The embodiment of the present application obtains a target model, where the target model includes a plurality of polygonal planes connected by boundaries; determines the boundary lines of each plane of the target model and the first model vertex located on the boundary lines; based on the first position to which the target model needs to be extended, extends the boundary lines to obtain processed model vertices corresponding to the first model vertex; performs plane restoration processing based on the planes to which the processed model vertices and the first model vertices belong to obtain an extended target model; generates a mesh model based on the extended target model, thereby achieving generation of a stylized mesh model based on a simple target model without artificially constructing the mesh model, thereby improving the generation efficiency of the mesh model, and different target models can generate different mesh models, thereby improving the diversity of the generated mesh models. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 is a flow chart of a method for generating a mesh model provided in an embodiment of the present application;
[0021] Figure 2 is a schematic diagram of a target model provided in an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of another target model provided in an embodiment of the present application;
[0023] Figure 4 is a schematic diagram of the boundary points and first model vertices of the target model provided in an embodiment of the present application;
[0024] Figure 5 is a schematic diagram of a plane identification of a target model provided in an embodiment of the present application;
[0025] Figure 6 is a schematic diagram of a boundary line of a target model after extension processing provided in an embodiment of the present application;
[0026] Figure 7 is a schematic diagram of an extended target model provided in an embodiment of the present application;
[0027] Figure 8 is a schematic diagram of the branch structure of the mesh model provided in the embodiment of the present application;
[0028] Fig. 9 is a schematic diagram of a mesh model provided in an embodiment of the present application;
[0029] Fig.10 is a schematic diagram of a specified extension direction provided in an embodiment of the present application;
[0030] Fig.11 is a schematic diagram of a second model vertex of a target model provided in an embodiment of the present application;
[0031] Fig.12 is a schematic diagram of a first position of a second model provided in an embodiment of the present application;
[0032] Fig.13 is another flow chart of the mesh model generation method provided in an embodiment of the present application;
[0033] Fig.14 is a schematic diagram of a network model generating device provided in an embodiment of the present application;
[0034] Fig.15 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0036] The embodiments of the present application provide a network model generation method, device, computer equipment and computer readable storage medium. The network model generation device can be integrated in a computer equipment, which can be a server or a terminal.
[0037] The terminal may include a mobile phone, a wearable smart device, a tablet computer, a laptop computer, a personal computer (PC), and a vehicle-mounted computer.
[0038] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.
[0039] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.
[0040] This embodiment will be described from the perspective of a network model generating device, which can be integrated into a computer device, which can be a server or a terminal.
[0041] The present application provides a method for generating a mesh model, such as Figure 1 As shown, the specific process of the mesh model generation method can be as follows:
[0042] 101. Obtain a target model, where the target model includes a plane of multiple polygons connected by boundaries.
[0043] The target model may be a three-dimensional model for generating a mesh model, and the target model may include multiple polygonal planes, for example, the polygons may include quadrilaterals, triangles, pentagons, etc. The number of edges of the multiple planes included in the target model may be the same or different, and is not limited here. Each of the multiple polygonal planes is connected to at least one plane boundary, and the target model may be a model that can form a closed space or a model that is not enclosed into a closed space.
[0044] The target model can be pre-set. The target model is a simple model composed of multiple deformable planes. It is simple to make and has many ways to obtain. It can improve the efficiency of generating mesh models. Different target models will generate different mesh models, which can increase the diversity of the generated mesh models and improve the visual effects of scenes built based on mesh models.
[0045] Optionally, the target model may also be generated by a first model. The first model may be a model with a simpler structure than the target model. For example, the first model may be a plane model or a polyhedron such as a tetrahedron. That is, in one embodiment, before the step of “obtaining the target model”, the mesh model generation method provided in the embodiment of the present application may further include:
[0046] Get the first model;
[0047] The space corresponding to the first model is divided to obtain a plurality of polygonal space planes;
[0048] Each spatial plane is meshed and subdivided to obtain the target model.
[0049] The model structure of the first model is simpler than that of the target model, and the first model includes fewer planes than the target model. For example, the first model may be a plane model, and for another example, the second model may be a tetrahedron model.
[0050] The space corresponding to the first model may refer to the space occupied by the first model. For example, if the first model does not form a closed space, the space corresponding to the first model may be itself. If the first model forms a closed space, the space corresponding to the first model may be the closed space formed by the first model.
[0051] If the first model does not form a closed space, the first model can be divided to obtain multiple spatial planes. If the first model forms a closed space, the closed space is divided to divide the closed space into multiple spatial planes, and each spatial plane obtained by the division is connected to at least one spatial plane boundary.
[0052] The space corresponding to the first model may be divided randomly, so that even if the same first model is divided, the division results obtained each time are different, that is, the target models obtained are different. Different mesh models can be generated based on different target models, thereby improving the diversity of the generated mesh models.
[0053] Optionally, the space corresponding to the first model may be divided by a noise algorithm, such as Voronoi Noise, etc. Optionally, the space corresponding to the first model may be divided into a plurality of spatial planes by grid division, etc. The spatial planes divided based on the noise algorithm are also random, which can improve the diversity of the generated mesh model.
[0054] In one embodiment, a plurality of feature points may be set in the space corresponding to the first model, and each feature point may be used to determine a spatial plane, that is, the step of “dividing the space corresponding to the first model to obtain a plurality of polygonal spatial planes” includes:
[0055] Generate a plurality of feature points in the space corresponding to the first model;
[0056] For each feature point, determining at least two target feature points matching the feature point from among the plurality of feature points;
[0057] Determine the target point in space according to the feature point and the target feature point, wherein the distances from the feature point and the target feature point to the target point are the same;
[0058] According to the target point associated with each feature point, a spatial plane corresponding to each feature point is generated.
[0059] For example, multiple feature points can be randomly set in the space corresponding to the first model. For each feature point, at least two target feature points that match the feature point are determined in the space. The at least two target feature points can be feature points that are closest to the feature point among the multiple feature points. The at least two feature points can also be feature points determined based on the Delaunay algorithm.
[0060] According to the position of the feature point and the position of the target feature point corresponding to the feature point, the center of the circumscribed circle is determined. The center of the circle is the target point. The distances from the feature point and the target feature point to the target point are equal.
[0061] A spatial plane corresponding to the feature point is generated based on a target point associated with the feature point, and the target point associated with the feature point is a target point determined based on the feature point.
[0062] By performing the above processing for each feature point, the space of the first model can be divided into multiple plane spaces, and the distance from the midpoint of the plane space corresponding to each feature point to the feature point is smaller than the distance to other feature points.
[0063] After the space corresponding to the first model is divided into multiple spatial planes, the spatial planes can also be meshed and subdivided to obtain a target model. The target model after the subdivision process can contain more model vertices, and more model vertices can subsequently participate in the extension process, thereby improving the effect of the extension process and making the stretching effect more realistic, thereby improving the generation effect of the mesh model.
[0064] Exemplarily, by dividing the space corresponding to the first model of the tetrahedral structure, the following can be obtained: Figure 2 Multiple polygonal spatial planes as shown; by meshing each spatial plane, the following can be obtained: Figure 3The target model is shown.
[0065] 102. Determine the boundary lines of each plane of the target model and the first model vertex located on the boundary lines.
[0066] Among them, the first model vertex is a model vertex located on the boundary line of each plane in the target model. The boundary line of the plane is the edge of the plane. The boundary line of each plane and the first model vertex located on the boundary line can be determined according to the spatial position of the model vertex on the plane.
[0067] For example, for Figure 3 The target model shown, the boundary line height and the first model vertex on the boundary line can be as follows Figure 4 shown.
[0068] 103. Based on the first position to which the target model needs to be extended, extend the boundary line to obtain a processed model vertex corresponding to the first model vertex.
[0069] Among them, the first position can be a pre-specified position to which the target model needs to be extended. Specifically, the boundary line can be extended so that at least part of the boundary line is extended to the first position. The position of the first model vertex on the boundary line changes as the boundary line is extended. For example, the relative position of the first model vertex on the boundary line can be controlled to remain unchanged, and the first model vertex on the extended boundary line is the processed model vertex.
[0070] 104. Perform plane restoration processing based on the planes to which the processed model vertices and the first model vertices belong to, to obtain an extended target model.
[0071] Since the first model vertices and the processed model vertices are in one-to-one correspondence, a new plane, i.e., the processed plane, can be generated based on the processed model vertices corresponding to the first model vertices belonging to the same plane. The processed model vertices are located on the boundary line of the processed plane. Since the processed plane is generated based on the processed model vertices corresponding to the model vertices belonging to the same plane, the processed model vertices corresponding to the first model vertices belonging to the same plane belong to the same processed plane.
[0072] A plane is generated based on the processed model vertices and the plane to which the first model vertex corresponding to the processed model vertex belongs, so as to restore the boundary line to the plane and obtain the extended target model. The plane to which the first model vertex belongs can be determined based on the boundary line where it is located.
[0073] The plane to which the first model vertex belongs may also be marked based on a plane identifier of the plane. In one embodiment, a corresponding plane identifier may be generated for each plane, and the first model vertex of the plane may be marked based on the plane identifier of the plane, so as to perform plane restoration processing based on the plane identifier. A plane identifier corresponding to each plane in the target model, that is, before the step of "extending the boundary line based on the first position to which the target model needs to be extended to, to obtain a processed model vertex corresponding to the first model vertex", the mesh model generation method provided in the embodiment of the present application further includes:
[0074] According to the plane to which the first model vertex belongs, generating a corresponding plane identifier for the first model vertex;
[0075] Performing plane restoration processing based on the planes to which the processed model vertices and the first model vertices belong to obtain an extended target model, including:
[0076] For each processed model vertex under each plane identifier, the plane corresponding to each plane identifier is restored to obtain the extended target model.
[0077] For example, each plane in the target model may correspond to a plane identifier, and the plane identifier may be used to determine a unique plane in the target model. According to the plane to which the first model vertex belongs, a corresponding plane identifier is generated for the first model vertex to mark the plane to which the first model vertex belongs.
[0078] For each plane mark, plane restoration processing is performed based on the processed model vertices under the plane mark to obtain the extended target model.
[0079] For each plane on the target model, a corresponding processed plane can be generated, and the extended target model can be obtained based on the processed plane, that is, the step of "performing plane restoration processing based on the planes to which the processed model vertices and the first model vertices belong to obtain the extended target model" may include:
[0080] For each plane of the target model, plane restoration processing is performed according to the first model vertices on the plane and the processed model vertices corresponding to the first model vertices, so as to obtain a plurality of processed planes, wherein the processed model vertices are located on the processed planes;
[0081] The extended target model is obtained according to the multiple processed planes.
[0082] For example, for each plane of the target model, the processed model vertex corresponding to the first model vertex on the plane is determined, and the processed model vertex is generated based on the processed model vertex being a model vertex on the boundary line, and the processed model vertex is located on the boundary line of the processed plane. Based on the multiple processed planes and the spatial positions of the multiple processed planes, an extended target model can be generated, and the generated extended target model includes multiple processed planes.
[0083] For example, for Figure 3 The target model shown in the figure, the plane identifiers corresponding to each plane can be as follows Figure 5 As shown, for Figure 6 The extended boundary line shown in FIG. 1 and the processed model vertices corresponding to the first model vertices are subjected to plane restoration processing, and the obtained extended target model can be shown as Figure 7 shown.
[0084] In one embodiment, a second model vertex that needs to reach the first position after the boundary line is extended can be determined from among the first model vertices, and motion simulation is performed through motion solving to control the second model vertex to move to the first position, that is, the step of "extending the boundary line based on the first position to which the target model needs to be extended to obtain a processed model vertex corresponding to the first model vertex" can include:
[0085] Based on the specified extension direction of the target model, determining, from the first model vertices, a second model vertex that is located at the edge of the target model in the specified extension direction;
[0086] Based on the first position that the second model vertex needs to reach after the boundary line is extended, a motion solution process is performed on the boundary line to obtain a processed model vertex corresponding to the first model vertex.
[0087] The specified extension direction may be preset in the program code or specified by the user. If the first position is located on other models, the specified extension direction may also be determined based on the relative orientation of the other models and the target model.
[0088] The second model vertices may be part or all of the first model vertices located at the edge of the target model and perpendicular to the specified extension direction of the determined plane, and may be specifically determined according to the positions of the first model vertices and the specified extension direction.
[0089] After the second model vertex is determined among the first model vertices, the boundary line may be subjected to motion calculation processing with the goal of making the second model vertex reach the first position after the boundary line is extended to obtain a processed model vertex corresponding to the first model vertex.
[0090] The motion solving process may include at least one of dynamic solving, fluid solving and cloth solving. The motion solving process involves the force condition of the first model vertex in the process of the second model vertex being pulled to the first position, and the position of the first model vertex is updated based on the force condition of the first model vertex. Among them, the cloth solving process can be used to simulate the movement of cloth or similar materials in the real world, such as how it is deformed under the influence of gravity, wind, collision and other external forces.
[0091] 105. Generate a mesh model based on the extended target model.
[0092] Among them, the mesh model can be used to simulate spider webs, structures similar to spider webs, the effect of mucus spit out by organisms adhering to two objects, and mesh-like structures produced by adhesives being pulled.
[0093] Specifically, the extended target model can be used as a mesh model. Optionally, a branch structure of the mesh model can be generated based on the extended boundary line, so that the mesh model has not only a surface structure but also a branch structure, and the model effect is better. That is, in one embodiment, before the step of "generating a mesh model according to the extended target model", the mesh model generation method provided in the embodiment of the present application can also include:
[0094] On the extended boundary line, a plurality of reference points for generating the branch structure of the mesh model are set;
[0095] Generate the branch structure of the mesh model based on the reference points;
[0096] Generate a mesh model based on the extended target model, including:
[0097] The extended target model and the branch structure are merged to obtain a mesh model.
[0098] The reference point may be selected from the first model vertex on the extended boundary line, or may be a newly set point on the extended boundary line. For example, multiple reference points may be obtained by scattering points on the extended boundary line. Figure 8 As shown in the figure, points are scattered on the extended boundary line, and the following can be generated based on the scattered points: Figure 8 The branch structure shown in red.
[0099] A geometric structure is generated based on reference points. The generated geometric structure can be used as a branch structure of a mesh model. The branch structure and the extended target model are merged to obtain a mesh model with a surface structure and a branch structure.
[0100] For example, based on Figure 7 The extended target model shown in Figure 8 The branch structure shown (red part) can be obtained as follows Fig. 9 The mesh model shown.
[0101] The first position in step 104 may be predetermined or determined according to the extension direction. For example, the second position may be specified in advance on the second model, and the first position corresponding to each second model vertex may be determined according to the specified extension direction indicated by the second position. The second model may be different from the first model, the target model, and the mesh model. The second model may be in the same scene as the mesh model. For example, the mesh model simulates a net woven by an unknown organism in the scene, and the second model may be two tree trunks connected by the net, etc. That is, in one embodiment, before the step of "determining, from the first model vertices, the second model vertices at the edge of the target model in the specified extension direction based on the specified extension direction of the target model", the model generation method provided in the embodiment of the present application may also include:
[0102] determining a second position on the second model, the second position indicating a specified extension direction of the target model;
[0103] After the step of “determining, from the first model vertices, a second model vertex located at the edge of the target model in the specified extension direction based on the specified extension direction of the target model”, the model generation method provided in the embodiment of the present application may further include:
[0104] For each second model vertex, according to the specified extension direction, a first position whose relative direction to the second model vertex conforms to the specified extension direction is determined on the second model.
[0105] The second position on the second model may indicate a specified extension direction. The second position on the second model may be set by a user on the second model, or may be pre-set in the code program.
[0106] The first position may be a position reached on the second model by advancing the second model vertex along the designated extension direction.
[0107] For each second model vertex, the first position corresponding to the second model vertex is determined on the second model according to the specified extension direction. Specifically, a straight line can be determined according to the specified extension direction and the second model vertex, and the first position is determined according to the intersection of the straight line and the second model. Optionally, the first position can be determined according to the projection of the second model vertex on the second model along the specified extension direction; optionally, a ray can be emitted at the second model vertex, and the position where the ray intersects the second model is detected.
[0108] There may be one or more second models, and at least one second position may be set on each second model. For the specified extension direction indicated by each second position, the second model vertex to be pulled to the second model is determined from the first model vertices. That is, in one embodiment, there are multiple second models, and at least one second position is set on each second model. The step of "based on the specified extension direction of the target model, determining the second model vertex at the edge of the target model in the specified extension direction from the first model vertex" may include:
[0109] For each second position, determining, from the first model vertices, a second model vertex located at the edge of the target model in a specified extension direction indicated by the second position;
[0110] The step of “determining, for each second model vertex, a first position corresponding to the second model vertex on the second model according to a specified extension direction” may include:
[0111] According to the specified extension direction, on the second model to which the second position belongs, a point which is closest to the vertex of the second model and whose relative direction conforms to the specified extension direction is determined to obtain the first position corresponding to the vertex of the two models.
[0112] For each second position on the second model, a second model vertex located at the edge of the target model in a specified extension direction indicated by the second position is determined from the first model vertices.
[0113] After determining the second model vertex corresponding to each second model, the corresponding first position on the second model can be determined for each second model vertex. For example, the first position on the second model that is closest to the second model vertex and whose relative direction satisfies the specified extension direction can be determined. After determining that multiple first model vertices are located at the edge of the target model and are perpendicular to the specified extension direction of the determined plane, a first model vertex can be randomly selected from the multiple first model vertices as the second model vertex. For example, 5 first model vertices can be randomly selected as the second model vertices.
[0114] For example, the specified extension direction may be as follows: Fig.10 The target model can be located as shown in the straight line. Fig.10 Between the two spherical models shown, the extension direction indicated by the straight line extends to both sides of the spherical model, and for each second model vertex determined as Fig.11 The yellow point shown, the first position determined for each second model vertex can be as follows Fig.12 The black dots on the sphere are shown.
[0115] After obtaining the mesh model, the material of the surface or branches in the mesh model can be adjusted. For example, the surface structure can be replaced with a self-luminous material so that the mesh model can be self-luminous in the scene, or replaced with a transparent material so that the mesh model presents a transparent or translucent effect. Optionally, the color of the mesh model can also be adjusted. For example, it can be set to green, and the mesh model can also be used to simulate the green mucus emitted by strange creatures in the scene.
[0116] As can be seen from the above, the embodiment of the present application obtains a target model, where the target model includes a plurality of polygonal planes connected by boundaries; determines the boundary lines of each plane of the target model and the first model vertex located on the boundary line; based on the first position to which the target model needs to be extended, extends the boundary line to obtain the processed model vertex corresponding to the first model vertex; performs plane restoration processing based on the plane to which the processed model vertex and the first model vertex belong to obtain an extended target model; generates a mesh model based on the extended target model, thereby achieving the generation of a stylized mesh model based on a simple target model without the need to manually construct a mesh model, thereby improving the generation efficiency of the mesh model, and different target models can generate different mesh models, thereby improving the diversity of the generated mesh models.
[0117] In order to clearly illustrate the network model generation method provided in the embodiment of the present application, the following example is given for further explanation. Fig.13 As shown, the process of the mesh model generation method provided in the embodiment of the present application can be as follows:
[0118] 201. Obtain a first model.
[0119] The model structure of the first model is simpler than that of the target model. The first model includes fewer planes than the target model. For example, the first model may be a plane model, and for another example, the second model may be a tetrahedron model.
[0120] 202. Divide the space corresponding to the first model to obtain a plurality of polygonal planes, and generate a corresponding plane identifier for each plane.
[0121] For example, the space corresponding to the first model may be divided based on Voronoi Noise to obtain a plurality of polygonal planes, and a corresponding plane identifier may be generated for each plane. The plane identifier may be used to identify a unique plane in the target model.
[0122] For example, the first model may be a tetrahedron. After the space corresponding to the first model is divided based on Voronoi Noise, the obtained model may be as follows: Figure 2 As shown, the plane identification corresponding to each plane in the model is as follows Figure 5 shown.
[0123] 203. Each plane is meshed and subdivided to obtain a target model.
[0124] In order to allow more model vertices to participate in motion solving, each plane can be subdivided into meshes so that each plane is composed of more meshes to obtain the target model.
[0125] For example, by performing mesh subdivision processing on the model shown in the figure, the following can be obtained: Figure 3 The target model is shown.
[0126] 204. Determine boundary lines of each plane of the target model and a first model vertex located on the boundary lines.
[0127] The first model vertex is a model vertex located on the boundary line of each plane in the target model. The boundary line of the plane is the edge of the plane. The boundary line of each plane and the first model vertex located on the boundary line can be determined according to the spatial position of the model vertex on the plane.
[0128] For example, Figure 3 The target model shown in FIG. 1 may have a boundary line and a first model vertex located on the boundary line as shown in FIG. Figure 4 shown.
[0129] Furthermore, the plane identifier can be used to determine a unique plane in the target model. According to the plane to which the first model vertex belongs, a corresponding plane identifier is generated for the first model vertex to mark the plane to which the first model vertex belongs.
[0130] 205. Based on the first position that the second model vertex in the first model vertex needs to reach after the boundary line is extended, perform motion solution processing on the boundary line to obtain a processed model vertex corresponding to the first model vertex.
[0131] The specified extension direction can be determined by a second position on the second model, for example, Fig.10 As shown, the specified extension direction can be indicated by a straight line between the two spherical models.
[0132] The second model vertex may be a first model vertex located at the edge of the target model and perpendicular to the specified extension direction of the determined plane. Specifically, after determining multiple first model vertices located at the edge of the target model and perpendicular to the specified extension direction of the determined plane based on the positions of the first model vertices and the specified extension direction, a first model vertex may be randomly selected from the multiple first model vertices as the second model vertex. For example, 5 first model vertices may be randomly selected as the second model vertices.
[0133] For example, the second model vertex can be Fig.11The yellow point shown, the first position can be Fig.12 The black points on the sphere model are shown.
[0134] After the second model vertex is determined, the boundary line may be subjected to motion calculation processing with the goal of making the second model vertex reach the first position after the boundary line is extended, thereby obtaining a processed model vertex corresponding to the first model vertex.
[0135] The motion solving process may include at least one of dynamic solving, fluid solving, and cloth solving.
[0136] 206. Perform plane restoration processing based on the processed model vertices and the planes to which the processed model vertices belong to obtain an extended target model.
[0137] For each plane mark, plane restoration processing is performed based on the processed model vertices under the plane mark to obtain the extended target model.
[0138] For example, for Figure 4 The extended target model obtained by plane restoration processing of the extended boundary line shown in FIG. 1 and the processed model vertices corresponding to the first model vertices can be shown as follows: Figure 6 shown.
[0139] 207. On the boundary line after the extension process, set a plurality of reference points for generating a branch structure of a mesh model, and generate the branch structure of the mesh model based on the reference points.
[0140] For example, you can Figure 8 As shown, the extended boundary line is scattered with points to obtain reference points, and a geometric structure is generated based on the reference points. The generated geometric structure can be used as a branch structure of a mesh model. The branch structure can be as follows Figure 8 The red structure is shown.
[0141] 208. The extended target model and the branch structure are combined to obtain a mesh model.
[0142] By merging the branch structure and the extended target model, a mesh model with a surface structure and a branch structure can be obtained.
[0143] For example, Figure 6 The extended target model shown, and Figure 8 By merging the branch structures shown in Fig. 9 The mesh model shown can replace the material of the surface structure with a material with a translucent effect to make the surface of the mesh model transparent.
[0144] As can be seen from the above, the embodiment of the present application obtains a first model; divides the space corresponding to the first model to obtain multiple polygonal planes, and generates a corresponding plane identifier for each plane; meshes each plane to obtain a target model; determines the boundary lines of each plane of the target model and the first model vertex located on the boundary line; based on the first position that the second model vertex in the first model vertex needs to reach after the boundary line is extended, performs motion solution processing on the boundary line to obtain the processed model vertex corresponding to the first model vertex; performs plane restoration processing based on the plane to which the processed model vertex and the first model vertex belong to obtain an extended target model; on the extended boundary line, sets multiple reference points for generating the branch structure of the mesh model, and generates the branch structure of the mesh model based on the reference points; merges the extended target model and the branch structure to obtain a mesh model.
[0145] The embodiment of the present application can generate a stylized mesh model based on a simple first model without artificially constructing the mesh model, thereby improving the efficiency of mesh model generation, and different target models can generate different mesh models, thereby improving the diversity of the generated mesh models. Furthermore, by performing spatial division processing on the first model, a target model containing more planes and with diverse plane shapes can be obtained.
[0146] In order to better implement the network model generation method provided in the embodiment of the present application, a network model generation device is also provided in one embodiment. The meanings of the terms are the same as those in the network model generation method described above, and the specific implementation details can refer to the description in the method embodiment.
[0147] The network model generating device can be integrated into a computer device, such as Fig.14 As shown, the network model generating device may include: an acquiring unit 301, a determining unit 302, an extending unit 303, a restoring unit 304 and a generating unit 305, which are specifically as follows:
[0148] (1) An acquisition unit 301 is used to acquire a target model, where the target model includes a plane of multiple polygons connected by boundaries.
[0149] (2) A determination unit 302, used to determine the boundary lines of each plane of the target model and the first model vertex located on the boundary lines.
[0150] (3) An extension unit 303 is used to extend the boundary line based on the first position to which the target model needs to be extended, and obtain a processed model vertex corresponding to the first model vertex.
[0151] In one embodiment, the extension unit 303 may also be used for:
[0152] Based on the specified extension direction of the target model, determining, from the first model vertices, a second model vertex that is located at the edge of the target model in the specified extension direction;
[0153] Based on the first position that the second model vertex needs to reach after the boundary line is extended, a motion solution process is performed on the boundary line to obtain a processed model vertex corresponding to the first model vertex.
[0154] In one embodiment, the network model generation device provided in the embodiment of the present application may further include:
[0155] A first position determining unit, configured to determine a second position on the second model, the second position indicating a specified extension direction of the target model;
[0156] The second position determining unit is used to determine, for each second model vertex, a first position on the second model according to the specified extension direction, whose relative direction to the second model vertex conforms to the specified extension direction.
[0157] In one embodiment, there are multiple second models, each of which is provided with at least one second position, and the extension unit 303 can also be used for:
[0158] For each second position, determining, from the first model vertices, a second model vertex located at the edge of the target model in a specified extension direction indicated by the second position;
[0159] For each second model vertex, determining a first position corresponding to the second model vertex on the second model according to a specified extension direction includes:
[0160] According to the specified extension direction, on the second model to which the second position belongs, a point closest to the vertex of the second model is determined to obtain the first position corresponding to the vertex of the second model.
[0161] (4) A restoration unit 304 is used to perform plane restoration processing based on the planes to which the processed model vertices and the first model vertices belong, to obtain the extended target model.
[0162] In one embodiment, each plane in the target model corresponds to a plane identifier. The mesh model generation device provided in the embodiment of the present application may also include:
[0163] An identifier generating unit, used for generating a corresponding plane identifier for the first model vertex according to the plane to which the first model vertex belongs;
[0164] The restoration unit 304 may also be used to:
[0165] For each processed model vertex under each plane identifier, the plane corresponding to each plane identifier is restored to obtain the extended target model.
[0166] In one embodiment, the network model generation device provided in the embodiment of the present application may further include:
[0167] A model acquisition unit, used to acquire a first model;
[0168] A division unit, used for dividing the space corresponding to the first model to obtain a plurality of polygonal space planes;
[0169] The subdivision unit is used to perform mesh subdivision processing on each spatial plane to obtain a target model.
[0170] In one embodiment, the partitioning unit may also be used for:
[0171] Generate a plurality of feature points in the space corresponding to the first model;
[0172] For each feature point, determining at least two target feature points matching the feature point from among the plurality of feature points;
[0173] Determine the target point in space according to the feature point and the target feature point, wherein the distances from the feature point and the target feature point to the target point are the same;
[0174] According to the target point associated with each feature point, a spatial plane corresponding to each feature point is generated.
[0175] (5) A generating unit 305, used to generate a mesh model according to the extended target model.
[0176] In one embodiment, the network model generation device provided in the embodiment of the present application may further include:
[0177] On the extended boundary line, a plurality of reference points for generating the branch structure of the mesh model are set;
[0178] Generate the branch structure of the mesh model based on the reference points;
[0179] The generating unit 305 may also be used for:
[0180] The extended target model and the branch structure are merged to obtain a mesh model.
[0181] As can be seen from the above, the mesh model generation device of the embodiment of the present application obtains the target model through the acquisition unit 301, and the target model includes a plurality of polygonal planes connected by boundaries; the determination unit 302 determines the boundary lines of each plane of the target model and the first model vertex located on the boundary line; the extension unit 303 extends the boundary line based on the first position to which the target model needs to be extended, and obtains the processed model vertex corresponding to the first model vertex; the restoration unit 304 performs plane restoration processing based on the plane to which the processed model vertex and the first model vertex belong, and obtains the extended target model; the generation unit 305 generates a mesh model according to the extended target model, which can realize the generation of a stylized mesh model based on a simple target model without artificially constructing the mesh model, thereby improving the generation efficiency of the mesh model, and different target models can generate different mesh models, thereby improving the diversity of the generated mesh models.
[0182] Accordingly, the embodiment of the present application also provides a computer device, which may be a terminal. Fig.11 As shown, Fig.11 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored in the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. It will be understood by those skilled in the art that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0183] The processor 501 is the control center of the computer device 500. It uses various interfaces and lines to connect the various parts of the entire computer device 500, executes various functions of the computer device 500 and processes data by running or loading software programs and / or modules stored in the memory 502, and calling data stored in the memory 502, thereby monitoring the computer device 500 as a whole.
[0184] In the embodiment of the present application, the processor 501 in the computer device 500 will load instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 will run the application programs stored in the memory 502 to implement various functions:
[0185] Acquire a target model, the target model including a plurality of polygonal planes connected by boundaries;
[0186] Determine the boundary lines of each plane of the target model and the first model vertex located on the boundary lines;
[0187] Based on the first position to which the target model needs to be extended, the boundary line is extended to obtain a processed model vertex corresponding to the first model vertex;
[0188] Performing plane restoration processing based on the planes to which the vertices of the processed model and the vertices of the first model belong, to obtain an extended target model;
[0189] Generate a mesh model based on the stretched target model.
[0190] From the above, it can be seen that the embodiments of the present application can generate a stylized mesh model based on a simple target model without manually constructing the mesh model, thereby improving the generation efficiency of the mesh model, and different target models can generate different mesh models, thereby improving the diversity of the generated mesh models.
[0191] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0192] Optional, such as Fig.15 As shown, the computer device 500 further includes: a touch screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. The processor 501 is electrically connected to the touch screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507, respectively. Those skilled in the art can understand that Fig.15 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0193] The touch display screen 503 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of computer equipment, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 501, and can receive the command sent by the processor 501 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 501 to determine the type of touch event, and then the processor 501 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 503 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 503 can also be used as a part of the input unit 506 to realize the input function.
[0194] The radio frequency circuit 504 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other computer devices through wireless communication, and to send and receive signals between the network device or other computer devices.
[0195] The audio circuit 505 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 505 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and converted into audio data, and then the audio data is output to the processor 501 for processing, and then sent to another computer device through the radio frequency circuit 504, or the audio data is output to the memory 502 for further processing. The audio circuit 505 may also include an earphone jack to provide communication between an external headset and the computer device.
[0196] The input unit 506 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0197] The power supply 507 is used to supply power to various components of the computer device 500. Optionally, the power supply 507 can be logically connected to the processor 501 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 507 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0198] although Fig.15 Not shown, the computer device 500 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.
[0199] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0200] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0201] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute the steps in any of the mesh model generation methods provided in the embodiments of the present application. For example, the computer program can execute the following steps:
[0202] Acquire a target model, the target model including a plurality of polygonal planes connected by boundaries;
[0203] Determine the boundary lines of each plane of the target model and the first model vertex located on the boundary lines;
[0204] Based on the first position to which the target model needs to be extended, the boundary line is extended to obtain a processed model vertex corresponding to the first model vertex;
[0205] Performing plane restoration processing based on the planes to which the vertices of the processed model and the vertices of the first model belong, to obtain an extended target model;
[0206] Generate a mesh model based on the stretched target model.
[0207] From the above, it can be seen that the embodiments of the present application can generate a stylized mesh model based on a simple target model without manually constructing the mesh model, thereby improving the generation efficiency of the mesh model, and different target models can generate different mesh models, thereby improving the diversity of the generated mesh models.
[0208] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0209] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0210] The above is a detailed introduction to a mesh model generation method, device, computer equipment and computer storage medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for generating a mesh model, characterized in that: include: Acquire a target model, wherein the target model includes a plurality of polygonal planes connected by boundaries; Determine the boundary lines of each plane of the target model and the first model vertex located on the boundary lines; Based on a first position to which the target model needs to be extended, the boundary line is extended to obtain a processed model vertex corresponding to the first model vertex; Performing plane restoration processing based on the planes to which the processed model vertices and the first model vertices belong to obtain an extended target model; A mesh model is generated according to the extended target model.
2. The method according to claim 1, characterized in that A plane identifier corresponding to each plane in the target model, and before the boundary line is extended based on the first position to which the target model needs to be extended to obtain a processed model vertex corresponding to the first model vertex, the method further includes: According to the plane to which the first model vertex belongs, generating a corresponding plane identifier for the first model vertex; The performing plane restoration processing based on the planes to which the processed model vertices and the first model vertices belong to, to obtain the extended target model, comprises: For each processed model vertex under the plane identifier, the plane corresponding to each plane identifier is restored to obtain the extended target model.
3. The method according to claim 1, characterized in that The performing plane restoration processing based on the planes to which the processed model vertices and the first model vertices belong to, to obtain the extended target model, comprises: For each plane of the target model, plane restoration processing is performed according to the first model vertices on the plane and the processed model vertices corresponding to the first model vertices, so as to obtain a plurality of processed planes, wherein the processed model vertices are located on the processed planes; The extended target model is obtained according to the multiple processed planes.
4. The method according to claim 1, characterized in that: Before obtaining the target model, the method further includes: Get the first model; Dividing the space corresponding to the first model to obtain a plurality of polygonal space planes; Each spatial plane is subjected to mesh subdivision processing to obtain the target model.
5. The method according to claim 4, characterized in that The dividing process of the space corresponding to the first model to obtain a plurality of polygonal space planes includes: Generating a plurality of feature points in the space corresponding to the first model; For each feature point, determining at least two target feature points matching the feature point from among the plurality of feature points; Determine a target point in the space according to the feature point and the target feature point, wherein the feature point and the target feature point have the same distance to the target point; According to the target point position associated with each of the feature points, a space plane corresponding to each of the feature points is generated.
6. The method according to claim 1, characterized in that Before generating a mesh model according to the extended target model, the method further includes: On the extended boundary line, a plurality of reference points for generating the branch structure of the mesh model are set; Generate a branch structure of the mesh model based on the reference points; The step of generating a mesh model according to the extended target model comprises: The extended target model and the branch structure are combined to obtain the mesh model.
7. The method according to any one of claims 1 to 6, characterized in that: The extending process of the boundary line based on the first position to which the target model needs to be extended to obtain a processed model vertex corresponding to the first model vertex includes: Based on a specified extension direction of the target model, determining, from the first model vertices, a second model vertex located at an edge of the target model in the specified extension direction; Based on the first position that the second model vertex needs to reach after the boundary line is extended, the boundary line is subjected to motion resolution processing to obtain a processed model vertex corresponding to the first model vertex.
8. The method according to claim 7, characterized in that Before determining, based on the designated extension direction of the target model, from the first model vertices, a second model vertex located at an edge of the target model in the designated extension direction, the method further includes: determining a second position on a second model, the second position indicating the specified extension direction of the target model; After determining, based on the designated extension direction of the target model, from the first model vertices, a second model vertex located at an edge of the target model in the designated extension direction, the method further comprises: For each second model vertex, according to the specified extension direction, a first position is determined on the second model, the relative direction of which to the second model vertex conforms to the specified extension direction.
9. The method according to claim 8, characterized in that There are a plurality of second models, each of which is provided with at least one second position, and determining, based on the specified extension direction of the target model, from the vertices of the first model a second model vertex located at the edge of the target model in the specified extension direction, comprises: For each of the second positions, determining, from the first model vertices, a second model vertex located at the edge of the target model in the specified extension direction indicated by the second position; The step of determining, for each vertex of the second model, according to the specified extension direction, a first position corresponding to the vertex of the second model on the second model includes: According to the specified extension direction, on the second model to which the second position belongs, a point closest to the vertex of the second model is determined to obtain the first position corresponding to the vertex of the second model.
10. A network model generating device, characterized in that: include: An acquisition unit, used for acquiring a target model, wherein the target model includes a plane of a plurality of polygons connected by boundaries; A determination unit, used to determine the boundary lines of each plane of the target model and the first model vertex located on the boundary lines; An extending unit, configured to extend the boundary line based on a first position to which the target model needs to be extended, to obtain a processed model vertex corresponding to the first model vertex; A restoration unit, configured to perform plane restoration processing based on the planes to which the processed model vertices and the first model vertices belong, to obtain an extended target model; A generating unit is used to generate a mesh model according to the extended target model.
11. A computer device, characterized in that: It comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the mesh model generation method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute the mesh model generation method according to any one of claims 1 to 9.