Optimization method and device for root node data in model

By optimizing the position coordinates of the root node in the model and using the ratio of the sum of the length projections of the moving parts, the problem of large differences between the movements of virtual objects and entities is solved, and the accuracy and authenticity of the movements of virtual objects are improved.

CN114140573BActive Publication Date: 2024-09-13BEIJING IQIYI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111087189.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-16
Publication Date
2024-09-13
Estimated Expiration
2041-09-16

AI Technical Summary

Technical Problem

In the existing technology, there is a large difference between the movements of 3D virtual objects and the movements of entities, resulting in insufficient accuracy of movements of virtual objects. Especially in animation production and movie special effects, it is difficult to achieve precise synchronization with physical movements.

Method used

By optimizing the position coordinates of the root node in the model, using the ratio of the sum of the length projections of the moving parts of the first model and the second model, the optimization parameters are determined, and the position of the root node of the second model is adjusted to reduce the gap between the virtual object and the physical action. difference.

Benefits of technology

It improves the accuracy of the movements of virtual objects, makes the movement trajectories of virtual objects closer to the movement trajectories of entities, and enhances the authenticity and consistency of movements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114140573B
    Figure CN114140573B
Patent Text Reader

Abstract

The method and device for optimizing the root node data in the model provided by the present application obtain the sum of the projections of the lengths of each segment on the moving part in the first model in a preset direction according to the initial position coordinates of each node of the first model carrying the motion data of the entity, and obtain the component of the first parameter in the preset direction. According to the initial position coordinates of each node of the second model driving the 3D virtual object, the sum of the projections of the lengths of each segment on the moving part in the second model in a preset direction is obtained to obtain the component of the second parameter in the preset direction. The optimization parameters are determined based on the weighted sum of the components of the first parameter in the preset direction and the ratio of the weighted sum of the second parameter in the preset direction. Using the optimization parameters, the position coordinates of the root node of the first model are optimized to obtain the position coordinates of the root node of the second model. The optimized root node of the second model makes the motion trajectory of the virtual object driven by the second model more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic information, and in particular to a method and device for optimizing root node data in a model. Background Art

[0002] The production of 3D virtual objects (usually including people and animals) is widely used in scenes such as animation production and movie special effects. Taking 3D virtual characters as an example of 3D virtual objects, the general process of producing 3D virtual characters is: using motion capture technology to capture various actions of entities such as actors, generate data indicating these actions, and then assign the data to a specified 3D model.

[0003] In practice, the movements displayed by the virtual objects may be quite different from those displayed by the real objects. For example, the real human body displays a step, while the virtual object displays a "skating" movement. It can be seen that how to reduce the difference between the movements of the virtual objects and the real movements to improve the accuracy of the movements of the virtual objects has become an urgent problem to be solved in the field of virtual object production. Summary of the invention

[0004] The present application provides a method and device for optimizing root node data in a model, aiming to solve the problem of reducing the difference between the action of a virtual object and the action of a physical object to improve the accuracy of the action of the virtual object.

[0005] In order to achieve the above objectives, this application provides the following technical solutions:

[0006] A method for optimizing root node data in a model, applied before using the model to drive a 3D virtual object, comprising:

[0007] According to the initial position coordinates of each node of the first model, the sum of the length projections of each segment length on the moving part in the first model in a preset direction is obtained to obtain the component of the first parameter in the preset direction; the length of each segment is the length between two adjacent nodes; the first model is a model that carries the motion data of the entity; the preset direction includes the direction of the coordinate axis in the space coordinate system where the second model is located;

[0008] According to the initial position coordinates of each node of the second model, the sum of the projection lengths of each segment length on the moving part of the second model in the preset direction is obtained to obtain the component of the second parameter in the preset direction; the second model is a model for driving the 3D virtual object;

[0009] Determining an optimization parameter based on a ratio of a weighted sum of components of the first parameter in the preset direction to a weighted sum of components of the second parameter in the preset direction;

[0010] The position coordinates of the root node of the first model are optimized using the optimization parameters to obtain the position coordinates of the root node of the second model.

[0011] Optionally, the determining the optimization parameter includes:

[0012] Determining the optimization parameters of a target direction; the target direction is at least one of the preset directions;

[0013] Determining an optimization parameter of a first target direction based on a ratio of a weighted sum of components of the first parameter in the preset direction to a weighted sum of components of the second parameter in the preset direction includes:

[0014] According to the component of the first parameter in the preset direction and the first weight set pre-configured for the first target direction, a weighted sum of the component of the first parameter in the preset direction is calculated to obtain a first optimization parameter of the first target direction; the first weight set is a set consisting of weights pre-configured for the component of the first parameter in the preset direction and the component of the second parameter in the preset direction, and the first target direction is any one of the target directions;

[0015] Calculating a weighted sum of the components of the second parameter in the preset direction according to the components of the second parameter in the preset direction and the first weight set to obtain a second optimized parameter in the first target direction;

[0016] The ratio of the second optimization parameter of the first target direction to the first optimization parameter of the first target direction is used as the optimization parameter of the target direction.

