Model Parameter Generation Method, Apparatus, Electronic Device, and Readable Storage Medium

By segmenting the surface of the three-dimensional model into areas and generating two-dimensional flattened images, the texture coordinates are automatically calculated, which solves the problems of slow artificial generation speed and low accuracy, and improves the simulation effect of three-dimensional clothing simulation.

CN112784469BActive Publication Date: 2025-07-08GUANGZHOU HUYA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110212477.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-25
Publication Date
2025-07-08
Estimated Expiration
2041-02-25

AI Technical Summary

Technical Problem

In the prior art, the texture coordinates of manual generation of three-dimensional models are slow and cannot generate accurate texture coordinates, especially in three-dimensional clothing simulation, resulting in poor simulation results.

Method used

The surface of the target three-dimensional model is divided into multiple regions, a two-dimensional flattened image of each region is generated, and the texture coordinates are automatically calculated through the correspondence between the mapped points and the model vertices in the two-dimensional image.

Benefits of technology

It realizes efficient and automatic acquisition of texture coordinates of three-dimensional models, especially the precise texture coordinates of complex models, and improves the dynamic simulation effect of three-dimensional clothing simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112784469B_ABST
    Figure CN112784469B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a method, apparatus, electronic device, and readable storage medium for generating model parameters, which relates to the field of computer technology. The model parameters include texture coordinates of model vertices. The method includes: dividing the surface of a target three-dimensional model into multiple regions; for each region, generating a two-dimensional image corresponding to the region, where the two-dimensional image is a two-dimensional flattened image corresponding to the region, and the two-dimensional image includes mapping points corresponding to the model vertices of the target three-dimensional model; according to the two-dimensional images corresponding to the respective regions and the correspondence between the mapping points and the model vertices in the two-dimensional images, obtaining the texture coordinates of the model vertices of the target three-dimensional model. In this way, the texture coordinates of the model vertices of the target three-dimensional model can be automatically obtained without obtaining the texture coordinates through a time-consuming manual method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a method, apparatus, electronic device, and readable storage medium for generating model parameters. Background Art

[0002] Three-dimensional model simulation (such as three-dimensional clothing model simulation) combines professional knowledge such as three-dimensional models, dynamics principles, and optimization theory to generate a dynamic simulation effect that is very close to the real situation. In the simulation, it is necessary to obtain the texture coordinates of the model vertices of the three-dimensional model. Currently, generally, manual use of mainstream three-dimensional model processing software (such as Maya, Blender, etc.) is used to manually generate the texture coordinates of the model vertices, and it is impossible to automatically process the three-dimensional model to obtain the required texture coordinates. Summary of the Invention

[0003] Embodiments of this application provide a method, apparatus, electronic device, and readable storage medium for generating model parameters, which can automatically and efficiently obtain the texture coordinates of the model vertices of the target three-dimensional model.

[0004] Embodiments of this application can be implemented as follows:

[0005] In a first aspect, embodiments of this application provide a method for generating model parameters, where the model parameters include the texture coordinates of model vertices, and the method includes:

[0006] Dividing the surface of the target three-dimensional model into multiple regions;

[0007] For each region, generating a two-dimensional image corresponding to the region, where the two-dimensional image is a two-dimensional flattened image corresponding to the region, and the two-dimensional image includes mapping points corresponding to the model vertices of the target three-dimensional model;

[0008] According to the two-dimensional images corresponding to each region and the correspondence between the mapping points and the model vertices in the two-dimensional images, obtaining the texture coordinates of the model vertices of the target three-dimensional model.

[0009] In a second aspect, embodiments of this application provide a device for generating model parameters, where the model parameters include the texture coordinates of model vertices, and the device includes:

[0010] A segmentation module, configured to divide the surface of the target three-dimensional model into multiple regions;

[0011] A flattening module, configured to generate a two-dimensional image corresponding to each region, where the two-dimensional image is a two-dimensional flattened image corresponding to the region, and the two-dimensional image includes mapping points corresponding to the model vertices of the target three-dimensional model;

[0012] A coordinate determination module, configured to obtain the texture coordinates of the model vertices of the target three-dimensional model according to the two-dimensional images corresponding to the respective regions and the correspondence between the mapping points in the two-dimensional images and the model vertices.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the model parameter generation method according to any one of the foregoing embodiments.

