Model generation method and apparatus, electronic device, and storage medium

WO2024234963A8PCT designated stage expired Publication Date: 2024-12-19DOUYIN VISION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/089816
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-18
Filing Date
2024-04-25
Publication Date
2024-12-19

AI Technical Summary

Technical Problem

The existing three-dimensional model resources are limited in how they are made in mobile applications, resulting in limited user selection of model resources and affecting user experience.

Method used

By responding to the user's model editing operation, obtain the bone parameters of the model bone, determine the model units, and fuse them to match the part shape, generate and display the target model, allowing the user to edit and create animated models in the running state.

Benefits of technology

It breaks the limitations of art personnel setting model resources in traditional technology, and users can freely create animation models to meet a variety of animation design needs and improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024089816_19122024_PF_FP_ABST
    Figure CN2024089816_19122024_PF_FP_ABST
Patent Text Reader

Abstract

A model generation method and apparatus, an electronic device, and a storage medium. The method comprises: in response to a model editing operation of a user, obtaining the bone parameters of each model bone in the edited model part; wherein the bone parameters are used for indicating the shape of the model part (S101); on the basis of the bone parameters, determining a model unit for each model bone of the model part (S103); and merging the model units of the model bones to obtain a target model matching the part shape, and displaying the target model on a display interface (S105).
Need to check novelty before this filing date? Find Prior Art

Description

Model generation method, device, electronic device and storage medium

[0001] This application claims priority to Chinese Patent Application No. 202310565335.7 filed on May 18, 2023, and the contents of the above-mentioned Chinese patent application disclosure are hereby incorporated by reference in their entirety as a part of this application. Technical Field

[0002] The present disclosure relates to a model generation method, device, electronic device and storage medium. Background Art

[0003] Currently, 3D model resources used in mobile applications are typically created by artists using art tools, such as 3D Max. Once the model resources are created, they can be used in mobile applications, for example, in mobile game clients. However, existing model resource creation methods have limitations, which restrict users' choice of model resources and thus affect their experience with the application.

[0004] Summary of the Invention

[0005] The embodiments of the present disclosure at least provide a model generation method, device, electronic device, and storage medium.

[0006] In a first aspect, an embodiment of the present disclosure provides a model generation method, comprising: in response to a user's model editing operation, obtaining bone parameters of each model bone of the edited model part; wherein the bone parameters are used to indicate the part morphology of the model part; determining model units for each model bone of the model part based on the bone parameters; fusing the model units of each model bone to obtain a target model that matches the part morphology, and displaying the target model on a display interface.

[0007] In an optional embodiment, the model units of each of the model bones are fused to obtain a target model that matches the morphology of the part, including: determining the regional marker points of the model editing area of ​​the target model; determining the model vertices based on the regional marker points and the model units of each of the model bones, and connecting the model vertices to obtain multiple model facets; and splicing the multiple model facets to obtain the target model.

[0008] In an optional embodiment, the area marking point is the voxel vertex of each voxel in the model editing area; determining the model vertex based on the area marking point and each model unit includes: determining a first positional relationship between each voxel vertex and each model unit; wherein the first positional relationship is used to indicate whether the voxel vertex is located inside the model unit; determining a target edge in the voxel based on the first positional relationship; wherein the target edge is an edge in the voxel that has an intersection with the model unit; determining the model vertex based on the position coordinates of the target voxel vertex located on the target edge.

[0009] In an optional embodiment, determining the target edge in the voxel based on the first positional relationship includes: obtaining a target mapping table; wherein the target mapping table is used to represent various positional relationships between the voxel vertices and each model unit for the voxel, and the intersection relationship between the edge of the voxel and the model unit; determining the intersection relationship that matches the first positional relationship based on the target mapping table; and determining the target edge in the voxel based on the matching intersection relationship.

[0010] In an optional embodiment, determining the first positional relationship between each voxel vertex and each model unit includes: determining the distance between each voxel vertex and the model center of each model unit; and determining the first positional relationship between each voxel vertex and each model unit based on the distance.

[0011] In an optional embodiment, the method further includes: determining vertex normals of each model vertex of the target model; determining brightness rendering information of the target model according to the vertex normals, and performing brightness rendering on the target model based on the brightness rendering information.

[0012] In an optional embodiment, the skeletal parameters of each model bone are obtained in response to the user's model editing operation, including: in response to a first editing operation on the spinal model, the spinal bone parameters of each spinal bone of the spinal model are obtained; wherein the spinal bone parameters are used to indicate the spinal morphology of the spinal part associated with the spinal bone; and / or, in response to a second editing operation on the limb model, the limb bone parameters of each limb bone of the limb model are obtained; wherein the limb bone parameters are used to indicate the limb morphology of the limb part associated with the limb bone.

[0013] In an optional embodiment, the limb bone parameters of each limb bone of the limb model are obtained in response to the second editing operation on the limb model, including: obtaining the bone position parameters of each limb bone in response to the position editing operation on the limb bone; and / or, obtaining the muscle morphology parameters of the limb muscles associated with the limb model in response to the muscle editing operation on the limb bone; wherein the muscle morphology parameters are used to indicate the model size of the model unit corresponding to each limb bone.

[0014] In an optional embodiment, the model part is a limb model, and the model skeleton is a limb skeleton; the method also includes: in response to a telescopic operation on the limb model in the target model, determining the telescopic distance of the limb model, and adjusting the model number of model units in the limb model according to the telescopic distance; determining the model spacing between adjacent model units in the limb model after adjustment and the model size of the model units in the limb model after adjustment, to obtain the adjusted target model.