[0017] Optionally, both the first model and the second model are human models; the movement part is the left leg and / or the right leg;

[0018] The component of the first parameter in the first preset direction includes:

[0019] The sum of the first component of the left leg and the first component of the right leg, wherein the first component of the left leg is: the sum of the length projections of the lengths of the segments of the left leg in the first model in the first preset direction, and the first component of the right leg is the sum of the length projections of the lengths of the segments of the right leg in the first model in the first preset direction; the first preset direction is any one of the preset directions;

[0020] The component of the second parameter in the first preset direction includes:

[0021] The sum of the left leg second component and the right leg second component, wherein the left leg second component is: the sum of the length projections of each segment of the left leg in the second model in the first preset direction, and the right leg second component is the sum of the length projections of each segment of the right leg in the second model in the first preset direction.

[0022] Optionally, the target direction includes:

[0023] A direction perpendicular to the direction from the root node to the end node of the moving part.

[0024] Optionally, the using the optimization parameters to optimize the position coordinates of the root node of the first model to obtain the position coordinates of the root node of the second model includes:

[0025] The position coordinates of the root node of the second model are determined by using the product of the optimization parameter and the position coordinates of the root node of the first model.

[0026] A device for optimizing root node data in a model, comprising:

[0027] A first acquisition module is used to obtain, before using the model to drive the 3D virtual object, the sum of the length projections of each segment length on the moving part in the first model in a preset direction according to the initial position coordinates of each node of the first model, so as to obtain the component of the first parameter in the preset direction; the length of each segment is the length between two adjacent nodes; the first model is a model that carries the motion data of the entity; the preset direction includes the direction of the coordinate axis in the space coordinate system where the second model is located;

[0028] a second acquisition module, configured to acquire, based on the initial position coordinates of each node of the second model, the sum of the projection lengths of each segment length on the moving part of the second model in the preset direction, and obtain the component of the second parameter in the preset direction; the second model is a model for driving the 3D virtual object;

[0029] A determination module, configured to determine an optimization parameter based at least on a ratio of a weighted sum of components of the first parameter in the preset direction to a weighted sum of components of the second parameter in the preset direction;

[0030] The optimization module is used to optimize the position coordinates of the root node of the first model using the optimization parameters to obtain the position coordinates of the root node of the second model.

[0031] Optionally, the determining module is used to determine the optimization parameter including:

[0032] The determination module is specifically used to determine the optimization parameter of the target direction; the target direction is at least one direction among the preset directions;

[0033] The determination module is used to determine the optimization parameter of the first target direction based on the ratio of the weighted sum of the components of the first parameter in the preset direction to the weighted sum of the components of the second parameter in the preset direction, including:

[0034] The determination module is specifically used to calculate the weighted sum of the components of the first parameter in the preset direction according to the components of the first parameter in the preset direction and the first weight set pre-configured for the first target direction, so as to obtain the first optimization parameter of the first target direction; the first weight set is a set composed of weights pre-configured for the components of the first parameter in the preset direction and the components of the second parameter in the preset direction, and the first target direction is any one of the target directions; according to the components of the second parameter in the preset direction and the first weight set, calculate the weighted sum of the components of the second parameter in the preset direction to obtain the second optimization parameter of the first target direction; and use the ratio of the second optimization parameter of the first target direction to the first optimization parameter of the first target direction as the optimization parameter of the target direction.

[0035] Optionally, the optimization module is used to optimize the position coordinates of the root node of the first model using the optimization parameters to obtain the position coordinates of the root node of the second model, including:

[0036] The optimization module is specifically used to determine the position coordinates of the root node of the second model using the product of the optimization parameter and the position coordinates of the root node of the first model.

[0037] An electronic device, comprising:

[0038] Processor and memory;

[0039] The memory is used to store programs, and the processor is used to run the programs to implement the above-mentioned method for optimizing root node data in the model.

[0040] A computer-readable storage medium stores a program, which, when an electronic device runs the program, implements the above-mentioned method for optimizing root node data in the model.

[0041] The method and device for optimizing the root node data in the model described in the present application obtains the sum of the projections of the lengths of each segment on the moving part in the first model in a preset direction according to the initial position coordinates of each node of the first model carrying the motion data of the entity, and obtains the component of the first parameter in the preset direction. According to the initial position coordinates of each node of the second model driving the 3D virtual object, the sum of the projections of the lengths of each segment on the moving part in the second model in a preset direction is obtained to obtain the component of the second parameter in the preset direction. The optimization parameters are determined based on the weighted sum of the components of the first parameter in the preset direction and the ratio of the weighted sum of the second parameter in the preset direction. Using the optimization parameters, the position coordinates of the root node of the first model are optimized to obtain the position coordinates of the root node of the second model. The optimized root node of the second model makes the motion trajectory of the virtual object driven by the second model more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 An example diagram of a 3D human body model corresponding to a part of the joint points of the human body;

[0044] Figure 2 A flowchart of a method for optimizing root node data in a model disclosed in an embodiment of the present application;