[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the model parameter generation method according to any one of the foregoing embodiments.

[0015] An embodiment of the present application provides a model parameter generation method, apparatus, electronic device, and readable storage medium. The surface of the target three-dimensional model is divided into multiple regions, and then for each region, a two-dimensional image is generated as the two-dimensional flattened image corresponding to the region. Furthermore, based on the obtained two-dimensional image and the correspondence between the mapping points in the two-dimensional image and the model vertices of the target three-dimensional model, model parameters including the texture coordinates of the model vertices of the target three-dimensional model are obtained. Thus, by automatically segmenting and flattening the target three-dimensional model, the texture coordinates of the model vertices can be automatically obtained. This method is efficient and fast, and can handle complex three-dimensional models at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0017] Figure 1 It is a block diagram of the electronic device provided by the embodiment of the present application;

[0018] Figure 2 It is one of the flow diagrams of the model parameter generation method provided by the embodiment of the present application;

[0019] Figure 3 It is an effect diagram of the surface segmentation of the target three-dimensional model provided by the embodiment of the present application;

[0020] Figure 4 For Figure 2 It is a flow diagram of the sub-steps included in step S120;

[0021] Figure 5Schematic diagram of two-dimensional image arrangement provided by an embodiment of the present application;

[0022] Figure 6 Second flowchart of the model parameter generation method provided by an embodiment of the present application;

[0023] Figure 7 Schematic diagram of triangulation provided by an embodiment of the present application;

[0024] Figure 8 Third flowchart of the model parameter generation method provided by an embodiment of the present application;

[0025] Figure 9 Model simulation effect diagram provided by an embodiment of the present application;

[0026] Figure 10 First block diagram of the model parameter generation device provided by an embodiment of the present application;

[0027] Figure 11 Second block diagram of the model parameter generation device provided by an embodiment of the present application;

[0028] Figure 12 Third block diagram of the model parameter generation device provided by an embodiment of the present application.

[0029] Icons: 100 - electronic device; 110 - memory; 120 - processor; 130 - communication unit; 200 - model parameter generation device; 210 - topology processing module; 220 - segmentation module; 230 - flattening module; 240 - coordinate determination module; 250 - simulation module. Detailed implementation manners

