Search

CN-122023610-A - Posture adjustment method, device, electronic equipment, storage medium and program product

CN122023610ACN 122023610 ACN122023610 ACN 122023610ACN-122023610-A

Abstract

The present disclosure provides a posture adjustment method, a device, an electronic apparatus, a storage medium and a program product, and relates to the technical field of animation, wherein the posture adjustment method comprises the steps of obtaining position data of a first target skeleton and a second target skeleton of a virtual character from skeleton data of the virtual character, wherein the first target skeleton and the second target skeleton have a hierarchical relationship; analyzing the position data to obtain current relative position information, wherein the current relative position information is used for indicating the current relative position between a first target skeleton and a second target skeleton of the virtual character in the current gesture, determining the relative gesture relation between the current relative position information and the target relative position information, wherein the target relative position information is used for indicating the target relative position between the first target skeleton and the second target skeleton of the virtual character in the target gesture, and adjusting the gesture of the virtual character according to the relative gesture relation. Compared with the related art, the method and the device can improve the efficiency and the accuracy of posture adjustment.

Inventors

  • WU HEKANG

Assignees

  • 广州博冠信息科技有限公司

Dates

Publication Date
20260512
Application Date
20260104

Claims (15)

  1. 1. A method of posture adjustment, the method comprising: acquiring position data of a first target skeleton and a second target skeleton of a virtual character from skeleton data of the virtual character, wherein the first target skeleton and the second target skeleton have a hierarchical relationship; Analyzing the position data to obtain current relative position information, wherein the current relative position information is used for indicating the current relative position between the first target skeleton and the second target skeleton of the virtual character in the current posture; Determining a relative posture relation between the current relative position information and target relative position information, wherein the target relative position information is used for indicating a target relative position between the first target skeleton and the second target skeleton of the virtual character in a target posture; and adjusting the gesture of the virtual character according to the relative gesture relation.
  2. 2. The method of claim 1, wherein the hierarchical relationship comprises a parent-child constraint relationship, the first target bone is a parent bone of the second target bone, and wherein adjusting the pose of the virtual character based on the relative pose relationship comprises: and adjusting the gesture of the first target skeleton according to the relative gesture relation so as to adjust the gesture of the virtual character.
  3. 3. The method of claim 2, wherein the current relative position information comprises a first directional vector in a world coordinate system in which the first target bone is pointed toward the second target bone, the target relative position information comprises a second directional vector preset in the world coordinate system, and wherein prior to determining the relative pose relationship of the current relative position information and target relative position information, the method further comprises: acquiring preset plane axis information and preset axis orientation corresponding to the first target bone and the second target bone, and coordinate system rules of the world coordinate system; Determining a normal vector corresponding to the preset plane axis information based on the coordinate system rule; The second direction vector is determined based on the preset axis orientation and the normal vector.
  4. 4. The method of claim 3, wherein the positional information of the first target bone comprises translational components of a homogeneous spatial matrix of the first target bone in the world coordinate system, and wherein the determining the relative pose relationship of the current relative positional information and target relative positional information comprises: generating a first rotation matrix based on the first direction vector and the second direction vector, wherein the first rotation matrix is used for indicating the first target bone to rotate around a primary point in the world coordinate system; based on the translation component, adjusting the first rotation matrix to obtain a second rotation matrix, wherein the second rotation matrix is used for indicating the first target bone to rotate around the original point of the local coordinate system of the first target bone; and superposing the homogeneous space matrix to the second rotation matrix to obtain a third rotation matrix, wherein the third rotation matrix is used for indicating the relative posture relation.
  5. 5. The method of claim 4, wherein the generating a first rotation matrix based on the first direction vector and the second direction vector comprises: determining a rotation axis and a rotation angle corresponding to the first direction vector when the first direction vector rotates to the second direction vector; the first rotation matrix is determined based on the rotation axis and the rotation angle.
  6. 6. The method of claim 5, wherein determining the rotation axis and rotation angle corresponding to the rotation of the first direction vector to the second direction vector comprises: performing cross multiplication on the first direction vector and the second direction vector to obtain the rotating shaft; and carrying out dot product on the first direction vector and the second direction vector to obtain the rotation angle.
  7. 7. The method according to any one of claims 4-6, wherein said adjusting the first rotation matrix based on the translation component results in a second rotation matrix, comprising: Performing translation transformation on the first rotation matrix based on the translation component to obtain a fourth rotation matrix, wherein the fourth rotation matrix is used for indicating the first target bone to rotate around the first rotation matrix in the world coordinate system; and carrying out coordinate system conversion on the fourth rotation matrix based on the translation component to obtain the second rotation matrix.
  8. 8. The method of claim 7, wherein the performing coordinate system conversion on the fourth rotation matrix based on the translation component to obtain the second rotation matrix comprises: Constructing a translation matrix corresponding to the first target bone based on the translation component; And adjusting the fourth rotation matrix based on an inverse matrix corresponding to the translation matrix to obtain the second rotation matrix.
  9. 9. The method according to any one of claims 1-6, further comprising: And executing the posture adjustment operation of the virtual character in a plurality of control rounds, wherein each control round is switched into a first target skeleton and a second target skeleton which are different, and the first target skeletons in two adjacent control rounds have a hierarchical relationship.
  10. 10. The method of claim 9, wherein prior to performing the posing adjustment operation of the virtual character in a plurality of control passes, the method further comprises: acquiring first bone data of the virtual character, wherein the first bone data is used for indicating a plurality of target bones in the virtual character; screening out the target relative position information from a plurality of preset relative position information based on the first bone data, wherein each preset relative position information is used for indicating a reference relative position between two bones corresponding to the preset relative position information; and determining control rounds corresponding to the target relative position information respectively based on the hierarchical relation between the first target bones corresponding to the target relative position information respectively.
  11. 11. The method of claim 9, wherein prior to performing the posing adjustment operation of the virtual character in a plurality of control passes, the method further comprises: Acquiring a plurality of preset second bone data, wherein the second bone data are used for indicating a plurality of bones; A hierarchical relationship between the bones is determined based on the physical connection relationship between the plurality of bones.
  12. 12. An attitude adjustment device, characterized in that the device comprises: the system comprises an acquisition module, a first target skeleton, a second target skeleton, a first control module and a second control module, wherein the acquisition module is used for acquiring position data of a first target skeleton and a second target skeleton of a virtual role from skeleton data of the virtual role; The analysis module is used for analyzing the position data to obtain current relative position information, wherein the current relative position information is used for indicating the current relative position between the first target skeleton and the second target skeleton of the virtual character in the current gesture; The system comprises a determination module, a target relative position information acquisition module and a target position information acquisition module, wherein the determination module is used for determining the relative gesture relation between the current relative position information and the target relative position information; and the adjustment module is used for adjusting the gesture of the virtual character according to the relative gesture relation.
  13. 13. An electronic device, comprising: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the posture adjustment method of any one of claims 1 to 11.
  14. 14. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon computer instructions for causing a computer to execute the posture adjustment method of any one of claims 1 to 11.
  15. 15. A computer program product comprising computer instructions for causing a computer to perform the posture adjustment method of any one of claims 1 to 11.