[0045] Figure 3 A flowchart of a method for optimizing root node data in another model disclosed in an embodiment of the present application;

[0046] Figure 4 A schematic diagram of the structure of a device for optimizing root node data in a model disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0048] During the research process, the applicant discovered that because the actions performed by the entity need to be displayed, the driving skeleton nodes (hereinafter referred to as nodes) in the specified 3D model usually have the same topological relationship with the joint points in the entity, that is, the driving skeleton nodes in the specified 3D model correspond one-to-one to all or part of the joint points in the entity.

[0049] However, the ratio of node distances in a specified 3D model is not necessarily the same as the ratio of the lengths of the corresponding joint points in the entity. Therefore, the actions displayed by the specified 3D model may deviate greatly from the actions performed by the entity.

[0050] Therefore, the applicant proposes that:

[0051] In order to improve the accuracy of the virtual object's movements, a 3D model that matches the entity can be constructed first, hereinafter referred to as the first model. The captured data is assigned to the first model to obtain the data of the nodes in the first model (position coordinates and rotation data), and then the data of the nodes in the first model are migrated to the designated 3D model for driving the 3D virtual object, hereinafter referred to as the second model, and the virtual object is driven by the second model.

[0052] However, the applicant has found that even if the above method is used, the movement of the moving parts of the virtual object driven by the second model may still be quite different from the movement of the entity. The difference is mainly reflected in that the movement of the entity has a sliding effect on the virtual object. For example, the walking movement of the entity is displayed as a "skating" effect on the virtual object.

[0053] The applicant found in the process of research that the reason for the above differences is that, in the model, except for the preset root node, the rotation data and position coordinates of other nodes are set with reference to the root node. If the length of the moving part in the first model is greater than the length of the moving part in the second model, and the above data migration process is based on the premise that the position coordinates of the root nodes of the first model and the second model are the same, then after the data is migrated to the second model, the movement of the virtual object driven by the second model has a sliding effect more than the entity.

[0054] That is to say, the position coordinates of the root node affect the motion trajectory of the virtual object, while the position coordinates of other nodes affect the type of action displayed. Therefore, only migrating the data from the nodes of the first model to the nodes of the second model is not enough to ensure the accuracy of the virtual object action.

[0055] In the following embodiments, a technical solution for optimizing the root node data in a model is proposed, the purpose of which is to optimize the position coordinates of the root node of the second model and further improve the accuracy of the movement of the virtual object.

[0056] It can be understood that the solution of optimizing the position coordinates of the root node of the second model in the embodiment of the present application and the solution of improving the accuracy of the movement of the virtual object through data migration are two-dimensional solutions, that is, the present case improves the accuracy of the movement of the virtual object from the dimension of motion trajectory, while the data migration solution improves the accuracy of the movement of the virtual object from the dimension of action type.

[0057] Here are some definitions and explanations:

[0058] Topological relationships refer to the types of nodes and the connections between them. The type of node is the type of joint point in the corresponding entity, for example Figure 1 It is understood that Figure 1 Shown are nodes corresponding to joints of a portion of the human body.

[0059] The first model and the second model are both 3D models, wherein the node data included therein include position coordinates and rotation data. The definition of rotation data can refer to the prior art.

[0060] The ratio of node distances refers to the ratio of the distance S1 between the first node A and the second node B to the distance S2 between the other two nodes C and D, that is, S1 / S2. The distance can be calculated from the position coordinates of the nodes. Figure 1 For example, using the position coordinates of Hips and LeftHips Hips, we get the distance S1 between Hips and LeftHips. Using the position coordinates of Hips and RightHips, we get the distance S2 between Hips and RightHips. Dividing S1 by S2, we get the ratio of the node distances.

[0061] The ratio of the joint lengths in an entity refers to the ratio of the bone lengths between the joints. For example, the bone length between joint 1 and joint 2 is S3, and the bone length between joint 3 and joint 4 is S4. S3 / S4 is a joint length ratio.

[0062] The first model and the entity are adapted to each other by: the nodes in the first model correspond one-to-one with the joint points in the entity, and the ratio of the node distances in the first model is the same as the ratio of the lengths of the corresponding joint points in the entity, for example, Figure 1 The ratio of the distance between Hips and LeftHips divided by the distance between Hips and RightHips is equal to the ratio of the bone length between Hips and LeftHips in the human body divided by the bone length between Hips and RightHips in the human body.

[0063] The correspondence between the nodes in the model and the joint points in the entity means that if the data assigned to a node in the model is the data collected from the displacement or rotation of a joint point in the entity, then the node corresponds to the joint point.

[0064] Based on the above content, it can be known that the first model and the second model have the same topological relationship, and the nodes in the first model correspond one-to-one with the nodes in the second model, that is, the nodes in the first model have unique corresponding nodes in the second model.

[0065] Whether it is an entity or a model, it can be divided into moving parts and other parts. In an entity, the moving parts refer to the parts connected by the joints used to show the action, while the other parts are the parts connected by the joints not used to show the movement. In a model, the moving parts refer to the parts composed of the corresponding nodes of the joints that constitute the moving parts in the entity.