[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Usually, the components of the embodiments of the present invention described and illustrated herein can be arranged and designed in various different configurations.

[0031] Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but merely represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative efforts fall within the scope of protection of the present application.

[0032] It should be noted that relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the said element.

[0033] With the continuous development of technology, various three-dimensional virtual objects have gradually received extensive attention and favor. The implementation of three-dimensional virtual objects requires many steps such as three-dimensional modeling and model simulation. Among them, a large amount of time and effort need to be invested in model simulation to obtain a dynamic simulation effect close to the real situation. During this simulation process, it is necessary to obtain the texture coordinates of the vertices of the model. However, the method of manually obtaining texture coordinates has the drawback of low speed.

[0034] Taking the three-dimensional virtual digital human as an example of three-dimensional virtual objects, industries such as live broadcast, film and television, finance, and culture and tourism are constantly trying to use three-dimensional virtual digital humans to improve service quality and service level. The implementation of three-dimensional virtual digital humans requires many steps such as three-dimensional modeling, skeleton binding, and clothing simulation. Among them, a large amount of time and effort need to be invested by art personnel in clothing production and simulation to obtain a real dynamic simulation effect.

[0035] Three-dimensional clothing simulation combines professional knowledge such as three-dimensional clothing models, dynamics principles, and optimization theory to generate a real dynamic simulation effect. Classified by running speed, it includes real-time and offline; classified by the method of solving cloth simulation, it includes position-based and force-based. The force-based simulation model uses Newton's laws of motion to update the position and velocity of the mass points to achieve a high-precision simulation effect. And the finite element-based simulation method is a classic solution and is widely used in application scenarios with relatively high precision requirements. The three-dimensional clothing simulation system based on finite elements has strict requirements for the texture coordinates of the vertices of the three-dimensional clothing model. If the texture coordinates are obtained manually, not only is the speed slow, but also accurate texture coordinates cannot be generated.

[0036] To solve the above problems, the embodiments of the present application provide a method, device, electronic device, and readable storage medium for generating model parameters.

[0037] The following will describe in detail some embodiments of the present application with reference to the accompanying drawings. Without conflict, the following embodiments and the features in the embodiments may be combined with each other.

[0038] Please refer to Figure 1 , Figure 1 which is a block diagram of the electronic device 100 provided in the embodiment of the present application. The electronic device 100 may be, but is not limited to, a computer, a server, etc. The electronic device 100 may include a memory 110, a processor 120, and a communication unit 130. Each of the memory 110, the processor 120, and the communication unit 130 is directly or indirectly electrically connected to each other to achieve data transmission or interaction. For example, these components may be electrically connected to each other through one or more communication buses or signal lines.

[0039] Among them, the memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.

[0040] The processor 120 is used to read / write the data or programs stored in the memory 110 and execute corresponding functions. For example, the model parameter generation device 200 is stored in the memory 110, and the model parameter generation device 200 includes at least one software function module that can be stored in the memory 110 in the form of software or firmware. The processor 120 executes various functional applications and data processing by running the software programs and modules stored in the memory 110, such as the model parameter generation device 200 in the embodiment of the present application, that is, implements the model parameter generation method in the embodiment of the present application.

[0041] The communication unit 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through a network and is used to transmit and receive data through the network.

[0042] It should be understood that Figure 1 the structure shown is only a schematic diagram of the structure of the electronic device 100, and the electronic device 100 may further include more or fewer components than Figure 1 shown inFigure 1 The different configurations shown. Figure 1 Each component shown in can be implemented by hardware, software, or a combination thereof.

[0043] Please refer to Figure 2 , Figure 2 FIG. is one of the schematic flowcharts of the model parameter generation method provided by the embodiment of the present application. The method can be applied to the above-mentioned electronic device 100. The specific process of the model parameter generation method will be described in detail below. The method may include steps S120 to S140.

[0044] Step S120: Divide the surface of the target three-dimensional model into multiple regions.

[0045] The surface of the three-dimensional model is composed of multiple polygon patches, and the vertices of each patch are the model vertices of the three-dimensional model. In this embodiment, the target three-dimensional model is a three-dimensional model for which texture coordinates of the model vertices need to be obtained. The target three-dimensional model can be determined according to the user's input operation, or according to a pre-set selection rule, or sent by other devices. The specific determination method can be determined according to the actual situation. The target three-dimensional model can be, but is not limited to, a three-dimensional clothing model, a three-dimensional model of a table, etc., which are models that need to be simulated.

[0046] After determining the target three-dimensional model, the surface of the target three-dimensional model can be divided into multiple regions by any method. Exemplarily, after the division, the Figure 3 surface segmentation effect diagram shown in can be obtained. Figure 3 Each block in represents a region of the model surface of the target three-dimensional model. Among them, the number of regions can be set according to actual needs, as long as it is ensured that each region can be normally unfolded after division and the number is not too large. For example, after the division, the number of regions is 5% of the number of model vertices of the target three-dimensional model.

[0047] Step S130: Generate a two-dimensional image corresponding to each region.

[0048] After the division, a two-dimensional image corresponding to each region can be generated. Thus, the regions on the surface of the target three-dimensional model can be unfolded to obtain a two-dimensional flattened image of the region. The two-dimensional image includes mapping points corresponding to the model vertices of the target three-dimensional model.

[0049] Step S140: Obtain the texture coordinates of the model vertices of the target three-dimensional model according to the two-dimensional images corresponding to each region and the correspondence between the mapping points in the two-dimensional images and the model vertices.

[0050] After expanding each region, based on the two-dimensional image corresponding to each region, the texture coordinates of each point (i.e., mapping points) in the two-dimensional image can be obtained. Among them, the mapping points in the two-dimensional image include the mapping points corresponding to the model vertices of the target three-dimensional model and the mapping points corresponding to the points other than the vertices of the target three-dimensional model. Furthermore, according to the correspondence between the mapping points and the model vertices in the two-dimensional image, the texture coordinates of the model vertices of the target three-dimensional model can be obtained. For example, if point 1 in the two-dimensional image is the mapping point corresponding to model vertex a mapped onto the two-dimensional plane, then the texture coordinates of point 1 can be used as the texture coordinates of model vertex a.

[0051] Of course, it can be understood that if the texture coordinates of the points other than the vertices of the target three-dimensional model are also required, then according to the correspondence between the mapping points and the points other than the vertices of the target three-dimensional model in the two-dimensional image, the texture coordinates of the points other than the vertices of the target three-dimensional model can be obtained.

[0052] Thus, by automatically segmenting and flattening the model surface of the target three-dimensional model, and then based on the flattened two-dimensional image, the texture coordinates of the model vertices of the target three-dimensional model can be obtained. Moreover, the above method is not limited by the model shape. Even if the model shape is relatively complex, accurate parametric texture coordinates can still be automatically generated.

[0053] Optionally, as an alternative implementation, the surface of the target three-dimensional model can be segmented by clustering. Please refer to Figure 4 , Figure 4 For Figure 2 is the flowchart of the sub-steps included in step S120. Step S120 may include sub-steps S121 to S123.

[0054] Sub-step S121, separating the target three-dimensional model into independent sub-models according to the connectivity of the target three-dimensional model.

[0055] In this embodiment, the original vertex patch information of the target three-dimensional model can be obtained according to the model file of the target three-dimensional model. The model file can be, but is not limited to, OBJ file, PLY file, etc. Among them, the original vertex patch information at least includes the correspondence between each patch and the model vertices included in the patch, that is, based on the original vertex patch information, it can be determined which model vertices each patch includes.

[0056] Next, based on the original vertex and face information, the vertex adjacency relationship of the target 3D model can be obtained. The vertex adjacency relationship includes the adjacent relationship between vertices and the adjacent relationship between vertices and faces. Here, the vertices refer to the model vertices. Optionally, the vertex adjacency relationship can be directly obtained based on the original vertex and face information; or the target 3D model can be topologically processed based on the original vertex and face information, and then based on the processed target 3D model, the vertex adjacency relationship of the target 3D model can be obtained. The vertex adjacency relationship reflects the connectivity of the target 3D model. Among them, the connectivity reflected by the vertex adjacency relationship directly obtained based on the original vertex and face information is the same as the connectivity reflected by the vertex adjacency relationship obtained after topological processing.

[0057] Furthermore, based on the connectivity reflected by the vertex adjacency relationship, the target 3D model can be separated into independent sub-models. Among them, the connectivity is pre-configured when generating the target 3D model. For example, there is a bow on a piece of clothing, and the bow and the other parts of the clothing can be connected or not; if it is configured to be unconnected, then when splitting according to the connectivity, the bow can be used as a sub-model.

[0058] Sub-step S122: For each sub-model, sample on the surface of the sub-model to determine a plurality of sampling points.

[0059] In this embodiment, for each sub-model, a plurality of sampling points can be determined by sampling on the surface of the sub-model. Optionally, as an alternative implementation, the surface of a sub-model can be sampled based on the geodesic algorithm to determine the sampling points on the surface of the sub-model. Of course, it can be understood that the above method is only for illustration, and other methods can also be used for sampling.

[0060] To ensure that the sampling points are as evenly distributed on the surface of the sub-model as possible and the number is not too large, arbitrary sampling can be performed first, and then the obtained sampling points can be adjusted until the finally determined sampling points meet the requirements. For example, sampling points can be determined on the surface of the sub-model according to an arbitrary geodesic distance first. For example, a point is sampled every 1 cm, and then the geodesic distance used is adjusted based on the determined sampling points until the finally determined number of sampling points is 5% of the total number of model vertices of the sub-model where the sampling points are located.

[0061] Sub-step S123: Divide the model surface points of the sub-model into a clustering set centered on the sampling points.

[0062] After determining the sampling points of a sub-model, the model surface points of the sub-model can be classified according to the positions of the sampling points on the sub-model and the positions of the model surface points of the sub-model. The center of each class is a sampling point, thereby obtaining a clustering set centered on the sampling points. Among them, a clustering set includes a sampling point, and the model surface points included in the clustering set form the region corresponding to the sampling point. That is, a clustering set corresponds to Figure 4 one of the regions in

[0063] Optionally, when classifying, a conventional clustering algorithm can be used to complete the classification according to the positions of the sampling points and the model surface points of the sub-model. It is also possible to determine the adjacent sampling points of each sampling point according to the position of each sampling point on the sub-model. Then, for each sampling point, according to the position of the sampling point, the positions of the adjacent sampling points of the sampling point, and the positions of the other model surface points of the sub-model (that is, the model surface points in the sub-model other than the model surface points that are sampling points), a clustering set centered on the sampling point is determined.

[0064] Among them, it is possible to determine whether any two sampling points are adjacent according to the sampling distance used during sampling and the distance between the sampling points, thereby determining the adjacent sampling points of each sampling point. For example, the sampling distance is b, and the geodesic distance between two sampling points is c. If c > 1.2b, it can be determined that these two sampling points are not adjacent; conversely, if c is less than or equal to 1.2b, it can be determined that these two sampling points are adjacent. Of course, it can be understood that this method is only for illustration, and it is also possible to determine the adjacent sampling points of a sampling point by other means.

[0065] As a possible implementation method, it is possible to determine the boundaries corresponding to each sampling point according to the positions of each sampling point and the positions of the adjacent sampling points of each sampling point, and then determine the clustering sets corresponding to each sampling point according to the boundaries.

[0066] Among them, during the process of determining the clustering set, if the serial numbers of the model surface points of the sub-model are re-determined, and the new serial numbers are included in the clustering set, it is necessary to establish the corresponding relationship between the new serial numbers and the original serial numbers of the model surface points in order to determine the specific model surface points. For example, in the target 3D model, the serial numbers of some model surface points are 10000 - 11000, and these model surface points belong to the clustering set corresponding to sampling point 1, and the serial numbers in this clustering set are 0 - 1000. Then, it is necessary to establish the serial number index mapping relationship in order to determine which model surface points in the target 3D model the points in the clustering set correspond to.

[0067] After determining the regions corresponding to the sampling points of a sub-model, two-dimensional images corresponding to the regions can be generated, and then placed on a plane to obtain as Figure 5Schematic diagram of the two-dimensional image arrangement shown; furthermore, the texture coordinates of the mapping points corresponding to the model vertices in the plane after placement are obtained. That is, the two-dimensional image corresponding to a sub-model is placed on a plane, thereby ensuring the independence of the texture map.

[0068] Optionally, in a possible implementation manner, after partitioning, the boundary of a region can be extracted, and then based on the vertex adjacency relationship directly obtained from the original vertex patch information, this boundary, and preset constraint conditions, through continuous optimization, the two-dimensional image corresponding to this region is obtained.

[0069] Optionally, in another possible implementation manner, to avoid large changes in topology and texture distortion, the target three-dimensional model can be subjected to topology optimization processing first, and then the two-dimensional images corresponding to each region are generated. Please refer to Figure 6 , Figure 6 This is the second flowchart of the model parameter generation method provided by the embodiments of the present application. Before step S130, the method may further include steps S111 to S113.

[0070] Step S111, obtaining the original vertex patch information of the target three-dimensional model.

[0071] The model file of the target three-dimensional model can be parsed to obtain the original vertex patch information. Among them, the original vertex patch information includes the correspondence between each patch and the model vertices included in this patch.

[0072] Step S112, according to the original vertex patch information, determining the polygon patches with the number of model vertices greater than 3, and performing triangulation on the determined polygon patches to divide the polygon patches into multiple triangular patches.

[0073] According to the original vertex patch information, the number of model vertices included in each patch can be determined. According to the number of model vertices included in each patch, the polygon patches with the number of model vertices greater than 3 can be determined. For the polygon patches with the number of vertices greater than 3, triangulation can be performed on them, so as to divide the polygon patch into multiple triangular patches. Thus, through this topology optimization processing, the patches in the target three-dimensional model can be made to be triangular patches as much as possible. After the triangulation processing of the target three-dimensional model is completed, the target three-dimensional model does not include polygon patches with the number of vertices greater than 3.

[0074] Among them, the polygon patches with the number of vertices greater than 3 can be triangulated according to the index direction of the face. Generally, the index direction of the face is the counterclockwise direction. The following combines Figure 7 to give an example of the triangulation processing. According to the counterclockwise direction, Figure 7The polygon patch shown successively includes vertices A, B, C, and D. In the counterclockwise direction, the polygon patch is divided into triangles ABC and ACD, thus completing the triangulation of the polygon patch.

[0075] Step S113, after the triangulation process, obtain the vertex adjacency relationship of the target three-dimensional model.

[0076] After completing the triangulation process for all polygon patches with the number of model vertices greater than 3, the vertex adjacency relationship can be obtained based on the vertex patch information at this time. Among them, the vertex adjacency relationship includes the adjacent relationship between vertices and the adjacent relationship between vertices and patches. It can be understood that the vertex adjacency relationship can also include other contents, such as the latest vertex patch information (where the latest vertex patch information corresponds to the target three-dimensional model after the triangulation process).

[0077] Optionally, after completing the triangulation process, the normal direction of the triangular patches obtained after the triangulation process can also be calculated, and then it can be saved together with the normal direction of the patches that have not undergone the triangulation process for subsequent simulation use. It is also possible to recalculate the normal direction of each patch in the target three-dimensional model at this time after the triangulation process and then save it.

[0078] Optionally, the connectivity of the target three-dimensional model can be determined based on the vertex adjacency relationship obtained in step S113, and then the target three-dimensional model can be split into independent sub-models according to the connectivity.

[0079] When generating a two-dimensional image of a region, the region can be flattened according to the vertex adjacency relationship obtained in step S113 and preset constraint conditions to generate the two-dimensional image of the region. Among them, the preset constraint conditions can be specifically set according to actual needs. Flattening is an optimization process, and a two-dimensional image of a region can be obtained through continuous optimization according to the vertex adjacency relationship and preset constraint conditions.

[0080] As an alternative implementation, for a region, the boundary of the region can be extracted, and then a two-dimensional image of the region can be generated according to the vertex adjacency relationship, the boundary, and preset constraint conditions. Among them, the preset constraint conditions can include boundary minimum deformation constraints and / or triangle minimum deformation constraints. Repeat the above operations for each region to obtain the two-dimensional images of each region.

[0081] When the preset constraint conditions are the minimum boundary deformation constraint and the minimum triangle deformation constraint, flattening means that while keeping each triangle deformed as little as possible, the coherence and smoothness between triangles should also be maintained, and at the same time, the boundary should be deformed as little as possible. Among them, the coherence and smoothness between triangles represent the vertex adjacency relationship. Thus, the situation where the topology changes greatly during the flattening process can be reduced.

[0082] After generating the two-dimensional image corresponding to a sub-model, the two-dimensional images corresponding to the sub-model can be arranged on a plane according to the area, or the two-dimensional images corresponding to the sub-model can be randomly arranged on a plane. After the arrangement, it can be detected whether the current image arrangement method will cause the texture coordinates of the mapping points in the two-dimensional image to overlap. If the current image arrangement method causes the texture coordinates of the mapping points in the two-dimensional image to overlap, then the current image arrangement method is adjusted to place the two-dimensional images on the plane in a way that the texture coordinates do not overlap. If the current image arrangement method does not cause the texture coordinates of the mapping points in the two-dimensional image to overlap, then no adjustment is required, and it can be considered that the placement is completed. In the case where the placement is completed, the texture coordinates of each mapping point in the two-dimensional image at this time can be obtained, and then the texture coordinates of the model vertices can be determined.

[0083] Optionally, after the arrangement, the bounding box of each two-dimensional image can be calculated, and then it can be determined whether there is an overlap of the bounding boxes. If there is an overlap, it can be determined that the current image arrangement method causes the texture coordinates of the mapping points in the two-dimensional image to overlap. If there is no overlap, it can be determined that the current image arrangement method does not cause the texture coordinates of the mapping points in the two-dimensional image to overlap. That is, the placement of the two-dimensional images is detected based on the non-overlap of the bounding boxes of the two-dimensional images. Of course, it can be understood that the above method is only an example, and it can also be detected by other methods whether the current image arrangement method causes the texture coordinates of the mapping points in the two-dimensional image to overlap.

[0084] Please refer to Figure 8 , Figure 8 which is the third flow chart of the model parameter generation method provided by the embodiment of the present application. After step S140, the method may further include step S150.

[0085] Step S150, input the target three-dimensional model and the model parameters into the simulation engine.

[0086] In this embodiment, the model parameters may include the texture coordinates of the model vertices, or the texture coordinates of the model vertices and the normal direction information of each patch of the target 3D model. Among them, if steps S111 to S113 are not executed, the normal direction information of each patch of the target 3D model may be the information obtained by parsing the model file of the target 3D model. If steps S111 to S113 are executed, the normal direction of each patch of the target 3D model may be the normal direction of the patch of the target 3D model that has completed the triangulation process. In the case of obtaining the model parameters, the target 3D model, the model parameters, etc. can be input into the simulation engine to complete the simulation of the target 3D model.

[0087] Taking the target 3D model as a 3D clothing model as an example, the 3D clothing model, the texture coordinates of the model vertices of the 3D clothing model, the normal direction of the patches of the 3D clothing model, etc. can be directly loaded into the finite element-based simulation engine to obtain Figure 9 the model simulation effect diagram shown. Thus, the effect and quality of 3D clothing simulation can be guaranteed.

[0088] To execute the corresponding steps in the above embodiments and various possible ways, an implementation manner of a model parameter generation device 200 is given below. Optionally, the model parameter generation device 200 may adopt the device structure of the above Figure 1 shown electronic device 100. Further, please refer to Figure 10 , Figure 10 is one of the block diagrams of the model parameter generation device 200 provided by the embodiments of the present application. It should be noted that the basic principle and the technical effects generated by the model parameter generation device 200 provided in this embodiment are the same as those in the above embodiments. For the sake of brief description, for the parts not mentioned in this embodiment, reference may be made to the corresponding content in the above embodiments. The model parameters include the texture coordinates of the model vertices. The model parameter generation device 200 may include: a segmentation module 220, a flattening module 230, and a coordinate determination module 240.

[0089] The segmentation module 220 is used to divide the surface of the target 3D model into multiple regions.

[0090] The flattening module 230 is used to generate a two-dimensional image corresponding to each region. Among them, the two-dimensional image is the two-dimensional flattened image corresponding to the region, and the two-dimensional image includes mapping points corresponding to the model vertices of the target 3D model.

[0091] The coordinate determination module 240 is used to obtain the texture coordinates of the model vertices of the target 3D model according to the two-dimensional images corresponding to each region and the correspondence between the mapping points and the model vertices in the two-dimensional images.

[0092] Please refer to Figure 11 , Figure 11 The second block diagram of the model parameter generation device 200 provided in the embodiment of the present application. The model parameter generation device 200 may further include a topology processing module 210 .

[0093] The topology processing module 210 is used to: obtain original vertex patch information of the target three-dimensional model, wherein the original vertex patch information includes the correspondence between each patch and the model vertices included in the patch; determine polygonal patches with a number of model vertices greater than 3 based on the original vertex patch information, and triangulate the determined polygonal patches to divide the polygonal patches into multiple triangular patches; after triangulation, obtain the vertex adjacency relationship of the target three-dimensional model, wherein the vertex adjacency relationship includes the adjacent relationship between vertices and the adjacent relationship between vertices and patches.

[0094] The flattening module 230 is specifically used to generate a two-dimensional image of the region according to the vertex adjacency relationship and preset constraints.

[0095] Please refer to Figure 12 , Figure 12 The third block diagram of the model parameter generation device 200 provided in the embodiment of the present application. The model parameter generation device 200 may further include a simulation module 250 .

[0096] The simulation module 250 is used to input the target three-dimensional model and model parameters into a simulation engine.

[0097] Optionally, the above modules can be stored in the form of software or firmware. Figure 1 The memory 110 shown in the figure may be fixed in the operating system (OS) of the electronic device 100 and may be Figure 1 Meanwhile, the data and program codes required for executing the above modules may be stored in the memory 110.

[0098] An embodiment of the present application also provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the model parameter generating method is implemented.

[0099] In summary, the model parameter generation method, apparatus, electronic device, and readable storage medium provided by the embodiments of the present application divide the surface of the target three-dimensional model into multiple regions, and then generate a two-dimensional image as the two-dimensional flattened image corresponding to each region. Furthermore, based on the obtained two-dimensional image and the correspondence between the mapping points in the two-dimensional image and the model vertices of the target three-dimensional model, model parameters including the texture coordinates of the model vertices of the target three-dimensional model are obtained. Thus, by automatically segmenting and flattening the target three-dimensional model, the texture coordinates of the model vertices can be automatically obtained. This method is efficient and fast, and can handle complex three-dimensional models at the same time.

[0100] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of the apparatus, method, and computer program product according to multiple embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0101] In addition, each functional module in various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0102] When the above-mentioned functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art or a part of this technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs.