[0015] In an optional embodiment, determining the model interval between adjacent model units in the limb model after adjustment and the model size of the model units in the limb model after adjustment to obtain the adjusted target model includes: when it is determined that the telescopic distance does not meet the distance requirement, determining the model interval between a first model unit and its adjacent second model unit as a first value, wherein the first value is the absolute value of the difference between the telescopic distance and the second value, and the second value is the product of the number of models of a third model unit and the model interval, and the third model unit is a model unit other than the first model unit; determining the model interval between the third model units as the model interval, and determining the model size of the first model unit as the first value.

[0016] In a second aspect, an embodiment of the present disclosure also provides a model generation device, comprising: an acquisition unit, for acquiring bone parameters of each model bone of the edited model part in response to a user's model editing operation; wherein the bone parameters are used to indicate the part morphology of the model part; a determination unit, for determining model units for each model bone of the model part based on the bone parameters; a fusion unit, for fusing the model units of each model bone to obtain a target model that matches the part morphology; and a display unit, for displaying the target model on a display interface.

[0017] In a third aspect, an embodiment of the present disclosure further provides an electronic device comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are performed.

[0018] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are executed. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without inventive effort.

[0020] FIG1 shows a flow chart of a model generation method provided by an embodiment of the present disclosure;

[0021] FIG2 shows a schematic diagram of a model effect of a target model provided by an embodiment of the present disclosure;

[0022] FIG3 shows a schematic diagram of an editing effect of a spine model provided by an embodiment of the present disclosure;

[0023] FIG4 shows a schematic diagram showing the effect of editing the number of spinal bones of a spinal column model provided by an embodiment of the present disclosure;

[0024] FIG5 is a schematic diagram showing the effect of editing the bone positions of the spinal bones of a spinal column model provided by an embodiment of the present disclosure;

[0025] FIG6 shows a schematic diagram showing the effect of editing the bone weights of the spinal bones of a spinal column model provided by an embodiment of the present disclosure;

[0026] FIG7 shows a schematic diagram of an editing effect of a limb model provided by an embodiment of the present disclosure;

[0027] FIG8 shows a schematic diagram of editing effects of another limb model provided by an embodiment of the present disclosure;

[0028] FIG9 is a flowchart showing a specific method for fusing the model units of each model skeleton to obtain a target model that matches the part morphology in the model generation method provided by an embodiment of the present disclosure;

[0029] FIG10 shows a schematic diagram of a model generation device provided by an embodiment of the present disclosure; and

[0030] FIG11 shows a schematic diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the disclosure for which protection is sought, but merely represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present disclosure.

[0032] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.

[0033] The term "and / or" herein simply describes an association relationship, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, and the existence of B alone. In addition, the term "at least one" herein refers to any combination of at least two of any one or more of a plurality of items. For example, "at least one of A, B, and C" can represent any one or more elements selected from the set consisting of A, B, and C.

[0034] Research has found that currently, 3D model resources used in mobile applications are typically created by artists using art tools, such as 3D Max. Once the model resources are created, they can be used in mobile applications, for example, in mobile game clients. However, existing model resource creation methods have limitations, which restrict users' choice of model resources, thus affecting their experience with the application.

[0035] Based on the above research, the present disclosure provides a model generation method, device, electronic device, and storage medium. In an embodiment of the present disclosure, a user can edit a model in an application. At this time, the application can respond to the model editing operation triggered by the user and obtain the skeletal parameters of each model bone of the model part edited by the user. The application can then determine model units for each model bone of the model part based on the skeletal parameters, and fuse the model units of each model bone to obtain a target model that matches the part morphology, and display the target model on the display interface of the application.

[0036] The above implementation allows users to edit and create animation models within a running application. For example, users can edit and create animation models within a running game program. This approach allows users to freely create their desired animation models, breaking the limitations of traditional techniques that require users to select from model resources pre-set by artists, thereby meeting users' diverse animation design needs.

[0037] To facilitate understanding of this embodiment, a model generation method disclosed in an embodiment of the present disclosure is first introduced in detail. The execution subject of the model generation method provided in the embodiment of the present disclosure is generally an electronic device with certain computing capabilities, such as a terminal device or a server or other processing device. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a handheld device, a computing device, etc. In some possible implementations, the model generation method can be implemented by a processor calling computer-readable instructions stored in a memory.

[0038] 1 , which is a flow chart of a model generation method provided by an embodiment of the present disclosure, includes steps S101 to S105 , wherein:

[0039] S101: In response to a user's model editing operation, obtaining bone parameters of each model bone of the edited model part; wherein the bone parameters are used to indicate the part morphology of the model part.

[0040] The model generation method provided by the embodiments of the present disclosure can be applied to any type of application that contains model resources. For example, the application can be a game application. In this case, a model editing trigger button is set in the game application, and after detecting the user's triggering operation on the model editing trigger button, it is determined that the user's model editing operation is detected.

[0041] Afterwards, the user can generate a corresponding model, i.e., a target model, for the game character he wants to play in the game application according to the model generation method provided in the embodiment of the present disclosure. At this time, the application can include an editing interactive interface through which the user can edit the model.

[0042] In specific implementations, the application can detect the user's model editing operation and, in response to the model editing operation, obtain the bone parameters of each model bone of the model part edited by the user, wherein the bone parameters include the number of bones, bone weights, and bone positions. The number of bones is used to indicate the number of model bones contained in the model part, the bone weights are used to indicate the part morphology (or part size) of the sub-parts in the model part associated with the model bones, and the bone positions are used to indicate the locations of the model bones.