[0066] The corresponding node of the end of the moving part in the model is called the end corresponding node. Based on the above definition of the moving part, the moving part usually has two ends. The following embodiments all take two ends as an example, but are also applicable to the case of multiple ends.

[0067] The length of the moving part in the model refers to the distance from one end corresponding node, through other corresponding nodes in sequence, to another end corresponding node. Other corresponding nodes refer to the nodes other than the end corresponding nodes among the corresponding nodes of the joint points of the moving part in the entity.

[0068] Of the two end nodes, the node closest to the root node of the model is called the start node, and the node farthest from the root node is called the end node.

[0069] The length between any two adjacent nodes (i.e., the corresponding nodes of two adjacent joint points in the moving part of the entity) in the moving part of the model can be determined by the position coordinates of the two adjacent nodes in the model.

[0070] Figure 1The present invention is an example of a human 3D model used in an embodiment of the present application, Hips represents the hip node, Spine1 represents the first (closed) node of the spine, Spine2 represents the second (closed) node of the spine, Neck represents the neck (closed) node, Head represents the head (closed) node, LeftShoulder represents the left shoulder (closed) node, RightShoulder represents the right shoulder (closed) node, LeftElbow represents the left elbow (closed) node, RightElbow represents the right elbow (closed) node, LeftWrist represents the left wrist (closed) node, RightWrist represents the right wrist (closed) node, LeftHips represents the left hip (closed) node, RightHips represents the right hip (closed) node, LeftKnee represents the left knee (closed) node, RightKnee represents the right-left knee (closed) node, LeftAnkle represents the left ankle (closed) node, and RightAnkle represents the right ankle (closed) node.

[0071] Figure 1 The moving parts in the figure include legs, arms and head, and the trunk is other parts. In the following embodiments of the present application, the moving parts are all taken as examples of left leg and / or right leg.

[0072] exist Figure 1 In the model shown, the left leg is part of the moving part, and the nodes of the left leg are Hips, LeftHips, LeftKnee, and LeftAnkle. The end nodes of the left leg are Hips and LeftAnkle. Therefore, the length of the left leg is the distance traveled from Hips to LeftAnkle among Hips, LeftHips, LeftKnee, and LeftAnkle, that is, the sum of the distance between Hips and LeftHips, the distance between LeftHips and LeftKnee, and the distance between LeftKnee and LeftAnkle.

[0073] Both the first model and the second model are provided with a root node. The root node of the model is a reference node pre-specified among the nodes of the model, and the position coordinates of the reference node are references to the position coordinates of other nodes. Figure 1 Take Hips shown as an example.

[0074] In the end nodes Hips and LeftAnkle, Hips is the starting node (the starting node is the same as the root node), and LeftAnkle is the end node.

[0075] Regardless of the first model or the second model, when the model is constructed, a certain posture is used as the initial posture, so that the model presents the position data of the initial posture, which is called the initial position data. Taking the human body model as an example, the initial posture is T-Pose, that is, a posture in the shape of a letter "T".

[0076] The optimization process of the root node data in the model proposed in the embodiment of the present application will be described in detail below.

[0077] Figure 2 This is a process of a method for optimizing root node data in a model disclosed in an embodiment of the present application. In this embodiment, the first model is a model that carries motion data of an entity, and the second model is a model that drives a 3D virtual object.

[0078] Combined with the above definition, it can be understood that, from the perspective of data migration, the first model is the model before migration, that is, after collecting the motion data of the entity, the motion data of the entity is configured in the first model. After the data of the node of the first model is migrated to the second model, the second model is used to drive the virtual object so that the virtual object displays the action of the entity. The purpose of the method in this embodiment is to optimize the data of the root node in the second model.

[0079] Figure 2 The process shown includes the following steps:

[0080] S21. According to the initial position coordinates of each node of the first model, the sum of the length projections of each segment length on the moving part of the first model in a preset direction is obtained to obtain the component of the first parameter in the preset direction.

[0081] The length of each segment is the length between two adjacent nodes. The initial position coordinates of each node are as shown above, which are the position coordinates under T-Pose and will not be repeated here.

[0082] In this embodiment, the preset direction includes the direction of the coordinate axis in the space coordinate system where the second model is located.

[0083] It can be understood that the component of the first parameter in the preset direction represents the component of the length of the moving part in the first model in each preset direction.

[0084] S22. According to the initial position coordinates of each node of the second model, the sum of the projection lengths of each segment length on the moving part of the second model in the preset direction is obtained to obtain the component of the second parameter in the preset direction.

[0085] It can be understood that the component of the second parameter in the preset direction represents the component of the length of the moving part in the second model in the preset direction.

[0086] S23. Determine an optimization parameter based on a ratio of a weighted sum of components of the first parameter in a preset direction to a weighted sum of components of the second parameter in the preset direction.

[0087] Combining the physical meanings of the first parameter and the second parameter, and the method of determining the optimization parameter, it can be understood that the optimization parameter represents the ratio of the length of the moving part of the first model to the length of the moving part of the second model.