[0103] The foregoing are only the preferred embodiments of this application and are not intended to limit this application. For those skilled in the art, this application may have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included within the protection scope of this application.

Claims

1. A method for generating model parameters, characterized in that, The model parameters include texture coordinates of model vertices, and the method includes: Dividing the surface of the target 3D model into multiple regions, including: separating the target 3D model into independent sub-models according to the connectivity of the target 3D model; for each sub-model, sampling on the surface of the sub-model to determine a plurality of sampling points; dividing the model surface points of the sub-model into a clustering set centered on the sampling points, where a clustering set includes one sampling point, and the model surface points included in the clustering set form the region corresponding to the sampling point; For each region, generating a two-dimensional image corresponding to the region, where the two-dimensional image is a two-dimensional flattened image corresponding to the region, and the two-dimensional image includes mapping points corresponding to the model vertices of the target 3D model; According to the two-dimensional images corresponding to each region and the correspondence between the mapping points and the model vertices in the two-dimensional images, obtaining the texture coordinates of the model vertices of the target 3D model, including: randomly arranging the two-dimensional images corresponding to the same sub-model on a plane; detecting whether the current image arrangement causes the texture coordinates of the mapping points in the two-dimensional images to overlap, including: calculating the bounding boxes of each two-dimensional image and determining whether there is an overlap of the bounding boxes. If there is an overlap, it is determined that the current image arrangement causes the texture coordinates of the mapping points in the two-dimensional images to overlap. If there is no overlap, it is determined that the current image arrangement does not cause the texture coordinates of the mapping points in the two-dimensional images to overlap; in the case of yes, adjusting the current image arrangement to place the two-dimensional images on the plane in a non-overlapping manner of texture coordinates, and obtaining the texture coordinates of the mapping points corresponding to the model vertices in the plane after placement.