Description

Posture adjustment method, device, electronic equipment, storage medium and program product Technical Field The present disclosure relates to the field of animation technologies, and in particular, to a gesture adjustment method, a gesture adjustment device, an electronic device, a storage medium, and a program product. Background In the field of three-dimensional animation production and game development, the standard reference gestures of human characters such as T-shaped gestures and A-shaped gestures are the basis of operations such as character skeleton binding, animation redirection, collision detection and the like in the subsequent production flow, and the fluency and production efficiency of character animation are directly affected. However, in the related art, the posture adjustment is manually adjusted by manpower, so that the time and the labor are consumed, the adjustment precision is dependent on experience of a manufacturer, the problems of disordered skeleton weight, limb cooperative deviation and the like are easy to occur, the batch processing requirement of large-scale character manufacturing is difficult to meet, and the flow efficiency of three-dimensional animation and game development is restricted. Therefore, how to automatically convert a non-standard pose into a standard reference pose is an important point of current interest. Disclosure of Invention The disclosure provides a posture adjustment method, a device, electronic equipment, a storage medium and a program product, so as to solve the problems of low efficiency, poor accuracy and the like of character posture adjustment in the related technology. In a first aspect, the present disclosure provides a posture adjustment method, the method comprising: acquiring position data of a first target skeleton and a second target skeleton of the virtual character from skeleton data of the virtual character, wherein the first target skeleton and the second target skeleton have a hierarchical relationship; analyzing the position data to obtain current relative position information, wherein the current relative position information is used for indicating the current relative position between a first target skeleton and a second target skeleton of the virtual character in the current gesture; Determining a relative posture relation between current relative position information and target relative position information, wherein the target relative position information is used for indicating a target relative position between a first target skeleton and a second target skeleton of the virtual character in a target posture; And adjusting the posture of the virtual character according to the relative posture relation. In a second aspect, the present disclosure provides a posture adjustment apparatus, comprising: the system comprises an acquisition module, a hierarchy relation acquisition module and a hierarchy relation acquisition module, wherein the acquisition module is used for acquiring position data of a first target skeleton and a second target skeleton of a virtual character from skeleton data of the virtual character; The analysis module is used for analyzing the position data to obtain current relative position information, wherein the current relative position information is used for indicating the current relative position between a first target skeleton and a second target skeleton of the virtual character in the current gesture; The system comprises a determining module, a target relative position information determining module and a target position determining module, wherein the determining module is used for determining the relative gesture relation between the current relative position information and the target relative position information; And the adjusting module is used for adjusting the gesture of the virtual character according to the relative gesture relation. In a third aspect, the present disclosure provides an electronic device, including a memory and a processor, where the memory and the processor are communicatively connected to each other, and the memory stores computer instructions, and the processor executes the computer instructions, thereby executing the posture adjustment method of the first aspect or any embodiment thereof. In a fourth aspect, the present disclosure provides a computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the posture adjustment method of the first aspect or any of its corresponding embodiments. In a fifth aspect, the present disclosure provides a computer program product comprising computer instructions for causing a computer to perform the attitude adjustment method of the first aspect or any of its corresponding embodiments. In the gesture adjustment method provided by the embodiment of the disclosure, the current relative position information of the first target skeleton and the second target skeleton is determined by acquir