[0088] Because both the first model and the second model use the root node as a reference node to determine the position coordinates of other nodes, the length difference between nodes is also based on the coordinates of the root node. Therefore, the optimization parameters can reflect the proportional difference in the position coordinates of the root nodes of the first model and the second model.

[0089] S24. Using the optimization parameters, optimize the position coordinates of the root node of the first model to obtain the position coordinates of the root node of the second model.

[0090] It can be understood that the optimization parameters can reflect the proportional difference in the position coordinates of the root nodes of the first model and the second model, so the position coordinates of the root node of the second model can be obtained using the position coordinates of the root node of the first model and the optimization parameters.

[0091] It can be seen from the above process that the optimization parameters that can reflect the proportional difference in the position coordinates of the root node of the first model and the root node of the second model are first determined, and then the optimization parameters are used to optimize the position coordinates of the root node of the first model to obtain the position coordinates of the root node of the second model. Therefore, the position coordinates of the root node of the second model have higher accuracy, so that the motion trajectory of the virtual object driven by the second model is closer to the motion trajectory of the entity, thereby improving the accuracy of the movement of the virtual object.

[0092] Below Figure 1 The human body 3D model shown has preset directions as the x-axis, y-axis and z-axis directions, the target directions as the x-axis direction and the y-axis direction, and the left leg and right leg in the human body 3D model as the moving parts as an example, and the above method is explained in more detail.

[0093] Figure 3 A method for optimizing root node data in another model disclosed in an embodiment of the present application includes the following steps:

[0094] S31. According to the initial position coordinates of each node of the first model, obtain the sum of the length projections of each segment of the left leg and the right leg in the first model in a preset direction, and obtain the component of the first parameter in the preset direction.

[0095] In order to distinguish the first model from the second model, in this embodiment, the first model is represented by a subscript "A" and the second model is represented by a subscript "B".

[0096] by Figure 1 For example, the nodes of the left leg of the first model are: LeftAnkle A 、LeftKnee A , and LeftHips A , the nodes of the right leg of the first model are: RightAnkle A 、RightKnee A and RightHips A .

[0097] The coordinate group of the left leg node of the first model is recorded as: Where P represents the position coordinates, The number of elements in is denoted as l A-L , is the ith element.

[0098] The coordinate group of the right leg node of the first model is recorded as: in, The number of elements in is denoted as l A-R , is the ith element.

[0099] The length between adjacent nodes can be calculated using the position coordinates of two adjacent nodes.

[0100] Therefore, the sum of the projections of the lengths of the segments of the left leg of the first model in the x-axis direction, that is, the first component of the left leg in the x-axis direction, is:

[0101]

[0102] The sum of the projections of the lengths of the segments of the left leg of the first model in the y-axis direction, that is, the first component of the left leg in the y-axis direction is:

[0103]

[0104] The sum of the projections of the lengths of the segments of the left leg of the first model in the z-axis direction, that is, the first component of the left leg in the z-axis direction is:

[0105]

[0106] Similarly, the sum of the projections of the lengths of the segments of the right leg of the first model in the x-axis direction, that is, the first component of the right leg in the x-axis direction, is:

[0107]

[0108] The sum of the projections of the lengths of the segments of the right leg of the first model in the y-axis direction, that is, the first component of the right leg in the y-axis direction is:

[0109]

[0110] The sum of the length projections of each segment of the right leg of the first model in the z-axis direction, that is, the first component of the right leg in the z-axis direction is:

[0111]

[0112] In this step, the component of the first parameter in any preset direction includes the sum of the first component of the left leg and the first component of the right leg in that direction. Therefore, the component of the first parameter in the x-axis direction is: The component of the first parameter in the y-axis direction is: The component of the first parameter in the z-axis direction is:

[0113]

[0114] S32, according to the initial position coordinates of each node of the second model, obtain the sum of the length projections of each segment of the left leg and the right leg in the second model in the preset direction, and obtain the component of the second parameter in the preset direction.

[0115] Similarly, the sum of the length projections of the lengths of the segments of the left leg of the second model in the x-axis direction, that is, the second component of the left leg in the x-axis direction, is:

[0116]

[0117] The sum of the length projections of the lengths of the segments of the left leg of the second model in the y-axis direction, that is, the second component of the left leg in the y-axis direction is:

[0118]

[0119] The sum of the length projections of each segment of the left leg of the second model in the z-axis direction, that is, the second component of the left leg in the z-axis direction is:

[0120]

[0121] The sum of the length projections of each segment of the right leg of the second model in the x-axis direction, that is, the second component of the right leg in the x-axis direction is:

[0122]

[0123] The sum of the length projections of each segment of the right leg of the second model in the y-axis direction, that is, the second component of the right leg in the y-axis direction is:

[0124]

[0125] The sum of the length projections of each segment of the right leg of the second model in the z-axis direction, that is, the second component of the right leg in the z-axis direction is:

[0126]