2. The method according to claim 1, wherein The dividing the model surface points of the sub-model into a clustering set centered on the sampling points includes: Determining the adjacent sampling points of each sampling point according to the positions of the sampling points; For each sampling point, determining a clustering set centered on the sampling point according to the position of the sampling point, the positions of the adjacent sampling points of the sampling point, and the positions of the other model surface points of the sub-model.

3. The method according to claim 1, characterized in that The method further includes: Obtaining the original vertex patch information of the target 3D model, where the original vertex patch information includes the correspondence between each patch and the model vertices included in the patch; According to the original vertex patch information, determining polygon patches with more than 3 model vertices, and performing triangulation on the determined polygon patches to divide the polygon patches into multiple triangular patches; After the triangulation, obtaining the vertex adjacency relationship of the target 3D model, where the vertex adjacency relationship includes the adjacent relationship between vertices and the adjacent relationship between vertices and patches; The generating a two-dimensional image corresponding to each region includes: Generating a two-dimensional image of the region according to the vertex adjacency relationship and preset constraint conditions.

4. The method according to claim 3, characterized in that, The generating a two-dimensional image of the region according to the vertex adjacency relationship and preset constraint conditions includes: Extracting the boundary of the region; Generate a two-dimensional image of the region according to the vertex adjacency relationship, boundary, and preset constraint conditions, where the preset constraint conditions include boundary minimum deformation constraint and / or triangle minimum deformation constraint.