[0043] In the disclosed embodiment, the model parts can be divided into a spine model and a limb model. In this case, the model skeleton can be divided into a spine skeleton and a limb skeleton. That is, the user can edit the spine model and the limb model in the editing interaction interface. Then, in response to the model editing operation on the spine model, the skeletal parameters of the spine skeleton are obtained, and in response to the model editing operation on the limb model, the skeletal parameters of the limb skeleton are obtained.

[0044] S103: Determine a model unit for each model bone of the model part based on the bone parameters.

[0045] Here, model units can be determined for each model bone of a model part based on the number of bones and bone weights, where the model unit can be a metaball model. In specific implementations, a metaball model can be determined for each model bone based on the number of bones, with the position of the model bone serving as the center of the metaball model, and the bone weight of the model bone serving as the radius of the metaball model.

[0046] S105: Fusing the model units of the model skeletons to obtain a target model that matches the part morphology, and displaying the target model on a display interface.

[0047] After determining the model units for each model skeleton of each model part, the model units can be fused to obtain a target model that matches the part morphology. For example, FIG2 is a schematic diagram of an optional target model.

[0048] In an embodiment of the present disclosure, a user can edit a model in an application. In response to the user-triggered model editing operation, the application can obtain skeletal parameters for each model bone of the model part being edited. The application can then determine model units for each model bone of the model part based on the skeletal parameters, fuse the model units of each model bone, and obtain a target model that matches the part morphology. The target model is then displayed on the application's display interface.

[0049] The above implementation allows users to edit and create animation models within a running application. For example, users can edit and create animation models within a running game program. This approach allows users to freely create their desired animation models, breaking the limitations of traditional techniques that require users to select from model resources pre-set by artists, thereby meeting users' diverse animation design needs.

[0050] The above steps will be described in detail below in conjunction with specific implementation methods.

[0051] In an optional embodiment, the above step S101 obtains the bone parameters of each model bone in response to the user's model editing operation, and specifically includes the following steps:

[0052] Step S1011: in response to the first editing operation on the spinal column model, obtaining spinal column parameters of each spinal column bone of the spinal column model; wherein the spinal column parameters are used to indicate the spinal column morphology of the spinal column part associated with the spinal column bone;

[0053] In the disclosed embodiment, a user's model editing operation is first detected, and in response to the model editing operation, the skeletal parameters of each model bone of the edited model part are obtained. The following uses the spinal model as an example to describe the above model editing operation in conjunction with Figures 2 to 5.

[0054] In an embodiment of the present disclosure, first, an application is opened and the model type selected by the user to be created is received, wherein the model type is used to indicate the type of model to be created and / or the size of the model to be created. A model editing area is created based on the model type, and the model to be edited in an initial state is displayed in the model editing area. Here, the model to be edited in the initial state can be a spinal model in an initial state, wherein being in the initial state means that the number of bones in the spinal model is the initial number, for example, 1 spinal bone, or 2 spinal bones, etc., which is not specifically limited in the present disclosure.

[0055] Next, a first editing operation of the user on the spinal model may be detected, and after detecting the first editing operation, spinal bone parameters of each spinal bone of the spinal model may be obtained, wherein the spinal bone parameters include: the number of spinal bones, the bone weight of the spinal bones, and the bone position of the spinal bones.

[0056] During specific implementation, the user's quantity editing operation on the spinal model can be detected. As shown in Figure 3, the two sides of the spinal model contain arrows. At this time, the quantity editing operation can be detected by detecting the user's dragging operation or clicking operation on the left and right arrows. For example, for the right arrow, if the user is detected to drag the right arrow to the right, it is determined that the quantity editing operation is detected, and the quantity editing operation is an operation indicating that the number of spinal bones is increased from the right side of the spinal model. For example, for Figure 3, after the user drags the right arrow to the right, the spinal model shown in Figure 4 can be obtained. For another example, for the right arrow, if the user is detected to drag the right arrow to the left, it is determined that the quantity editing operation is detected, and the quantity editing operation is an operation indicating that the number of spinal bones is reduced from the right side of the spinal model.

[0057] Here, while editing the number of bones of the spinal bones, the user may also edit the bone positions and / or bone weights of the spinal bones of the spinal model.

[0058] In an optional embodiment, the user's bone dragging operation on the spinal bones in the spinal model can be detected, and the bone orientation of the dragged spinal bones can be determined based on the bone dragging operation; wherein the bone orientation includes the position and direction of the spinal bones. Afterwards, the bone orientation of other spinal bones can be determined based on the bone orientation of the dragged spinal bones. At this time, the bone position of the spinal bones can be determined based on the bone orientation of each spinal bone. For example, the spinal model after the bone position is edited is shown in Figure 5.

[0059] In another optional embodiment, the user's bone click operation on the spinal bones in the spinal model can be detected, and the clicked spinal bone can be determined based on the bone click operation. Thereafter, the bone weight of the clicked spinal bone can be adjusted according to the number of bone click operations.

[0060] For each bone click operation, the bone weight of the clicked spinal bone can be adjusted according to a preset value. For example, the bone weight of the clicked spinal bone can be reduced or increased according to a preset value. For example, Figure 6 shows the spinal model after the bone weights have been edited.

[0061] Step S1012: In response to the second editing operation on the limb model, limb bone parameters of each limb bone of the limb model are obtained; wherein the limb bone parameters are used to indicate the limb morphology of the limb part associated with the limb bone.

[0062] In the disclosed embodiment, after editing the spine model in the manner described above, the limb model can also be edited. Here, the user's editing operation on the limb model can be detected to obtain limb bone parameters of each limb bone in the limb model, wherein the limb bone parameters include: limb bone weights and limb bone positions of the limb bones.