[0127] Therefore, the component of the second parameter in the x-axis direction is: The component of the second parameter in the y-axis direction is: The component of the second parameter in the z-axis direction is:

[0128] It is understandable that the execution order of S31 and S32 is not limited.

[0129] S33. Calculate the weighted sum of the components of the first parameter in the preset direction according to the components of the first parameter in the preset direction and the first weight set preconfigured for the x-axis direction to obtain a first optimized parameter in the x-axis direction.

[0130] The first weight set is a set corresponding to the x-axis direction, and is composed of weights pre-configured for the components of the first parameter in the preset direction and the components of the second parameter in the preset direction. In this embodiment, the weights configured for the components of the first parameter in the preset direction and the components of the second parameter in the preset direction are: It can be seen that in this embodiment, the weights in the same direction are the same, but this is not a limitation and may also be different.

[0131] The first optimization parameter in the x-axis direction is:

[0132]

[0133] S34. Calculate a weighted sum of the components of the second parameter in the preset direction according to the components of the second parameter in the preset direction and the first weight set, and determine a second optimization parameter in the x-axis direction.

[0134] The second optimization parameter in the x-axis direction is:

[0135]

[0136] S35. Determine the optimization parameter in the x-axis direction according to the ratio of the second optimization parameter in the x-axis direction to the first optimization parameter in the x-axis direction.

[0137] The optimization parameters in the x-axis direction are:

[0138]

[0139] S36, determining the optimization parameters in the y-axis direction.

[0140] Similarly, the optimization parameters in the y-axis direction are:

[0141]

[0142] It should be noted that as well as The value range of is [0,1]. The values ​​of the above weights can be pre-configured as needed. The weight set used to determine the optimization parameters in the x-axis direction and the weight set used to determine the optimization parameters in the y-axis direction can be the same or different.

[0143] S37. Obtain the position coordinates of the root node of the first model.

[0144] The position coordinates of each node of the first model can be obtained by configuring the motion data of the entity to the first model, which will not be described in detail here.

[0145] S38. Determine the component of the position coordinate of the root node of the second model in the x-axis direction by using the product of the optimization parameter in the x-axis direction and the component of the position coordinate of the root node of the first model in the x-axis direction.

[0146] The product can be used as the component of the position coordinate of the root node of the second model in the x-axis direction, that is, Wherein, i represents the position coordinates of the i-th frame data of the first model.

[0147] The product may also be transformed, for example, multiplied by a coefficient, as the component of the position coordinate of the root node of the second model in the x-axis direction. This is not limited here.

[0148] S39. Determine the component of the position coordinates of the root node of the second model in the y-axis direction using the optimization parameter in the y-axis direction and the component of the position coordinates of the root node of the first model in the y-axis direction.

[0149] For example,

[0150] The method described in this embodiment can not only improve the accuracy of the virtual object's movement by optimizing the position coordinates of the root node, but also, because when the moving parts are the legs, the determination of the optimization parameters of the target direction is combined with the lengths of the two legs, the optimization parameters are more accurate, which is conducive to further improving the accuracy of the virtual object's movement.

[0151] It can be understood that the above process is described using two legs as an example. In addition, it is also possible to determine the optimization parameters using only the length of each node of any one leg.

[0152] It can be understood that the above process takes the preset directions as the x-axis, y-axis and z-axis, and the target directions as the x-axis and y-axis as an example, and is extended to all scenarios. The target direction can be summarized as: the direction perpendicular to the direction of the root node pointing to the end node of the moving part.

[0153] The inventors have found that even if the coordinates in the same or opposite direction as the direction of the end node of the moving part pointed by the root node are not optimized, only the coordinates in the direction perpendicular to the direction of the end node of the moving part pointed by the root node are optimized, the accuracy of the movement of the virtual object can be improved and computing resources can be saved.

[0154] Of course, in the above example scenario, the component in the z-axis direction can also be optimized, that is,

[0155] The component of the position coordinate of the root node of the first model in the z-axis direction and the optimization parameter in the z-axis direction are used to determine the component of the position coordinate of the root node of the second model in the z-axis direction.

[0156] Specific Among them, the method for determining the optimization parameters in the z-axis direction can refer to the method for obtaining the optimization parameters in the x-axis or y-axis direction, which will not be repeated here.

[0157] The following is a more detailed example of the steps described in the above process. It should be noted that in the following example, in order to be more indirect, the root node and the two-leg nodes are taken as an example, and the two-leg nodes only have LeftHips, RightHips, LeftAnkle and RightAnkle:

[0158] 1. Assume that the position data of the nodes of the first model under T-Pose is:

[0159]

[0160] The position data of the nodes of the second model under T-Pose are:

[0161]

[0162] 2. Based on the location data in 1, determine:

[0163]

[0164] 3. Assuming that the weights are all 1, we can get:

[0165]

[0166] 4. Based on the above calculation results and the motion data of each frame of the first model, optimize the position coordinates of the root node of each frame of the second model.

