Adaptation methods, devices, and terminal equipment for virtual equipment models
By determining the target vertex deformation function in the virtual equipment model and using radial basis functions and polynomial compensation functions, combined with skeletal skinning information, the problems of low deformation efficiency and poor stability of virtual equipment models among characters of different body types are solved, achieving efficient and stable deformation adaptation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-19
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies suffer from low efficiency, high cost, and unstable deformation effects when creating virtual equipment for virtual characters of different body types. In particular, the FFD deformation tool requires a lot of manual interaction and adjustment, while the Maya wrap deformation tool has poor deformation effect stability and low operating efficiency.
By acquiring source and target object models with the same topology but different body sizes, the target vertex deformation function is determined. The initial vertex deformation function is constructed using radial basis functions and polynomial compensation functions. Combined with skeleton skinning information, the target equipment model is generated, achieving high efficiency and stability in deformation.
It significantly improves the deformation efficiency of virtual equipment models, reduces the need for manual adjustments, enhances the stability of deformation effects, and adapts to virtual character equipment of different body types.
Smart Images

Figure CN114733201B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of game technology, and in particular to a method, apparatus and terminal device for adapting virtual equipment models. Background Technology
[0002] To maximize player experience, large-scale MMORPGs (Multiplayer Online Role-Playing Games) often design virtual characters with various body types. To ensure the same equipment looks different on different body types, separate equipment assets need to be created for each body type, a process that is time-consuming and costly. Related technologies propose using Free Form Deformation (FFD) tools or Maya's wrap-and-deform tool to deform equipment to adapt it to different body types. However, FFD requires extensive manual adjustments, still resulting in significant time and cost. Maya's wrap-and-deform tool can only handle relatively uniformly topological models; when the model has densely packed points, it fails to achieve the desired deformation effect, indicating poor stability. Furthermore, the efficiency of Maya's wrap-and-deform tool is affected by the model's polygon count; therefore, as the polygon count increases, deformation using Maya's wrap-and-deform tool becomes increasingly time-consuming.
[0003] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method, apparatus and terminal device for adapting virtual equipment models, which can not only significantly improve the efficiency of deforming virtual equipment models, but also effectively improve the stability of the deformation effect.
[0005] In a first aspect, embodiments of the present invention provide a method for adapting a virtual equipment model, comprising: acquiring a source object model and a target object model; wherein the source object model is equipped with a source equipment model, and the source object model and the target object model have the same topology but different body size; determining a target vertex deformation function between the source object model and the target object model; wherein the target vertex deformation function is used to characterize the deformation field between the source object model and the target object model; and determining a target equipment model adapted to the target object model based on the source equipment vertex set of the source equipment model and the target vertex deformation function.
[0006] In one implementation, determining the target vertex deformation function between the source object model and the target object model includes: determining multiple target point pairs from the source object vertex set of the source object model and the target object vertex set of the target object model; constructing an initial vertex deformation function based on each target point pair; and calculating the coefficient value of the initial vertex deformation function to obtain the target vertex deformation function.
[0007] In one implementation, determining multiple target point pairs from the source object vertex set of the source object model and the target object vertex set of the target object model includes: determining the matching relationship between each source object vertex contained in the source object model and each target object vertex contained in the target object model to obtain multiple candidate point pairs; using each candidate point pair as a target point pair; or, determining multiple target point pairs from the candidate point pairs based on the source equipment skinning information of the source equipment model.
[0008] In one implementation, determining multiple target point pairs from the candidate point pairs based on the source equipment skinning information of the source equipment model includes: determining the source equipment vertex to be deformed from the source equipment vertex set of the source equipment model; determining the target skeleton associated with the source equipment vertex to be deformed based on the source equipment skinning information of the source equipment model; and determining the target point pair associated with the target skeleton from the candidate point pairs based on the object skinning information of the target object model.
[0009] In one embodiment, constructing an initial vertex deformation function based on each of the target point pairs includes: obtaining a radial basis weighting function based on the weighted sum of the radial basis functions of each target point pair; wherein the input of the radial basis function is the Euclidean distance between the source object vertex and the target object vertex in the target point pair; adding a preset polynomial compensation function to the radial basis weighting function to obtain the initial vertex deformation function; wherein the coefficient values of the initial vertex deformation function include: the weighting coefficients of the radial basis weighting function and / or the polynomial coefficients of the polynomial compensation function.
[0010] In one implementation, calculating the coefficients of the initial vertex deformation function to obtain the target vertex deformation function includes: acquiring pre-constructed interpolation constraints and coefficient orthogonality conditions; wherein the interpolation constraints are used to constrain the output of the initial vertex deformation function, and the coefficient orthogonality conditions are used to constrain the uniqueness of the coefficient values; using the interpolation constraints and the coefficient orthogonality conditions, solving for the coefficients of the initial vertex deformation function to obtain the target vertex deformation function.
[0011] In one implementation, determining a target equipment model adapted to the target object model based on the source equipment vertex set of the source equipment model and the target vertex deformation function includes: determining a target equipment vertex set according to the source equipment vertex set of the source equipment model and the target vertex deformation function; determining a deformation operation corresponding to at least one target equipment vertex in the target equipment vertex set; wherein the deformation operation includes a rigid deformation operation and / or a flexible deformation operation; and performing the deformation operation on the target equipment vertex corresponding to the deformation operation to obtain a target equipment model adapted to the target object model.
[0012] In one implementation, determining the target equipment vertex set based on the source equipment vertex set of the source equipment model and the target vertex deformation function includes: for each source equipment vertex in the source equipment vertex set of the source equipment model, inputting the source equipment vertex to the target vertex deformation function to obtain the equipment offset corresponding to the source equipment vertex, and calculating the sum of the source equipment vertex and the equipment offset to obtain the target equipment vertex.
[0013] Secondly, embodiments of the present invention also provide an adaptation device for a virtual equipment model, comprising: a model acquisition module for acquiring a source object model and a target object model; wherein the source object model is equipped with a source equipment model, and the source object model and the target object model have the same topology but different body shapes; a function determination module for determining a target vertex deformation function between the source object model and the target object model; wherein the target vertex deformation function is used to characterize the deformation field between the source object model and the target object model; and a model determination module for determining a target equipment model adapted to the target object model based on the source equipment vertex set of the source equipment model and the target vertex deformation function.
[0014] Thirdly, embodiments of the present invention also provide a terminal device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the method described in any of the first aspects.
[0015] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method described in any of the first aspects.
[0016] This invention provides a method, apparatus, and terminal device for adapting a virtual equipment model. First, it acquires a source object model and a target object model with the same topology but different sizes. The source object model is equipped with a source equipment model. Then, it determines the target vertex deformation function to characterize the deformation field between the source and target object models. Finally, based on the source equipment vertex set and the target vertex deformation function of the source equipment model, it determines the target equipment model adapted to the target object model. This method can efficiently and reliably generate a target equipment model adapted to the target object model based on the target vertex deformation function and the source equipment vertex set between the source and target object models. This greatly reduces the need for manual adjustments, significantly improves the efficiency of deforming the virtual equipment model, and, by performing deformation transfer on the source equipment model based on the deformation field, effectively enhances the stability of the deformation effect.
[0017] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0018] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0019] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the deformation effect of a Maya wrap deformation tool provided in an embodiment of the present invention;
[0021] Figure 2 This is a schematic diagram illustrating the deformation effect of another Maya wrap deformation tool provided in an embodiment of the present invention;
[0022] Figure 3 A flowchart illustrating a method for adapting a virtual equipment model according to an embodiment of the present invention;
[0023] Figure 4 A schematic diagram of a source object model and a target object model provided in an embodiment of the present invention;
[0024] Figure 5A schematic diagram of a skeleton skin provided in an embodiment of the present invention;
[0025] Figure 6 A schematic diagram of the interface of a Maya plugin provided in an embodiment of the present invention;
[0026] Figure 7 This is a schematic diagram illustrating the deformation effect of a rigid deformation operation provided in an embodiment of the present invention;
[0027] Figure 8 This is a schematic diagram of an RBF deformation operation provided in an embodiment of the present invention;
[0028] Figure 9 A schematic diagram of a target equipment model provided in an embodiment of the present invention;
[0029] Figure 10 A schematic diagram of the structure of an adapter for a virtual equipment model provided in an embodiment of the present invention;
[0030] Figure 11 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present invention. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0032] Currently, to ensure that the same set of equipment (such as armor, arm guards, coats, belts, and boots) appears differently on virtual characters of different body types, it is necessary to create corresponding equipment assets for each virtual body type. For example, Project ZERO is a massively multiplayer online game featuring multiple races as protagonists, with eight races of distinct styles and vastly different body types. Including male and female characters, there are at least 16 different body types for each character. Since equipment is a crucial reward in MMORPGs and a significant driver of player progress, the game creates a large number of equipment sets for players to choose from, resulting in a large number of artificially created equipment sets adapted to different body types.
[0033] To address the time-consuming and labor-intensive nature of creating equipment assets, a related technology has proposed an FFD algorithm. Most of its practical algorithm implementations are integrated into the DCC (Digital Content Creation) tool. However, the deformation adaptation of the practical FFD algorithm still requires a significant amount of manual interaction and adjustment.
[0034] Additionally, related technologies provide a Maya Wrap Deformer tool, but its deformation effect has poor stability and cannot effectively incorporate customized constraints such as skinning information. Specifically, the Maya Wrap Deformer tool can satisfy the shape transfer of models with relatively uniform topology, but it cannot achieve the expected deformation effect when the points in the model are densely packed. For example, see [link to example]. Figure 1 The diagram shows a deformation effect of the Maya Wrap Deformation tool. Figure 1 This illustration shows that when the points of the reference virtual model are relatively uniform, a target virtual model with better deformation effect can be obtained; while referring to Figure 2 This is an illustration of another deformation effect of the Maya Wrap Deformation tool. Figure 2 The illustration shows that when the points of the reference virtual model are dense, the generated target virtual model will have obvious protrusions. In this case, a lot of manual modification will be required to make the target virtual model meet the project's usage requirements. Moreover, Maya's wrap deformation tool has low operating efficiency; if the reference virtual model has a large number of faces, it will greatly increase the calculation time.
[0035] Based on this, the present invention provides a method, apparatus and terminal device for adapting virtual equipment models, which can not only significantly improve the efficiency of deforming virtual equipment models, but also effectively improve the stability of the deformation effect.
[0036] To facilitate understanding of this embodiment, a method for adapting a virtual equipment model disclosed in this invention will first be described in detail. (See [link to relevant documentation]). Figure 3 The diagram shows a flowchart of a method for adapting a virtual equipment model. The method may include the following steps S302 to S306:
[0037] Step S302: Obtain the source object model and the target object model. The source object model is equipped with the source equipment model. The source object model and the target object model have the same topology but different body shapes. The source object model can also be called the reference object model. The source object model, target object model, and source equipment model can be 3D (3D) mesh models. A 3D mesh model can include 3D vertices and edges connecting the 3D vertices. The source equipment model can include armor, arm guards, coats, belts, boots, etc. The same topology means that the source object model and the target object model have the same number of vertices, and the edges connecting the vertices are identical. Body shape can also be called appearance; for example, in a character model, different body shapes can be reflected in various aspects such as height, weight, etc.
[0038] In one implementation, the source object model and the target object model can be stored in a specified storage path, so that the source object model and the target object model can be obtained by accessing the specified storage path.
[0039] Step S304: Determine the target vertex deformation function between the source object model and the target object model. The target vertex deformation function characterizes the deformation field between the source and target object models. In one implementation, an initial vertex deformation function is constructed based on radial basis functions and a polynomial compensation function. A one-to-one correspondence is determined between the source object vertices contained in the source object model and the target object vertices contained in the target object model, resulting in multiple candidate point pairs. The Euclidean distance of some or all candidate point pairs is used as the input to the initial vertex deformation function to solve for the weight coefficients of the radial basis functions and the polynomial coefficients of the polynomial compensation function, thus obtaining the target vertex deformation function. The input to the target vertex deformation function is the vertex coordinates, and the output is the offset of those vertex coordinates from the source object model to the target object model.
[0040] Step S306: Based on the source equipment vertex set of the source equipment model and the target vertex deformation function, determine the target equipment model that is compatible with the target object model. In one implementation, the vertex coordinates of the source equipment vertices in the source equipment vertex set can be input into the target vertex deformation function to obtain the corresponding offset. The sum of the offset and the vertex coordinates is calculated to obtain the target equipment vertex set, and then the target equipment model that is compatible with the target object model is generated based on the target equipment vertex set.
[0041] The virtual equipment model adaptation method provided in this invention can efficiently and reliably generate a target equipment model that is adapted to the target object model based on the target vertex deformation function between the source object model and the target object model and the source equipment vertex set. This greatly reduces the manual adjustment process, significantly improves the efficiency of deforming the virtual equipment model, and the deformation migration of the source equipment model based on the deformation field can effectively improve the stability of the deformation effect.
[0042] In practical applications, source object models and target object models with different shapes of the same topology can be prepared in advance, such as... Figure 4 This diagram illustrates a source object model and a target object model. Figure 4 Based on this, the present invention provides an implementation method for the aforementioned step S304, as shown in steps 1 to 2 below:
[0043] Step 1: Determine multiple target point pairs from the source object vertex set of the source object model and the target object vertex set of the target object model. In practical applications, since the source object model and the target object model have the same topology, there is a one-to-one correspondence between the source object vertices and the target object vertices. Therefore, the corresponding source object vertices and target object vertices can be used as a pair of candidate point pairs, and multiple target point pairs can be determined from the candidate point pairs. In specific implementation, multiple candidate point pairs can be obtained by determining the matching relationship between each source object vertex and each target object vertex. Further, when determining the target point pairs from the candidate point pairs, it can include: (1) treating each candidate point pair as a target point pair, and (2) determining multiple target point pairs from the candidate point pairs based on the source equipment skinning information of the source equipment model.
[0044] Considering the different requirements of equipment for different body parts—such as helmets and boots being relatively rigid, while clothing is relatively soft—to avoid overly smooth deformation effects, and provided resources allow, that is, both the reference model A and the source equipment model being worn have skeletal skins, the skeletal skins can be used to locate the controlled body part vertices of the source equipment model, thereby achieving different deformation transfers for different body part vertices. For example, see [link to example]. Figure 5 The diagram illustrates a skeletal skinning process. The skeletal skinning includes bone information and skinning information. The bone information is a set of hierarchical coordinates defined in 3D space, while the skinning information represents the weights on which vertices are affected by the bones. Related information includes a list of bones affected by each vertex and their corresponding weights. For example, in a game, a vertex is typically affected by a maximum of four bones, each with a maximum of four corresponding influence weights. Skeletal skinning can be created using 3D content creation software (such as Maya, 3ds Max, etc.).
[0045] To facilitate understanding of (2), this embodiment of the invention provides an implementation method for determining multiple target point pairs from candidate point pairs based on source equipment skin information from the source equipment model, as shown in steps 1.1 to 1.3 below:
[0046] Step 1.1: Determine the source equipment vertices to be deformed from the source equipment vertex set of the source equipment model. In practical applications, for close-fitting source equipment vertices such as gloves, shirts, shorts, or boots, their wearing positions correspond to the body part vertices (i.e., source object vertices or target object vertices), and they are also affected by the bones under the body part vertices. Therefore, when this type of source equipment model exists, deformation adaptation is required, and reasonable skeletal skinning information is available, the body part vertices can be located using this information. For example, the source equipment vertex corresponding to the glove part in the source equipment vertex set can be used as the source equipment vertex to be deformed.
[0047] Step 1.2: Based on the source equipment skinning information of the source equipment model, determine the target bones associated with the vertices of the source equipment to be deformed. In one implementation, the target bones affected by the vertices of the source equipment to be deformed can be found through the source equipment skinning information. For example, the target bones affected by the source equipment vertices corresponding to the glove part can be found through the list of bones affected by each vertex in the source equipment skinning information.
[0048] Step 1.3: Based on the object skinning information of the target object model, determine the target point pairs associated with the target skeleton from the candidate point pairs. In one implementation, by querying the object skinning information using the aforementioned target skeleton, the target point pairs affected by the target skeleton can be located. For example, by reverse-searching the list of bones affected by each vertex in the object skinning information of the target object model, the target point pairs affected by the target skeleton can be found. It can be seen that both the source equipment vertex and the located target point pairs are jointly affected by the target skeleton. That is, the implementation logic of this embodiment is to obtain the target vertex corresponding to the source equipment vertex to be deformed based on the jointly controlled target skeleton, and then perform the deformation migration of the target vertex based on the skinning weight division information. This embodiment of the invention uses the skeleton skinning as a constraint condition for deformation to define the influence of the target point pairs on the source equipment model, and can also handle the adhesion problem caused by the virtual equipment model being worn too close to the object model. In addition, the specific implementation of the query is implemented through the Maya programming script interface.
[0049] Step 2: Construct initial vertex deformation functions based on each target point pair, and calculate the coefficients of the initial vertex deformation functions to obtain the target vertex deformation functions. In one implementation, see steps 2.1 to 2.4 below:
[0050] Step 2.1: Based on the weighted sum of the radial basis functions for each target point pair, obtain the radial basis weighting function. The input to the radial basis function is the Euclidean distance between the source object vertices and the target object vertices in the target point pair. The radial basis function can be used as an interpolation tool for discretized data, without considering the connectivity information between interpolation points; the response value of a data point in the interpolation space is determined by the distance from that data point to the reference base point. This embodiment of the invention directly extends radial basis function interpolation to 3D point cloud data. In one implementation, for a given source object model A and target object model B, the vertices of the source object and the target object correspond one-to-one, and the set of source object vertices of the source object model A is denoted as {O...}. A,i |i=1...N}, the target vertex set of the target object model B is {O} B,i |i=1...N}, where N is the number of vertices. Based on this, taking all vertices of the source object model A as base points, the expression for the radial basis function is: φ(||OO A,i||), where O=[x,y,z], and the radial basis functions take the Euclidean distance from the base point as input.
[0051] Based on the aforementioned radial basis functions, the expression for the radial basis weighting function can be obtained: Where, α i These are the weighting coefficients.
[0052] Step 2.2: Add the preset polynomial compensation function to the radial basis weighting function to obtain the initial vertex deformation function. The coefficients of the initial vertex deformation function include the weighting coefficients of the radial basis weighting function and / or the polynomial coefficients of the polynomial compensation function. For example, in this embodiment of the invention, a linear polynomial is selected as the polynomial compensation function; therefore, the expression for the polynomial compensation function P(O) is: P(O) = β x x+β y y+β z z, where β x β y β z These are the polynomial coefficients.
[0053] Based on the above polynomial compensation function and radial basis weighting function, the initial vertex deformation function F(O) can be obtained:
[0054]
[0055] Step 2.3: Obtain the pre-constructed interpolation constraints and coefficient orthogonality conditions. The interpolation constraints are used to constrain the output of the initial vertex deformation function, and the coefficient orthogonality conditions are used to constrain the uniqueness of the coefficient values. In one implementation, for vertex O on the source object model A... A,j The corresponding interpolation constraint is: For the source object vertex O on the source object model A A,j To the target object vertex O on the target object model B B,j The offset. Based on this interpolation constraint, the initial vertex deformation function is transformed to obtain the following function:
[0056]
[0057] φ(||O) A,j -O A,i ||) is abbreviated as φ j,i In addition:
[0058] O A,j =[x A,j ,y A,j ,z A,j ], P(O A,j )=βx x A,j +β y y A,j +β z z A,j .
[0059] The above interpolation constraint equations can then be integrated into a vector multiplication form:
[0060]
[0061] The source object vertex set φ(||OO) of source object model A. A,i The interpolation constraint equations corresponding to ||) can be rearranged to obtain:
[0062]
[0063] in,
[0064] In another implementation, the coefficient orthogonality condition is: and The orthogonality condition of the coefficients can be rewritten in multiplicative matrix form:
[0065]
[0066] Step 2.4: Using the interpolation constraints and coefficient orthogonality conditions, solve for the coefficients of the initial vertex deformation function to obtain the target vertex deformation function. In one implementation, the interpolation constraints and coefficient orthogonality conditions are integrated to obtain the normal equation:
[0067] It should be noted that the foregoing derivation assumes that the deformation mapping function F(O) A,j The output of ) is a one-dimensional scalar, that is It is a one-dimensional scalar, corresponding to the equipment deformation problem in this embodiment of the invention. The output is a three-dimensional vertex offset, that is:
[0068] The above normal equation still holds, only requiring the following changes to α, β, and d:
[0069]
[0070] The weighting coefficients α and polynomial coefficients β are solved using the above normal equation. The radial basis function has many possible forms, such as linear splines, thin-plate splines, and Gaussian kernel functions. This embodiment of the invention uses a linear spline function as the radial basis function: φ(r) = εr, where ε is the scaling parameter of the linear spline function, for example, ε is 0.9, and r is the input variable of the radial basis function φ, which is a one-dimensional real value.
[0071] After obtaining the weight coefficients α and polynomial coefficients β of the target vertex deformation function, it can be directly applied to the source equipment vertex set to obtain the target equipment model. In one implementation, the target equipment model adapted to the target object model can be determined according to the following steps a to c:
[0072] Step a: Determine the target equipment vertex set based on the source equipment vertex set of the source equipment model and the target vertex deformation function. For example, prepare a source object model A and a set of source equipment vertices correctly fitted on it. And prepare the target object model B, where the vertices of the source object model A and the target object model B have a semantic correspondence. Let m be the three-dimensional spatial point vector of the set of source equipment vertices that have been correctly equipped on the source object model A, where m is the number of equipment vertices.
[0073] This invention provides an implementation method for determining a target equipment vertex set. For each source equipment vertex in the source equipment vertex set of the source equipment model, the source equipment vertex is input into the target vertex deformation function to obtain the equipment offset corresponding to the source equipment vertex, and the sum of the source equipment vertex and the equipment offset is calculated to obtain the target equipment vertex. For example, for the source equipment vertex set already equipped in the source object model A... The equipment offset can be calculated for each point using the aforementioned target vertex deformation function F(x). Finally, by adding the equipment offset to the source equipment vertex, the target equipment vertex is obtained:
[0074] in, To be The target equipment vertex after deformation and adaptation to the target object model B.
[0075] Step b: Determine the deformation operation corresponding to at least one vertex of the target equipment in the target equipment vertex set; wherein the deformation operation includes rigid deformation operation and / or flexible deformation operation. Optionally, the virtual equipment model adaptation method provided in this embodiment of the invention can be integrated into a Maya plugin, such as... Figure 6The diagram shows an interface of a Maya plugin. The interface includes controls such as "Source Object Model Settings," "Target Object Model Settings," and "Source Equipment Model Settings." Operations on these controls can be configured to perform rigid or flexible deformation operations. For example, for a rigid source equipment model such as a helmet, the "Source Equipment Model Settings" can be set to rigid deformation, while for a softer source equipment model, it can be set to flexible deformation. Flexible deformation operations are also known as RBF (Radial Basis Functions).
[0076] Step c: Perform the deformation operation on the target equipment vertices corresponding to the deformation operation to obtain a target equipment model that fits the target object model. For example, see the documentation for rigid deformation operation. Figure 7 The diagram illustrates the deformation effect of a rigid deformation operation. Assuming the source equipment model is a helmet, and the helmet's deformation operation is set to a rigid deformation operation, the deformation effect is as follows: Figure 7 As shown. Taking the RBF deformation operation as an example, see [link to relevant documentation]. Figure 8 The diagram illustrates an RBF deformation operation. Assuming the source equipment model is a top, and the deformation operation for the top is set to a flexible deformation operation, the deformation effect is as follows: Figure 8 As shown.
[0077] In practical applications, selecting different deformation operations for different types of source equipment models can yield target equipment models with better deformation effects, such as... Figure 9 The diagram shows a target equipment model. Furthermore, secondary modifications can be made based on the target equipment model, thus avoiding the need to create new equipment from scratch. Moreover, the target equipment model and the source equipment model have the same topology and UVs (i.e., texture coordinate information used for texture mapping in the 3D mesh model), allowing them to share shaders in the game. This enriches the visual differences between characters of different body types while reducing the package size.
[0078] For the aforementioned rigid deformation operation, the equipment deformation adaptation result based on the radial basis function is denoted as the intermediate result mesh vertex. The ICP (Iterative Closest Point) algorithm is applied to identify the source rig mesh vertices on body mesh A. Align to The final deformation adaptation result is obtained.
[0079] In summary, the embodiments of the present invention provide three implementation methods for adapting virtual equipment models:
[0080] (1) Use only RBF deformation adaptation. In this method, all vertex information of the source object model A and the target object model B will be used when estimating the weight coefficients and polynomial coefficients.
[0081] (2) When using the RBF radial basis function, deformation adaptation is performed in conjunction with skeletal skinning. In this method, skeletal skinning is used to locate and filter the vertices of the specific body parts corresponding to the source equipment model. For example, if the source equipment model is a left boot, the corresponding left foot body vertices can be located and filtered using skeletal skinning, and the weight coefficients and polynomial coefficients are estimated using the left foot body vertices. This method is an optional supplement to the aforementioned (1), that is, using skeletal skinning to divide the source object model or target object model, and using local body vertices to implement equipment deformation adaptation based on radial basis functions.
[0082] (3) Rigid deformation adaptation. In this method, the target equipment vertex obtained in (1) or (2) above is used as the intermediate result vertex. The ICP algorithm is applied to the source rig mesh vertices on body mesh A. Align to The final deformation adaptation result is obtained.
[0083] In addition to the virtual equipment model adaptation method provided in the foregoing embodiments, this invention also provides a virtual equipment model adaptation device, see [link to related documentation]. Figure 10 The diagram shows the structure of an adapter for a virtual equipment model. The adapter mainly includes the following parts:
[0084] The model acquisition module 1002 is used to acquire the source object model and the target object model; wherein, the source object model is equipped with the active equipment model, and the source object model and the target object model have the same topology but different body size;
[0085] The function determination module 1004 is used to determine the target vertex deformation function between the source object model and the target object model; wherein, the target vertex deformation function is used to characterize the deformation field between the source object model and the target object model;
[0086] The model determination module 1006 is used to determine the target equipment model that is compatible with the target object model based on the source equipment vertex set and target vertex deformation function of the source equipment model.
[0087] The virtual equipment model adaptation device provided in this embodiment of the invention can efficiently and reliably generate a target equipment model that is adapted to the target object model based on the target vertex deformation function between the source object model and the target object model and the source equipment vertex set. This greatly reduces the manual adjustment process, significantly improves the efficiency of deforming the virtual equipment model, and can effectively improve the stability of the deformation effect by performing deformation migration on the source equipment model based on the deformation field.
[0088] In one implementation, the function determination module 1004 is further configured to: determine multiple target point pairs from the source object vertex set of the source object model and the target object vertex set of the target object model; construct an initial vertex deformation function based on each target point pair, and calculate the coefficient value of the initial vertex deformation function to obtain the target vertex deformation function.
[0089] In one implementation, the function determination module 1004 is further configured to: determine the matching relationship between each source object vertex contained in the source object model and each target object vertex contained in the target object model, thereby obtaining multiple candidate point pairs; use each candidate point pair as a target point pair; or, based on the source equipment skinning information of the source equipment model, determine multiple target point pairs from the candidate point pairs.
[0090] In one implementation, the function determination module 1004 is further configured to: determine the source equipment vertex to be deformed from the source equipment vertex set of the source equipment model; determine the target bone associated with the source equipment vertex to be deformed based on the source equipment skinning information of the source equipment model; and determine the target point pair associated with the target bone from the candidate point pairs based on the object skinning information of the target object model.
[0091] In one embodiment, the function determination module 1004 is further configured to: wherein the input of the radial basis function is the Euclidean distance between the source object vertex and the target object vertex in the target point pair; add a preset polynomial compensation function to the radial basis weighting function to obtain an initial vertex deformation function; wherein the coefficient values of the initial vertex deformation function include: the weighting coefficients of the radial basis weighting function and / or the polynomial coefficients of the polynomial compensation function.
[0092] In one implementation, the function determination module 1004 is further configured to: obtain pre-constructed interpolation constraints and coefficient orthogonality conditions; wherein the interpolation constraints are used to constrain the output of the initial vertex deformation function, and the coefficient orthogonality conditions are used to constrain the uniqueness of the coefficient values; and use the interpolation constraints and coefficient orthogonality conditions to solve for the coefficient values of the initial vertex deformation function to obtain the target vertex deformation function.
[0093] In one embodiment, the model determination module 1006 is further configured to: determine the target equipment vertex set based on the source equipment vertex set of the source equipment model and the target vertex deformation function; determine the deformation operation corresponding to at least one target equipment vertex in the target equipment vertex set; wherein the deformation operation includes rigid deformation operation and / or flexible deformation operation; perform the deformation operation on the target equipment vertex corresponding to the deformation operation to obtain a target equipment model adapted to the target object model.
[0094] In one embodiment, the model determination module 1006 is further configured to: for each source equipment vertex in the source equipment vertex set of the source equipment model, input the source equipment vertex to the target vertex deformation function to obtain the equipment offset corresponding to the source equipment vertex, and calculate the sum of the source equipment vertex and the equipment offset to obtain the target equipment vertex.
[0095] The device provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0096] This invention provides a terminal device, specifically, the terminal device includes a processor and a storage device; the storage device stores a computer program, and the computer program, when run by the processor, executes the method described in any of the above embodiments.
[0097] Figure 11 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present invention. The terminal device 100 includes: a processor 110, a memory 111, a bus 112, and a communication interface 113. The processor 110, the communication interface 113, and the memory 111 are connected through the bus 112. The processor 110 is used to execute executable modules, such as computer programs, stored in the memory 111.
[0098] The memory 111 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 113 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.
[0099] Bus 112 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 11 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0100] The memory 111 is used to store programs. After receiving an execution instruction, the processor 110 executes the program. The method executed by the device for defining the flow process disclosed in any of the foregoing embodiments of the present invention can be applied to the processor 110 or implemented by the processor 110.
[0101] Processor 110 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 110 or by instructions in software form. Processor 110 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 111, and processor 110 reads the information in memory 111 and, in conjunction with its hardware, completes the steps of the above method.
[0102] The computer program product of the readable storage medium provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the foregoing method embodiments. For specific implementation, please refer to the foregoing method embodiments, which will not be repeated here.
[0103] If the aforementioned functions are implemented as software functional units 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 invention, essentially, or the part that contributes to the prior art, or a portion of the 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 to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0104] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method of adapting a virtual equipment model, characterized by, The method comprises: obtaining a source object model and a target object model; wherein the source object model is worn with a source equipment model, the source object model has the same topology as the target object model and different body size; determining a target vertex morphing function between the source object model and the target object model; wherein the target vertex morphing function is used to represent a morphing field between the source object model and the target object model; determining a target equipment model for wearing which is adapted to the target object model based on a source equipment vertex set of the source equipment model and the target vertex morphing function; the determining of the target equipment model for wearing which is adapted to the target object model based on the source equipment vertex set of the source equipment model and the target vertex morphing function comprises: determining a target equipment vertex set according to the source equipment vertex set of the source equipment model and the target vertex morphing function; determining a morphing operation corresponding to at least one target equipment vertex in the target equipment vertex set; wherein the morphing operation comprises a rigid morphing operation and / or a flexible morphing operation; and performing the morphing operation on the target equipment vertex corresponding to the morphing operation to obtain the target equipment model for wearing which is adapted to the target object model; the determining of the target equipment vertex set based on the source equipment vertex set of the source equipment model and the target vertex morphing function comprises: for each source equipment vertex in the source equipment vertex set of the source equipment model, inputting the source equipment vertex into the target vertex morphing function to obtain an equipment offset corresponding to the source equipment vertex, and calculating a sum value of the source equipment vertex and the equipment offset to obtain a target equipment vertex, wherein the target vertex morphing function is set based on a preset polynomial compensation function and a radial basis weighting function.
2. The method of claim 1, wherein, the determining of the target vertex morphing function between the source object model and the target object model comprises: determining a plurality of target point pairs from a source object vertex set of the source object model and a target object vertex set of the target object model; constructing an initial vertex morphing function based on each target point pair and calculating a coefficient value of the initial vertex morphing function to obtain a target vertex morphing function.
3. The method of claim 2, wherein, the determining of the plurality of target point pairs from the source object vertex set of the source object model and the target object vertex set of the target object model comprises: determining a matching relationship between each source object vertex contained in the source object model and each target object vertex contained in the target object model to obtain a plurality of candidate point pairs; taking each candidate point pair as a target point pair; or, determining a plurality of target point pairs from the candidate point pairs based on source equipment skin information of the source equipment model.
4. The method of claim 3, wherein, the determining of the plurality of target point pairs from the candidate point pairs based on the source equipment skin information of the source equipment model comprises: determining a to-be-morphed source equipment vertex from a source equipment vertex set of the source equipment model; determining a target bone associated with the to-be-morphed source equipment vertex based on source equipment skin information of the source equipment model; Determine, from the object skinning information of the target object model, a target point pair associated with the target skeleton from the candidate point pairs.
5. The method of claim 2, wherein, The constructing an initial vertex morphing function based on each target point pair comprises: Obtaining a radial basis weighted function based on a weighted sum of radial basis functions of each target point pair, wherein an input of the radial basis functions is an Euclidean distance between the source object vertex and the target object vertex in the target point pair; Adding a preset polynomial compensation function to the radial basis weighted function to obtain the initial vertex morphing function; The coefficient values of the initial vertex morphing function include weighted coefficients of the radial basis weighted function and / or polynomial coefficients of the polynomial compensation function.
6. The method of claim 2, wherein, The calculating the coefficient values of the initial vertex morphing function to obtain a target vertex morphing function comprises: Obtaining an interpolation constraint condition and a coefficient orthogonality condition constructed in advance, wherein the interpolation constraint condition is used to constrain an output of the initial vertex morphing function, and the coefficient orthogonality condition is used to constrain uniqueness of the coefficient values; Solving the coefficient values of the initial vertex morphing function by using the interpolation constraint condition and the coefficient orthogonality condition to obtain the target vertex morphing function.
7. An adaptation apparatus of a virtual equipment model, characterized by, The method comprises: A model obtaining module is configured to obtain a source object model and a target object model, wherein the source object model is worn with a source equipment model, and the source object model has the same topology as the target object model but different sizes; A function determining module is configured to determine a target vertex morphing function between the source object model and the target object model, wherein the target vertex morphing function is used to represent a morphing field between the source object model and the target object model; A model determining module is configured to determine a target equipment model worn for the target object model based on a source equipment vertex set of the source equipment model and the target vertex morphing function. The model determining module is specifically configured to determine a target equipment vertex set according to the source equipment vertex set of the source equipment model and the target vertex morphing function. Determine a morphing operation corresponding to at least one target equipment vertex in the target equipment vertex set, wherein the morphing operation comprises a rigid morphing operation and / or a flexible morphing operation; Perform the morphing operation on the target equipment vertex corresponding to the morphing operation to obtain the target equipment model worn for the target object model; The model determining module is specifically configured to, for each source equipment vertex in the source equipment vertex set of the source equipment model, input the source equipment vertex into the target vertex morphing function to obtain an equipment offset corresponding to the source equipment vertex, and calculate a sum of the source equipment vertex and the equipment offset to obtain a target equipment vertex, wherein the target vertex morphing function is set based on a preset polynomial compensation function and a radial basis weighted function.
8. A terminal device, comprising: The device comprises a processor and a memory, the memory stores computer executable instructions capable of being executed by the processor, and the processor executes the computer executable instructions to implement the method in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer executable instructions, which when invoked and executed by the processor, cause the processor to implement the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Game role different body type garment generation and changing method and system
CN112206527A
Method and apparatus for transferring character rigs from source model to target model
KR1020110117908A