[0063] When editing a limb model, the positions and weights of the bones of each limb of the limb model can be edited. The following describes the second editing operation of the limb model using a limb model as an example, with reference to FIG7 and FIG8 .

[0064] In the disclosed embodiment, multiple limb templates can be pre-set in the application. For example, multiple templates can be set for arms, legs, necks, tails, wings, and ornaments. Subsequently, the application can detect the user's click and drag operation on the limb template. After detecting that the limb template has been dragged to the model editing area and that the limb template has been released, the limb model corresponding to the limb template is added to the spine model in the model editing area. For example, four limbs can be added to the spine model, thereby obtaining the model shown in FIG7 .

[0065] For each limb template, corresponding joints are pre-set, where the locations and / or numbers of joints vary between limb templates. The pre-set joints in a limb template can be understood as the limb skeleton of the limb model. For each limb skeleton in a limb template, initial bone weights are pre-set to describe the initial morphology of the corresponding limb part.

[0066] After adding limb models to the spine model, users can edit the bone positions and bone weights of the limb bones of the limb models.

[0067] In a specific implementation, after detecting a user's position editing operation on a limb bone in a limb model, the skeletal position parameters of each limb bone can be obtained in response to the position editing operation on the limb bone; wherein the skeletal position parameters can be understood as the position coordinates of the limb bone. Here, the position editing operation can be detected by detecting a user's dragging operation on a limb bone (or joint point), thereby determining the skeletal position parameters of the dragged limb bone based on the user's dragged position of the limb bone.

[0068] In specific implementation, after detecting the user's muscle editing operation on the limb bones in the limb model, the muscle morphological parameters of the limb muscles associated with the limb model (i.e., the bone weights of the limb bones) can be obtained in response to the muscle editing operation on the limb bones; wherein the muscle morphological parameters are used to indicate the model size of the model unit corresponding to each of the limb bones.

[0069] Here, you can pre-set multiple muscle files, each corresponding to a specific muscle shape. In other words, the muscle file can be linked to the way the meta ball model of each limb bone in the limb model changes. For example, the muscle file can include the sphere radius of the meta ball model of each limb bone in the limb model.

[0070] In the disclosed embodiments, muscle editing operations can be detected by detecting a user's file selection operation on a muscle file. After detecting the file selection operation, the selected muscle file can be determined. The sphere radius of the meta-sphere model corresponding to the limb model can then be modified based on the sphere radius contained in the muscle file. After modification, a limb model with the corresponding muscle morphology can be obtained. For example, the animation model shown in Figure 8 can be obtained.

[0071] In the embodiment of the present disclosure, after obtaining the bone parameters of each model bone of the edited model part in the manner described above, a target model matching the part morphology can be generated through the process described in the above steps S103 and S105, and the target model can be displayed on the display interface, for example, the spinal model is displayed in the editing interaction interface shown in Figures 2 to 6.

[0072] In an optional embodiment, as shown in FIG9 , the above step S105 of fusing the model units of the model skeletons to obtain a target model that matches the part morphology specifically includes the following steps:

[0073] Step S901: determining the region marking points of the model editing region of the target model;

[0074] Step S902: determining model vertices based on the regional marking points and the model units of each model skeleton, and connecting the model vertices to obtain a plurality of model patches;

[0075] Step S903: splicing the multiple model facets to obtain the target model.

[0076] In the embodiment of the present disclosure, first, a meta model (i.e., a model unit) is determined for each model bone based on the number of bones. For example, the bone position of the model bone can be used as the sphere center of the meta model, and the bone weight of the model bone can be used as the sphere radius of the meta model. Then, the model editing area is divided into multiple voxels. For example, the model editing area can be divided into multiple cubes or cuboids, where the cubes or cuboids are voxels. Thereafter, the regional marker points of the model editing area can be determined based on the multiple voxels. For example, the voxel vertex and / or voxel center point of each voxel can be determined as the regional marker point.

[0077] After determining the regional markers, the field values ​​between the regional markers and each meta model can be determined. Based on these field values, the positional relationships between each regional marker and each meta model can be determined. Once these positional relationships are determined, model vertices can be determined based on these relationships. These model vertices can be understood as the intersections between the edges of each voxel and the meta model. These model vertices can then be concatenated to create multiple model patches. These multiple model patches are then concatenated to create the target model.

[0078] In the above implementation, the method of determining the model vertices by the field values ​​between the regional markers and the model units can more quickly determine the model vertices, thereby quickly obtaining the target model. For applications with high timeliness requirements, a better animation model can still be obtained.

[0079] In the case where the region marking points are voxel vertices of each voxel in the model editing region, in an optional embodiment, the step S902 of determining the model vertices based on the region marking points and each of the model units specifically includes the following steps:

[0080] Step S9021: determining a first positional relationship between each voxel vertex and each model unit; wherein the first positional relationship is used to indicate whether the voxel vertex is located inside the model unit;

[0081] Step S9022: determining a target edge in the voxel based on the first positional relationship; wherein the target edge is an edge in the voxel that has an intersection with the model unit;

[0082] Step S9023: Determine the model vertex based on the position coordinates of the target voxel vertex located on the target edge.

[0083] In the disclosed embodiment, a first positional relationship between each voxel vertex of each voxel and each meta model can be determined. For example, if the voxel is a cube (or a cuboid), the voxel vertices can be determined to be the eight vertices of the cube (or cuboid). Next, a field value can be calculated between each voxel vertex and the meta model, and the first positional relationship can be determined based on the field value. The field value is determined based on the distance between the voxel vertex and the center of the meta model.