[0167] It can be seen from the above method that, based on the initial state position data of the first model and the second model, the optimization parameters in different coordinate axis directions are respectively determined, and the position data of the root node of the second model is optimized. Because the optimization parameters are based on the initial state position data of the first model and the second model, and the optimization parameters are determined based on the projection length, the length information of the first model and the second model is integrated. Therefore, it is beneficial to correct the problem of large root node deviation caused by different length ratios of the models, thereby reducing the possibility of "skating" of the virtual object driven by the second model.

[0168] Figure 4 A device for optimizing root node data in a model disclosed in an embodiment of the present application includes:

[0169] The first acquisition module is used to obtain the sum of the length projections of each segment length on the moving part in the first model in a preset direction according to the initial position coordinates of each node of the first model, so as to obtain the component of the first parameter in the preset direction; the length of each segment is the length between two adjacent nodes; the first model is a model that carries the motion data of the entity; the preset direction includes the direction of the coordinate axis in the spatial coordinate system where the second model is located.

[0170] The second acquisition module is used to obtain the sum of the projection lengths of each segment length on the moving part in the second model in the preset direction according to the initial position coordinates of each node of the second model, and obtain the component of the second parameter in the preset direction; the second model is a model that drives the 3D virtual object.

[0171] A determination module, configured to determine an optimization parameter based at least on a ratio of a weighted sum of components of the first parameter in the preset direction to a weighted sum of components of the second parameter in the preset direction;

[0172] The optimization module is used to optimize the position coordinates of the root node of the first model using the optimization parameters to obtain the position coordinates of the root node of the second model.

[0173] Optionally, the determination module is used to determine the optimization parameter, including: the determination module is specifically used to determine the optimization parameter of a target direction; the target direction is at least one direction among the preset directions.

[0174] The determination module is used to determine the optimization parameter of the first target direction based on the weighted sum of the components of the first parameter in the preset direction and the ratio of the weighted sum of the second parameter in the preset direction, including: the determination module is specifically used to calculate the weighted sum of the components of the first parameter in the preset direction according to the components of the first parameter in the preset direction and a first weight set pre-configured for the first target direction, to obtain the first optimization parameter of the first target direction; the first weight set is a set composed of weights pre-configured for the components of the first parameter in the preset direction and the components of the second parameter in the preset direction, and the first target direction is any one of the target directions; according to the components of the second parameter in the preset direction and the first weight set, the weighted sum of the components of the second parameter in the preset direction is calculated to obtain the second optimization parameter of the first target direction; the ratio of the second optimization parameter of the first target direction to the first optimization parameter of the first target direction is used as the optimization parameter of the target direction.

[0175] Optionally, the optimization module is used to use the optimization parameters to optimize the position coordinates of the root node of the first model to obtain the position coordinates of the root node of the second model, including: the optimization module is specifically used to determine the position coordinates of the root node of the second model using the product of the optimization parameters and the position coordinates of the root node of the first model.

[0176] Optionally, both the first model and the second model are human body models; the moving part is the left leg and / or the right leg. The component of the first parameter in the first preset direction includes: the sum of the first component of the left leg and the first component of the right leg, the first component of the left leg is: the sum of the length projections of the lengths of each segment of the left leg in the first model in the first preset direction, the first component of the right leg is the sum of the length projections of the lengths of each segment of the right leg in the first model in the first preset direction; the first preset direction is any one of the preset directions.

[0177] The components of the second parameter in the first preset direction include: the sum of the left leg second component and the right leg second component, the left leg second component is: the sum of the length projections of each segment of the left leg in the second model in the first preset direction, and the right leg second component is the sum of the length projections of each segment of the right leg in the second model in the first preset direction.

[0178] Optionally, the target direction includes: a direction perpendicular to the direction from the root node to the end node of the moving part.

[0179] The device described in this embodiment can make the motion trajectory of the virtual object closer to the motion trajectory of the entity, thereby improving the accuracy of the motion of the virtual object.

[0180] If the functions described in the method of the embodiment of the present application are implemented in the form of software functional units and sold or used as independent products, they can be stored in a storage medium readable by a computing device. Based on this understanding, the part of the embodiment of the present application that contributes to the prior art or the 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 to enable a computing device (which can be a personal computer, server, mobile computing device or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0181] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0182] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for optimizing root node data in a model, applied before using the model to drive a 3D virtual object, characterized in that: include: According to the initial position coordinates of each node of the first model, the sum of the length projections of each segment length on the moving part of the first model in a preset direction is obtained to obtain the component of the first parameter in the preset direction; the length of each segment length is the length between two adjacent nodes; The first model is a model that carries the motion data of the entity; the preset direction includes the direction of the coordinate axis in the space coordinate system where the second model is located; According to the initial position coordinates of each node of the second model, the sum of the projection lengths of each segment length on the moving part of the second model in the preset direction is obtained to obtain the component of the second parameter in the preset direction; The second model is a model that drives the 3D virtual object; Determining an optimization parameter based on a ratio of a weighted sum of components of the first parameter in the preset direction to a weighted sum of components of the second parameter in the preset direction; The position coordinates of the root node of the first model are optimized using the optimization parameters to obtain the position coordinates of the root node of the second model.