5. The method according to claim 1, characterized in that, The method further includes: Input the target three-dimensional model and model parameters into a simulation engine.

6. A model parameter generation device, characterized in that, The model parameters include texture coordinates of model vertices, and the device includes: A segmentation module for segmenting the surface of the target three-dimensional model into multiple regions; A flattening module for generating a corresponding two-dimensional image for each region, where the two-dimensional image is a two-dimensional flattened image corresponding to the region, and the two-dimensional image includes mapping points corresponding to the model vertices of the target three-dimensional model; A coordinate determination module for obtaining the texture coordinates of the model vertices of the target three-dimensional model according to the two-dimensional images corresponding to each region and the correspondence between the mapping points and the model vertices in the two-dimensional images; Among them, the segmentation module is specifically used for: separating the target three-dimensional model into independent sub-models according to the connectivity of the target three-dimensional model; sampling on the surface of each sub-model to determine a plurality of sampling points; dividing the model surface points of the sub-model into a clustering set centered on the sampling points, where one clustering set includes one sampling point, and the model surface points included in the clustering set form the region corresponding to the sampling point; The coordinate determination module is specifically used for: randomly arranging the two-dimensional images corresponding to the same sub-model on a plane; detecting whether the current image arrangement causes the texture coordinates of the mapping points in the two-dimensional images to overlap; in the case of yes, adjusting the current image arrangement to place the two-dimensional images on the plane in a non-overlapping texture coordinate manner, and obtaining the texture coordinates of the mapping points corresponding to the model vertices in the plane after placement; The coordinate determination module detects whether there is an overlap in the following manner: calculating the bounding boxes of each two-dimensional image; determining whether there is an overlap of the bounding boxes; if there is, determining that the current image arrangement causes the texture coordinates of the mapping points in the two-dimensional images to overlap; if not, determining that the current image arrangement does not cause the texture coordinates of the mapping points in the two-dimensional images to overlap.

7. An electronic device, characterized in that, It includes a processor and a memory, and the memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the model parameter generation method described in any one of claims 1-5.

8. A readable storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by the processor, it implements the model parameter generation method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Three-dimensional model texture map conversion method and device

    CN108062784A

  • Model control method and device, storage medium and electronic device

    CN109448123A