[0084] Here, the distance between each voxel vertex and the model center of each model unit may be determined; and the first positional relationship between each voxel vertex and each model unit may be determined based on the distance.

[0085] For example, the distance between the voxel vertex and the sphere center can be determined, and the ratio between the distance and the sphere radius (or the ratio between the sphere radius and the distance) can be determined, and then the field value can be determined based on the ratio. For example, the ratio can be determined as the field value, or the square or cube of the ratio, or other values ​​determined based on the ratio, can be used as the field value. The present disclosure does not specifically limit the method for calculating the field value, and any method that can be implemented shall prevail.

[0086] Here, the first positional relationship is the positional relationship between each region marker and each meta model described in the above embodiment. This first positional relationship can be used to determine whether a voxel vertex is located within the meta model. In other words, this first positional relationship can be used to determine whether a voxel vertex is located inside or outside the meta model.

[0087] Assume that the field value is the ratio between the sphere radius and the distance (the distance between the voxel vertex and the sphere center). If this ratio is less than the field value threshold, the voxel vertex is determined to be outside the meta model and has no intersection with the meta model. If the ratio is greater than the field value threshold, the voxel vertex is determined to be inside the meta model and has no intersection with the meta model. The field value threshold can be understood as the ratio between the sphere radius and the distance when the voxel vertex is located on the meta model.

[0088] After determining the first positional relationship between each voxel vertex and each meta-ball model, a target edge intersecting with the meta-ball model may be determined among each edge of each voxel based on the first positional relationship.

[0089] Specifically, for each voxel edge having two voxel vertices, if one voxel vertex is located inside the meta-ball model and the other voxel vertex is located outside the meta-ball model, it is determined that there is an intersection between the edge and the meta-ball model, and the edge is determined to be a target edge.

[0090] After the target edge is determined, the position information of the model vertex can be determined based on the distance between the voxel vertex of the target edge (ie, the target voxel vertex) and the meta-ball model and the position coordinates of the target voxel vertex.

[0091] In specific implementation, the field value threshold corresponding to the target voxel vertex can be determined, and then the position coordinates of the target voxel vertex can be determined; then, the field value threshold and the position coordinates are interpolated to obtain the position coordinates of the intersection, and the position coordinates of the intersection calculated by interpolation are determined as the position information of the model vertex.

[0092] In the embodiment of the present disclosure, after determining multiple model vertices, for a single voxel, the model vertices can be connected according to a preset triangle order to obtain a model patch. Then, the models and patches of all voxels are fused to obtain the target model.

[0093] In the above embodiment, by determining the first positional relationship between the voxel vertex and the model unit to determine the target edge having an intersection with the model unit in the voxel, the model vertex can be determined more quickly, thereby meeting the timeliness requirements of the application.

[0094] In an optional embodiment, the step S9022 of determining the target edge in the voxel based on the first positional relationship specifically includes the following steps:

[0095] Step S11: obtaining a target mapping table; wherein the target mapping table is used to represent various positional relationships between voxel vertices and each model unit, and intersection relationships between edges of the voxel and the model unit;

[0096] Step S12: determining an intersection relationship matching the first position relationship based on the target mapping table;

[0097] Step S13: determining a target edge in the voxel based on the matched intersection relationship.

[0098] In an embodiment of the present disclosure, a target mapping table can be created in advance, wherein the target mapping table contains multiple data, which are used to indicate the entire positional relationship between each voxel vertex and the model unit, as well as the intersection relationship between each edge of the voxel and the model unit under each positional relationship.

[0099] In specific implementation, the 8 voxel vertices of each voxel can be numbered 1-8. There are two positional relationships between each voxel vertex and the model unit, namely, being inside the model unit and being outside the model unit. If the voxel vertex is inside the model unit, it is represented by 0; if the voxel vertex is outside the model unit, it is represented by 1. At this time, a set of 8-bit data can be used to represent a positional relationship between each voxel vertex and the model unit. In other words, the target mapping table contains multiple sets of 8-bit data, and the multiple sets of 8-bit data can enumerate all the positional relationships between each voxel vertex and the model unit.

[0100] For each set of 8-bit data, there is also a corresponding set of 12-bit data, where the 12-bit data is used to indicate the intersection relationship between each edge of the voxel and the model unit for each set of 8-bit data. Each bit of the 12-bit data is used to indicate the intersection relationship between an edge of the voxel and the model unit, for example, 0 indicates no intersection and 1 indicates intersection.

[0101] After determining the first positional relationship between each voxel vertex and each model unit, the target mapping table may be obtained, and target data matching the first positional relationship may be searched for in multiple pieces of data in the target mapping table.

[0102] In a specific implementation, the first positional relationship between the voxel vertices and each model unit can be determined according to the order of the voxel vertex numbers. If the first positional relationship is located inside the model unit, it is represented by 0, and if the first positional relationship is located outside the model unit, it is represented by 1. In this case, the first positional relationship can be converted into a numerical value represented by 0 and 1, and the numerical value can be matched with multiple data in the target mapping table to obtain target data that matches the numerical value.

[0103] At this point, the intersection relationship in the target data can be determined, and the intersection relationship can be determined as the intersection relationship that matches the first position relationship. Thereafter, the target edge that intersects with the model unit can be determined in each voxel based on the matching intersection relationship.

[0104] In the above embodiment, by pre-creating a target mapping table and determining the target edge that intersects with the model unit in the voxel based on the target mapping table, the method of determining the target edge can be simplified, so that the edge that intersects with the model unit in each voxel can be determined more quickly, thereby meeting the timeliness requirements of the application.