2. The method according to claim 1, characterized in that Determining the optimization parameter comprises: Determining the optimization parameters of a target direction; the target direction is at least one of the preset directions; Determining an optimization parameter of a first target direction based on a ratio of a weighted sum of components of the first parameter in the preset direction to a weighted sum of components of the second parameter in the preset direction includes: According to the component of the first parameter in the preset direction and the first weight set pre-configured for the first target direction, a weighted sum of the component of the first parameter in the preset direction is calculated to obtain a first optimization parameter of the first target direction; the first weight set is a set consisting of weights pre-configured for the component of the first parameter in the preset direction and the component of the second parameter in the preset direction, and the first target direction is any one of the target directions; Calculating a weighted sum of the components of the second parameter in the preset direction according to the components of the second parameter in the preset direction and the first weight set to obtain a second optimized parameter in the first target direction; The ratio of the second optimization parameter of the first target direction to the first optimization parameter of the first target direction is used as the optimization parameter of the target direction.

3. The method according to claim 2, characterized in that The first model and the second model are both human models; the movement part is the left leg and / or the right leg; The component of the first parameter in the first preset direction includes: The sum of the first component of the left leg and the first component of the right leg, wherein the first component of the left leg is: the sum of the length projections of the lengths of the segments of the left leg in the first model in the first preset direction, and the first component of the right leg is the sum of the length projections of the lengths of the segments of the right leg in the first model in the first preset direction; the first preset direction is any one of the preset directions; The component of the second parameter in the first preset direction includes: The sum of the left leg second component and the right leg second component, wherein the left leg second component is: the sum of the length projections of each segment of the left leg in the second model in the first preset direction, and the right leg second component is the sum of the length projections of each segment of the right leg in the second model in the first preset direction.

4. The method according to claim 2, characterized in that: The target directions include: A direction perpendicular to the direction from the root node to the end node of the moving part.

5. The method according to any one of claims 1 to 4, characterized in that: The step of optimizing the position coordinates of the root node of the first model using the optimization parameters to obtain the position coordinates of the root node of the second model includes: The position coordinates of the root node of the second model are determined by using the product of the optimization parameter and the position coordinates of the root node of the first model.

6. A device for optimizing root node data in a model, characterized in that: include: A first acquisition module is used to acquire, before using the model to drive the 3D virtual object, the sum of the length projections of each segment length on the moving part of the first model in a preset direction according to the initial position coordinates of each node of the first model, so as to obtain the component of the first parameter in the preset direction; the length of each segment is the length between two adjacent nodes; The first model is a model that carries the motion data of the entity; the preset direction includes the direction of the coordinate axis in the space coordinate system where the second model is located; A second acquisition module, used to acquire the sum of the projection lengths of each segment length on the moving part of the second model in the preset direction according to the initial position coordinates of each node of the second model, and obtain the component of the second parameter in the preset direction; The second model is a model that drives the 3D virtual object; A determination module, configured to determine an optimization parameter based at least on a ratio of a weighted sum of components of the first parameter in the preset direction to a weighted sum of components of the second parameter in the preset direction; The optimization module is used to optimize the position coordinates of the root node of the first model using the optimization parameters to obtain the position coordinates of the root node of the second model.

7. The device according to claim 6, characterized in that The determining module is used to determine the optimization parameters including: The determination module is specifically used to determine the optimization parameter of the target direction; the target direction is at least one direction among the preset directions; The determination module is used to determine the optimization parameter of the first target direction based on the ratio of the weighted sum of the components of the first parameter in the preset direction to the weighted sum of the components of the second parameter in the preset direction, including: The determination module is specifically used to calculate the weighted sum of the components of the first parameter in the preset direction according to the components of the first parameter in the preset direction and the first weight set pre-configured for the first target direction, so as to obtain the first optimization parameter of the first target direction; the first weight set is a set composed of weights pre-configured for the components of the first parameter in the preset direction and the components of the second parameter in the preset direction, and the first target direction is any one of the target directions; according to the components of the second parameter in the preset direction and the first weight set, calculate the weighted sum of the components of the second parameter in the preset direction to obtain the second optimization parameter of the first target direction; and use the ratio of the second optimization parameter of the first target direction to the first optimization parameter of the first target direction as the optimization parameter of the target direction.

8. The device according to claim 6 or 7, characterized in that The optimization module is used to optimize the position coordinates of the root node of the first model using the optimization parameters to obtain the position coordinates of the root node of the second model, including: The optimization module is specifically used to determine the position coordinates of the root node of the second model using the product of the optimization parameter and the position coordinates of the root node of the first model.

9. An electronic device, characterized in that: include: Processor and memory; The memory is used to store programs, and the processor is used to run the programs to implement the method for optimizing root node data in the model described in any one of claims 1-5.

10. A computer-readable storage medium having a program stored thereon, characterized in that: When the electronic device runs the program, the method for optimizing the root node data in the model described in any one of claims 1 to 5 is implemented.