[0105] Based on the embodiment shown in FIG1 above, the method provided in the embodiment of the present disclosure further includes the following steps:

[0106] Step S106: determining the vertex normal of each vertex of the target model;

[0107] Step S107: determining brightness rendering information of the target model according to the vertex normals, and performing brightness rendering on the target model based on the brightness rendering information.

[0108] In the disclosed embodiment, in order to make the model effect of the target model more realistic, it is also necessary to adjust the model brightness of the target model. Here, the vertex normal of each model vertex of the target model can be determined, and then the brightness of the target model can be rendered based on the vertex normal, thereby obtaining a more realistic target model.

[0109] In an optional embodiment, the normal of each model patch of the target model may be determined, thereby determining the normal of each model vertex based on the normal of the model patch.

[0110] In specific implementations, each model patch of the target model contains three model vertices, where these three model vertices can form two vectors. At this point, a cross product calculation can be performed on these two vectors, and the cross product calculation result can be normalized to obtain the normal of the model patch. For a model vertex in the target model that is adjacent to multiple model patches, the normals of the adjacent model patches can be determined, and normal interpolation calculation can be performed on the normals of the adjacent model patches to obtain the vertex normal of the model vertex.

[0111] In another optional embodiment, a vertex field value can be calculated for each model vertex. For example, the vertex field value can be determined based on the distance between the model vertex and the center of the corresponding meta model. The gradient of the vertex field value can then be calculated, and the direction of the fastest change in the vertex field value can be determined based on the gradient as the normal direction.

[0112] In specific implementation, the gradient of the vertex field value can be calculated by performing a differential operation on the vertex field value. Then, the direction in which the vertex field value changes fastest can be determined based on the differential operation result, and this direction can be determined as the normal direction of the model vertex.

[0113] After the vertex normals are determined, the brightness rendering information of the target model can be determined according to the vertex normals, and then the brightness rendering of the target model is performed based on the brightness rendering information to obtain an animation model with a more realistic model effect.

[0114] When the model part is a limb model and the model skeleton is a limb skeleton, the method provided in the embodiment of the present disclosure further includes the following steps:

[0115] Step S21: in response to a telescoping operation on a limb model in the target model, determining a telescoping distance of the limb model, and adjusting the number of model units in the limb model according to the telescoping distance;

[0116] Step S22: determining the model interval between adjacent model units in the adjusted limb model and the model size of the model units in the adjusted limb model to obtain the adjusted target model.

[0117] In the disclosed embodiment, after obtaining the target model in the manner described above, the user can further perform scaling adjustments on the limb model within the target model. In this case, the scaling operation performed by the user on the limb model within the target model can be detected, and in response to the scaling operation, the scaling type of the scaling operation can be determined, for example, limb extension or limb shortening. Subsequently, the scaling distance of the limb model can be determined, for example, the extension distance or shortening distance.

[0118] After determining the scaling distance, the number of model units in the limb model can be adjusted accordingly. As can be seen from the above description, the limb skeletons of the limb model are the joints of the limb template, and the model units in the limb model are the meta models of each joint, with one meta model corresponding to each joint. Based on this, scaling the limb model can increase or decrease the number of limb skeletons between adjacent joints.

[0119] After the number of model units of the limb model is adjusted based on the number of models, the adjusted target model can be determined based on the adjusted model intervals between adjacent model units and the model sizes of the model units in the adjusted limb model.

[0120] In an optional embodiment, a ratio can be pre-set, where the ratio can be understood as the ratio between the telescopic distance and the number of models. For example, the ratio can be set to 1. The number of models can then be adjusted based on the ratio and the telescopic distance. For example, if the telescopic distance is changed to 20 cm, the number of models is adjusted to 20, with the model spacing between adjacent model units being equal.

[0121] In practice, the number of metaballs (i.e., the number of models) can be calculated based on the telescoping distance, with the model spacing between adjacent metaballs being equal (i.e., the distance between the centers of adjacent metaballs being the same). In this case, the model spacing between adjacent metaballs is equal to the telescoping distance divided by the number of models. This approach successfully maintains muscle morphology.

[0122] In an optional embodiment, the step of determining the model spacing between adjacent model units in the limb model after adjustment and the model size of the model units in the limb model after adjustment to obtain the adjusted target model further includes the following steps:

[0123] Step S31: If it is determined that the telescopic distance does not meet the distance requirement, determining a model interval between a first model unit and an adjacent second model unit to be a first value, wherein the first value is the absolute value of the difference between the telescopic distance and the second value, and the second value is the product of the number of models of a third model unit and the model interval, and the third model unit is a model unit other than the first model unit;

[0124] Step S32: determining the model interval between the third model units as the model interval, and determining the model size of the first model unit as the first value.

[0125] In an embodiment of the present disclosure, if it is determined that the ratio between the telescopic distance and the number of models is a decimal, and / or it is determined that the telescopic distance has decimal places, then it is determined that the telescopic distance does not meet the distance requirement. At this time, the model interval between the first model unit and the second adjacent model unit can be determined to be a first value, wherein the first model unit can be a model unit corresponding to a limb bone away from the spine model in the limb model (or, a model unit corresponding to a limb bone located at the end of the limb of the limb model), and the second model unit is a model unit close to the spine model side and adjacent to the first model unit.

[0126] Here, if the number of model units contained in the limb model is N, then the first model unit can be understood as the last model unit of the limb model, and the third model unit can be understood as the remaining model units except the last model unit. At this time, the number of the third model units is N-1, and the second value is the product of (N-1) and the model interval P: (N-1) and *P. If the telescopic distance is S, then the difference between S and ((N-1)*P) can be calculated, and the absolute value of the difference can be used as the first value. In other words, the model interval between the first model unit and the second model unit is S-((N-1)*P), and the model interval between any adjacent model units in the third model unit is P. Through this processing method, the jitter generated by the limb model during the telescopic process can be alleviated, thereby obtaining an animation model with better stability.

[0127] Those skilled in the art will understand that in the above-mentioned method of the specific implementation method, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0128] Based on the same inventive concept, a model generation device corresponding to the model generation method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned model generation method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0129] 10 is a schematic diagram of a model generation device provided by an embodiment of the present disclosure, the device includes: an acquisition unit 10, a determination unit 20, a fusion unit 30 and a display unit 40; wherein,

[0130] The acquisition unit 10 is configured to acquire, in response to a user's model editing operation, bone parameters of each model bone of the edited model part; wherein the bone parameters are used to indicate the part morphology of the model part;

[0131] a determining unit 20, configured to determine a model unit for each model bone of the model part based on the bone parameters;

[0132] A fusion unit 30 is used to fuse the model units of the model skeletons to obtain a target model that matches the morphology of the part;

[0133] The display unit 40 is configured to display the target model on a display interface.

[0134] In an embodiment of the present disclosure, a user can edit a model in an application. In response to a user-triggered model editing operation, the application can obtain skeletal parameters for each model bone of the model part being edited. The application can then determine model units for each model bone of the model part based on the skeletal parameters, fuse the model units of each model bone, and obtain a target model that matches the part morphology. The target model is then displayed on the application's display interface.

[0135] The above implementation allows users to edit and create animation models within a running application. For example, users can edit and create animation models within a running game program. This approach allows users to freely create their desired animation models, breaking the limitations of traditional techniques that require users to select from model resources pre-set by artists, thereby meeting users' diverse animation design needs.

[0136] In one possible implementation, the fusion unit is further used to: determine the regional marker points of the model editing area of ​​the target model; determine the model vertices based on the regional marker points and the model units of each of the model bones, and connect the model vertices to obtain multiple model facets; and splice the multiple model facets to obtain the target model.

[0137] In one possible embodiment, when the area marking point is the voxel vertex of each voxel in the model editing area, the fusion unit is further used to: determine a first positional relationship between each voxel vertex and each model unit; wherein the first positional relationship is used to indicate whether the voxel vertex is located inside the model unit; determine a target edge in the voxel based on the first positional relationship; wherein the target edge is an edge in the voxel that has an intersection with the model unit; and determine the model vertex based on the position coordinates of the target voxel vertex located on the target edge.

[0138] In one possible implementation, the fusion unit is further used to: obtain a target mapping table; wherein the target mapping table is used to represent various positional relationships between the voxel vertices of the voxel and each model unit, and the intersection relationship between the edge of the voxel and the model unit; determine the intersection relationship that matches the first positional relationship based on the target mapping table; and determine the target edge in the voxel based on the matching intersection relationship.

[0139] In a possible implementation, the fusion unit is further configured to: determine a distance between each voxel vertex and a model center of each model unit; and determine a first positional relationship between each voxel vertex and each model unit based on the distance.

[0140] In a possible implementation, the device is further used to: determine the vertex normals of each model vertex of the target model; determine brightness rendering information of the target model based on the vertex normals, and perform brightness rendering on the target model based on the brightness rendering information.

[0141] In one possible embodiment, the acquisition unit is further used to: in response to a first editing operation on the spinal model, obtain spinal bone parameters of each spinal bone of the spinal model; wherein the spinal bone parameters are used to indicate the spinal morphology of the spinal part associated with the spinal bone; and / or, in response to a second editing operation on the limb model, obtain limb bone parameters of each limb bone of the limb model; wherein the limb bone parameters are used to indicate the limb morphology of the limb part associated with the limb bone.

[0142] In one possible embodiment, the acquisition unit is further used to: obtain the bone position parameters of each limb bone in response to a position editing operation on the limb bones; and / or, obtain the muscle morphology parameters of the limb muscles associated with the limb model in response to a muscle editing operation on the limb bones; wherein the muscle morphology parameters are used to indicate the model size of the model unit corresponding to each limb bone.

[0143] In one possible embodiment, the device is further used to: when the model part is a limb model and the model skeleton is a limb skeleton, in response to a telescopic operation on the limb model in the target model, determine the telescopic distance of the limb model and adjust the model number of model units in the limb model according to the telescopic distance; determine the model spacing between adjacent model units in the limb model after adjustment and the model size of the model units in the limb model after adjustment, to obtain the adjusted target model.

[0144] In one possible embodiment, the device is further used to: when it is determined that the telescopic distance does not meet the distance requirement, determine the model interval between the first model unit and its adjacent second model unit as a first value, wherein the first value is the absolute value of the difference between the telescopic distance and the second value, and the second value is the product of the number of models of a third model unit and the model interval, and the third model unit is a model unit other than the first model unit; determine the model interval between the third model units as the model interval, and determine the model size of the first model unit as the first value.

[0145] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference can be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.

[0146] Corresponding to the model generation method in FIG1 , an embodiment of the present disclosure further provides an electronic device 1100 . FIG11 is a schematic structural diagram of the electronic device 1100 provided in an embodiment of the present disclosure, including:

[0147] Processor 111, memory 112, and bus 113; memory 112 is used to store execution instructions, including internal memory 1121 and external memory 1122; memory 1121 herein, also referred to as internal memory, is used to temporarily store operation data in processor 111, as well as data exchanged with external memory 1122 such as a hard disk. Processor 111 exchanges data with external memory 1122 via memory 1121. When electronic device 1100 is running, processor 111 communicates with memory 112 via bus 113, causing processor 111 to execute the following instructions:

[0148] In response to a model editing operation by a user, bone parameters of each model bone of the edited model part are obtained; wherein the bone parameters are used to indicate the part morphology of the model part;

[0149] determining a model unit for each model bone of the model part based on the bone parameters;

[0150] The model units of the model skeletons are fused to obtain a target model that matches the morphology of the part, and the target model is displayed on a display interface.

[0151] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program executes the steps of the model generation method described in the above method embodiment. The storage medium may be a volatile or non-volatile computer-readable storage medium.

[0152] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0154] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0155] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0156] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The scope of protection of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed in the present disclosure, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure shall be subject to the scope of protection of the claims.

Claims

1. A model generation method, include: In response to the user's model editing operation, the bone parameters of each model bone of the edited model part are obtained; wherein the bone parameters are used to indicate the part morphology of the model part; Determining a model unit for each model bone of the model part based on the bone parameters; The model units of the model skeletons are fused to obtain a target model that matches the morphology of the part, and the target model is displayed on a display interface.

2. The method according to claim 1, in, The step of fusing the model units of the model skeletons to obtain a target model matching the part morphology includes: Determining region marking points of a model editing region of the target model; Determine model vertices based on the regional marking points and the model units of each model skeleton, and connect the model vertices to obtain a plurality of model patches; The multiple model face pieces are spliced ​​together to obtain the target model.

3. The method according to claim 2, in, The region marking points are the voxel vertices of each voxel in the model editing region; The determining of the model vertices based on the regional marking points and the model units of each of the model bones comprises: Determine a first positional relationship between each of the voxel vertices and each of the model units; wherein the first positional relationship is used to indicate whether the voxel vertex is located inside the model unit; Determine a target edge in the voxel based on the first positional relationship; wherein the target edge is an edge in the voxel that has an intersection with the model unit; The model vertex is determined based on the position coordinates of the target voxel vertex located on the target edge.

4. The method according to claim 3, in, The determining of the target edge in the voxel based on the first positional relationship comprises: Obtaining a target mapping table; wherein the target mapping table is used to characterize various positional relationships between voxel vertices of a voxel and each model unit, and intersection relationships between edges of the voxel and the model unit; Determining an intersection relationship matching the first position relationship based on the target mapping table; A target edge is determined in the voxel based on the matched intersection relationship.

5. The method according to claim 3, in, The determining of the first positional relationship between each of the voxel vertices and each of the model units comprises: Determining the distance between each of the voxel vertices and the model center of each of the model units; A first positional relationship between each of the voxel vertices and each of the model units is determined based on the distance.

6. The method according to any one of claims 1 to 5, further comprising: include: Determining vertex normals of each model vertex of the target model; The brightness rendering information of the target model is determined according to the vertex normal, and the brightness rendering is performed on the target model based on the brightness rendering information.

7. The method according to any one of claims 1 to 6, in, The step of obtaining the bone parameters of each model bone of the edited model part in response to the user's model editing operation includes: In response to a first editing operation on the spinal column model, spinal column bone parameters of each spinal column bone of the spinal column model are obtained; wherein the spinal column bone parameters are used to indicate the spinal column morphology of the spinal column part associated with the spinal column bone; and / or In response to a second editing operation on the limb model, limb bone parameters of each limb bone of the limb model are obtained; wherein the limb bone parameters are used to indicate the limb morphology of the limb part associated with the limb bone.

8. The method according to claim 7, in, The step of obtaining limb bone parameters of each limb bone of the limb model in response to the second editing operation on the limb model includes: In response to the position editing operation on the limb bones, acquiring the bone position parameters of each of the limb bones; and / or In response to the muscle editing operation on the limb skeleton, muscle morphological parameters of the limb muscles associated with the limb model are obtained; wherein the muscle morphological parameters are used to indicate the model size of the model unit corresponding to each of the limb skeletons.

9. The method according to any one of claims 1 to 8, in, The model part is a limb model, and the model skeleton is a limb skeleton; the method further comprises: In response to a telescoping operation on a limb model in the target model, determining a telescoping distance of the limb model, and adjusting the number of model units in the limb model according to the telescoping distance; Determine the model spacing between adjacent model units in the limb model after adjustment and the The model size of the model unit in the limb model is adjusted to obtain the adjusted target model.

10. The method according to claim 9, in, The step of determining the model interval between adjacent model units in the limb model after adjustment and the model size of the model unit in the limb model after adjustment to obtain the adjusted target model includes: When it is determined that the telescopic distance does not meet the distance requirement, determining that the model interval between the first model unit and the second model unit adjacent to it is a first value, wherein the first value is an absolute value of a difference between the telescopic distance and the second value, and the second value is a product of the number of models of a third model unit and the model interval, and the third model unit is a model unit other than the first model unit; The model interval between the third model units is determined as the model interval, and the model size of the first model unit is determined as the first value.

11. A model generating device, include: An acquisition unit is configured to acquire, in response to a model editing operation by a user, bone parameters of each model bone of the edited model part; wherein the bone parameters are used to indicate the part morphology of the model part; a determination unit configured to determine a model unit for each model bone of the model part based on the bone parameters; A fusion unit is configured to fuse the model units of the model skeletons to obtain a target model that matches the part morphology; The display unit is configured to display the target model on a display interface.

12. An electronic device, include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the model generation method as described in any one of claims 1 to 10 is performed.

13. A computer-readable storage medium storing a computer program, in, When the computer program is executed by a processor, the model generation method according to any one of claims 1 to 10 is executed.