Generation method of biological universal animation data

By defining biological bone coding and coordinate system conversion for three-dimensional animation data, configuring the mapping unit to bind the controller to generate biological general animation data files, solving the problem of animation data interoperability between different three-dimensional software, and realizing the sharing and flexible use of animation data.

CN120374811APending Publication Date: 2025-07-25WUHAN TEN PAST TWO CULTURAL COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510461957.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

Due to the different binding rules of the existing three-dimensional animation production software, the animation data cannot be communicated and shared, resulting in waste of resources and repeated labor.

Method used

By defining the unique encoding and coordinate system transformation matrix of biological bones, the mapping unit is configured to bind the controller and biological bones, calculate the scale of the lower limb length, and generate a biological universal animation data file.

Benefits of technology

The animation data sharing between different three-dimensional software is realized, which improves the universality and flexibility of animation data, and reduces repetitive labor and resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120374811A_ABST
    Figure CN120374811A_ABST
Patent Text Reader

Abstract

The invention provides a biological universal animation data generation method, and belongs to the technical field of character animation data generation. Comprising the following steps: defining and coding a biological skeleton of a role, configuring a relative position of the biological skeleton of the role according to a code, and obtaining a world coordinate matrix of the biological skeleton under an initial posture; configuring a mapping unit, and acquiring a world coordinate matrix of each controller under the initial attitude; a world coordinate matrix of each controller in each frame is obtained, and a world coordinate matrix of each biological skeleton in each frame is obtained and stored; the lower limb length of the role is calculated, and the displacement part of each biological skeleton in the world coordinate matrix of each frame is scaled, so that the lower limb length of the role is unified as the unit length; and recording the world coordinate matrix and the frame number after scaling of the displacement part based on the coding of the biological skeleton, and generating an animation data file based on the biological skeleton.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of character animation data generation, and in particular to a method for generating general biological animation data. Background Art

[0002] In 3D animation, a large amount of character animations need to be produced. These animation data are usually restricted by 3D software and binding methods, and generally can only be used on the current character of the current software. Commonly used 3D animation production software, such as maya, max, blender, c4d, etc. In these 3D animation production software, the character binding rules are different, resulting in the inability to interoperate and share the animation formats of 3D software. For example, the animation data bound by maya cannot be directly used for the max biped skeleton. The non-universal animation data brings a large amount of repetitive labor, which also causes a great waste of resources. In order to enable different software to share animation data, a common method is to use an intermediate file in fbx format. However, the fbx file is a kind of skeleton data and cannot be directly bound to the characters of the current 3D animation production software.

[0003] To change the above situation, it is very necessary to provide a method for generating general biological animation data, which can meet the requirements of different 3D animation production software, adapt to the definitions of different 3D software space descriptions and the needs of character binding, and improve the generality of animation data. Summary of the Invention

[0004] In view of this, the present invention proposes a method for generating general biological animation data that is applicable to the requirements of different 3D software, binds the positional relationship between biological skeletons and controllers, and has good generality of animation data.

[0005] The present invention provides a method for generating general biological animation data, including the following steps:

[0006] S1: Define the conversion matrix formula between the left-handed coordinate system and the right-handed coordinate system;

[0007] S2: Define and encode the biological skeletons of the character, and different biological skeletons in different positions have unique encodings;

[0008] S3: Based on the right-handed coordinate system, configure the relative positions of the biological skeletons of the character according to the encoding to obtain the world coordinate matrix of the biological skeletons in the initial pose;

[0009] S4: Configure a mapping unit, and the mapping unit is used to bind the mapping relationship between the controllers in the initial pose and the corresponding biological skeletons; obtain the world coordinate matrix of each controller in the initial pose and the offset matrix with the corresponding biological skeleton;

[0010] S5: Obtain the world coordinate matrix of each controller at each frame within the animation time period, calculate the world coordinate matrix of each biological bone at each frame, and save it;

[0011] S6: Calculate the length of the lower limbs of the character, obtain the proportional relationship between the lower limb length and the unit length, perform proportional scaling on the displacement part in the world coordinate matrix of each biological bone at each frame, so that the limb lengths of the character are unified to the unit length; record the encoding of the biological bone, the world coordinate matrix after proportional scaling of the displacement part, and the number of frames, generate an animation data file based on the biological bone, and export it in the right - hand coordinate system.

[0012] Based on the above technical solution, preferably, the content of step S1 is to define the matrix SWAPYZ for swapping the Y and Z axes and the matrix INVERT Z for flipping the Z axis. Let the position matrix of a point in the left - hand coordinate system be PL, and the position matrix of a point in the right - hand coordinate system be PR. Then the transformation matrix formula for converting a point in the right - hand coordinate system to a point in the left - hand coordinate system is PL=(SWAPYZ)@PR@(INVERT Z), where @ represents matrix multiplication; the transformation matrix formula for converting a point in the left - hand coordinate system to a point in the right - hand coordinate system is PR=(INVERT Z) T @PL@(SWAP YZ) T , where the superscript T represents the transpose operation.

[0013] Based on the above technical solution, preferably, the content of step S2 is to use the waist of the character as a reference. Extend from one side of the waist to form the chest, neck, and head, and extend from the other side of the waist to form the hips. The head, neck, chest, waist, and hips together form the trunk part; on both sides of the chest, there are a left upper limb and a right upper limb respectively. The left upper limb includes biological bones corresponding to the left shoulder, left upper arm, left forearm, left palm, and left fingers arranged in sequence. The right upper limb includes biological bones corresponding to the right shoulder, right upper arm, right forearm, right palm, and right fingers arranged in sequence; on both sides of the hips, there are a left lower limb and a right lower limb respectively. The left lower limb includes biological bones corresponding to the left thigh, left calf, left foot sole, and left toes arranged in sequence. The right lower limb includes biological bones corresponding to the right thigh, right calf, right foot sole, and right toes arranged in sequence; encode and distinguish the biological bones in different parts of the trunk part, left upper limb, right upper limb, left lower limb, and right lower limb respectively;

[0014] The biological bone of the waist, as the root bone of the trunk part, is the parent bone of the biological bones of the chest and hips; the biological bone of the hips is the parent bone of the left and right lower limbs; the biological bone of the chest is the parent bone of the biological bones of the neck, left upper limb, and right upper limb; the biological bone of the neck is the parent bone of the biological bone of the head.

[0015] Preferably, the coding structure of each biological bone is (a, b), where a is the part coding information and b is the quantity coding information; biological bones of non-finger parts of the same limb connected to the chest, or biological bones of non-toe parts of the same limb connected to the hip, have the same part coding information; biological bones of different parts of the common part of the torso have different corresponding part coding information.

[0016] More preferably, the content of step S3 is that the initial posture is defined as the character standing, the torso part is upright, the distance between the soles of the lower limbs is the same as the width of the shoulders of the upper limbs, and the upper limbs extend linearly and obliquely to both sides of the body;

[0017] If there is an adjacent lower biological bone for the current biological bone, the X-axis direction of the current biological bone points to the adjacent lower biological bone, and the normal bending side direction of the current biological bone relative to the adjacent upper biological bone is the positive direction of the Z-axis; if the current biological bone has no adjacent lower biological bone, the direction from the current biological bone to the adjacent upper biological bone is the -X axis, and the normal bending side direction of the current biological bone relative to the adjacent upper biological bone is the positive direction of the Z-axis; respectively obtain the vector V according to the orientation of the X-axis x , obtain the vector V according to the orientation of the Z-axis z , and the vector V x is cross-multiplied with the vector V z to obtain the vector V y , and the direction of the vector V y is the orientation of the Y-axis; then the vector V of the Y-axis y and the vector V of the X-axis x are cross-multiplied to obtain the corrected Z-axis vector V′ z , and the rotation matrix synthesized by the vectors V x , V y , V′ z is used as the rotation matrix of the current biological bone; taking the coordinates of the current biological bone in the right-hand coordinate system as the position information, the position information and rotation matrix of each biological bone of the character are synthesized to obtain the world coordinate matrix of the initial posture of all biological bones of the character; if the target software uses the left-hand coordinate system, the world coordinate matrix of the initial posture of all biological bones in the right-hand coordinate system is converted into the world coordinate matrix of the initial posture of all biological bones in the left-hand coordinate system through the conversion matrix formula in step S1.

[0018] More preferably, the content of step S4 is that in the initial posture, obtain the world coordinate matrix M c of the controller, obtain and record the offset matrix OFF j between the world coordinate matrix of each biological bone and the corresponding controller, j OFF j = M j * Mc.inverse , M j is the world coordinate matrix of the biological skeleton in the initial pose, and M c.inverse is the inverse matrix of the world coordinate matrix M c of the biological skeleton corresponding to the corresponding controller.

[0019] More preferably, the content of step S5 is to obtain the world coordinate matrix M cf of each controller in each frame during the animation time period, and according to the formula M jf = OFF j * M cf , calculate the world coordinate matrix M jf of the biological skeleton corresponding to the controller in each frame, and record and save the encoding, the world coordinate matrix M jf of each biological skeleton in each frame during the animation time period, and the frame number.

[0020] Even more preferably, the content of step S6 is to define the matrix scaling function SetMatrixTsScale, and use the matrix scaling function SetMatrixTsScale to scale the displacement part in the world coordinate matrix M jf obtained in step S5, and uniformly scale the length of the biological skeleton of the lower limbs of the current character to the unit length and save it; based on the encoding of the biological skeleton and the world coordinate matrix M' j of the biological skeleton after proportional scaling of the displacement part and the frame number, generate the animation data file of the biological skeleton.

[0021] Even further preferably, when the animation data file of a character needs to be used, through the mapping tool, obtain the encoding of the controller and the biological skeleton of the character, and obtain the offset matrix OFF j of each biological skeleton corresponding to the corresponding controller according to the initial pose in step S3, and generate each biological skeleton in the initial pose; then for the current biological skeleton with a parent skeleton, calculate the local matrix M jl , M jl = M j * M p.inverse , where M p.inverse is the inverse matrix of the world coordinate matrix of the parent skeleton of the current biological skeleton, and for the current biological skeleton without a parent skeleton, the local matrix is not calculated;

[0022] Obtain the lower limb length L' of the character through the controller data, and satisfy the following formula M' j = SetMatrixTsScale(M j , L'), and restore the displacement part in the world coordinate matrix M' j of all biological skeletons in the animation data according to the ratio of L'.

[0023] After assigning the animation data with limb length scaling to the biological skeleton, for non-lower limb biological skeletons, they are assigned hierarchically from top to bottom according to the relationship between the root skeleton and the parent skeleton of the biological skeleton: First, according to the obtained local matrix M of the current biological skeleton jl and the world matrix M of the parent skeleton of the current biological skeleton p , the world coordinate matrix M of the current biological skeleton under the animation drive of the parent skeleton is obtained jw = M jl * M p . Then, take the displacement part of the world coordinate matrix M of the current biological skeleton under the animation drive of the parent skeleton jw and the rotation part of the world coordinate matrix M' of all biological skeletons in the animation data j to synthesize a new matrix, which is the world coordinate matrix M of the current non-lower limb skeleton corresponding to each frame jf ;

[0024] For lower limb biological skeletons, inverse kinematics is used for calculation to obtain the world coordinate matrix of the lower limb biological skeleton;

[0025] After obtaining the world coordinate matrix of all biological skeletons for each frame, multiply the world coordinate matrix M of each biological skeleton jf by the inverse matrix of the offset matrix OFF j . The synthesized matrix is the world coordinate matrix M of the corresponding controller for each frame cf .

[0026] Furthermore, preferably, inverse kinematics is used for calculation to obtain the world coordinate matrix of the lower limb biological skeleton. Specifically, the world coordinate matrix of the biological skeleton of the non-waist lower limb part is calculated using the following formula: MtList = GetIKBoneMatrix(TsList, TmtList), where TsList is the displacement sequence of the current lower limb in the animation data, TmtList is the matrix of the lower limb skeleton in the initial posture, MtList is the world coordinate matrix of the lower limb biological skeleton, and GetIKBoneMatrix is a function to extract the world coordinate matrix of the biological skeleton.

[0027] A method for generating general biological animation data provided by the present invention has the following beneficial effects compared with the prior art:

[0028] (1) The present invention constructs a general biological skeleton model for biological characters. Each biological bone has a unique code and a standard length, which is convenient for data management. Further, the initial postures of the characters composed of each biological bone are defined, so that there is a unified starting point in the process of animation generation, which is convenient for subsequent posture adjustment and parameter calculation of animation frames. By configuring the mapping unit, one or more controllers are bound to the same biological bone, which is convenient for tracking and adjusting the position and posture of the biological bone during the animation process.

[0029] (2) Record the offset matrix of each biological bone and the corresponding controller, which is convenient for adjusting the posture and position in the animation, ensuring the flexibility and accuracy of the animation. During the animation time period, save the code, world coordinate matrix and frame number of each biological bone in each frame, ensuring the integrity and traceability of the animation data, realizing the frame-by-frame correspondence between the animation data and the pose of the biological bone, and ensuring the flexibility and accuracy of the animation content. Description of the Drawings

[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0031] Figure 1 It is a flowchart of a method for generating general biological animation data of the present invention;

[0032] Figure 2 It is a schematic diagram of the natural bending of the character bones in a method for generating general biological animation data of the present invention. Detailed Embodiments

[0033] The following will describe clearly and completely the technical solutions in the embodiments of the present invention in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0034] Combined with Figure 1 It can be seen that the present invention provides a method for generating general biological animation data, including the following steps:

[0035] S1: Define the conversion matrix formula between the left-handed coordinate system and the right-handed coordinate system.

[0036] The content of step S1 is to define the matrix SWAP YZ for swapping the Y and Z axes and the matrix INVERT Z for flipping the Z axis. Let the position matrix of points in the left - hand coordinate system be PL and the position matrix of points in the right - hand coordinate system be PR. Then the transformation matrix formula for converting points in the right - hand coordinate system to points in the left - hand coordinate system is PL=(SWAP YZ)@PR@(INVERT Z), where @ represents matrix multiplication; the transformation matrix formula for converting points in the left - hand coordinate system to points in the right - hand coordinate system is PR=(INVERT Z) T @PL@(SWAP YZ) T , and the superscript T represents the transpose operation.

[0037] For example, the content of the matrix SWAP YZ for swapping the Y and Z axes here is: The content of the matrix INVERT Z for flipping the Z axis is:

[0038] S2: Define and encode the biological bones of the character. The biological bones in different positions have unique encodings.

[0039] The content of step S2 is to use the character's waist as a reference. Extend from one side of the waist to form the chest, neck, and head, and extend from the other side of the waist to form the hips. The head, neck, chest, waist, and hips together form the trunk part; on both sides of the chest, there are a left upper limb and a right upper limb respectively. The left upper limb includes biological bones corresponding to the left shoulder, left upper arm, left forearm, left palm, and left fingers arranged in sequence. The right upper limb includes biological bones corresponding to the right shoulder, right upper arm, right forearm, right palm, and right fingers arranged in sequence; on both sides of the hips, there are a left lower limb and a right lower limb respectively. The left lower limb includes biological bones corresponding to the left thigh, left calf, left foot sole, and left toes arranged in sequence. The right lower limb includes biological bones corresponding to the right thigh, right calf, right foot sole, and right toes arranged in sequence; encode and distinguish the biological bones in different parts of the trunk part, left upper limb, right upper limb, left lower limb, and right lower limb respectively;

[0040] The biological bone of the waist, as the root bone of the trunk part, is the parent bone of the biological bones of the chest and hips; the biological bone of the hips is the parent bone of the left and right lower limbs; the biological bone of the chest is the parent bone of the biological bones of the neck, left upper limb, and right upper limb; the biological bone of the neck is the parent bone of the biological bone of the head.

[0041] For a humanoid character, the left upper limb and the left lower limb are respectively defined on both sides of the chest. The left upper limb includes the biological bones corresponding to the left shoulder, the left upper arm, the left forearm, the left palm, and the left fingers in sequence and are encoded; the right upper limb includes the biological bones corresponding to the right shoulder, the right upper arm, the right forearm, the right palm, and the right fingers in sequence and are encoded; on both sides of the end of the hip near the ground, the left lower limb and the right lower limb are respectively defined. The left lower limb includes the biological bones corresponding to the left thigh, the left calf, the left foot sole, and the left toes in sequence and are encoded; the right lower limb includes the biological bones corresponding to the right thigh, the right calf, the right foot sole, and the right toes in sequence and are encoded;

[0042] The initial lengths of the biological bones are all the default unit lengths. Here, the default unit length can be 10 cm, 5 cm, or 1 cm. In this embodiment, it is preferably 1 cm. Subsequent corresponding scaling operations are performed according to the actual situation.

[0043] The following table shows the starting serial numbers for encoding different parts of the biological bones.

[0044] Part Encoding Part Encoding Part Encoding Normal bone 100,1 Left palm 1,4 Left foot sole 5,3 Hip 0,1 Right palm 2,4 Right foot sole 6,3 Waist 9,1 Left fingers 3,1 Left toes 7,1 Chest 12,1 Right fingers 4,1 Right toes 8,1 Left shoulder 1,1 Left thigh 5,1 Tail 10,1 Right shoulder 2,1 Right thigh 6,1 Left upper arm 1,2 Left lower leg 5,2 Right upper arm 2,2 Right lower leg 6,2 Left lower arm 1,3 Neck 17,1 Right lower arm 2,3 Head 11,1

[0045] The encoding in this embodiment is applicable not only to humanoid characters but also to quadruped characters. The encoding of the trunk part and the limb part of the quadruped character is similar to that of the humanoid character, and the corresponding animation data is also applicable to the ranges of humans and quadrupeds. The difference is that the quadruped character also includes a tail and ordinary bones. The ordinary bones are biological bones without specific parts that cannot be classified as biological bones for the quadruped character. The ordinary bones can be the horns on the head, the protrusions on the back, or the appendages on both sides of the body, etc., which are biological bones with specific shapes and positions.

[0046] As can be seen from the above table, the encoding of the biological bones is (a, b), where a is the part encoding information and b is the quantity encoding information; for the biological bones of the non-finger or non-toe parts of the same limb connected to the chest or the hip, they have the same part encoding information a; for the biological bones of different parts of the common part of the trunk, the corresponding part encoding information a is different from each other.

[0047] In the above table, first, the biological bones are classified according to the installation part. The part encoding information a corresponding to the hip biological bone, the waist biological bone, the chest biological bone, the neck biological bone, and the head biological bone, which are the basis of the common part of the trunk, are 0, 9, 12, 17, and 11 respectively; the part encoding information a of the left upper limb, the right upper limb, the left lower limb, and the right lower limb are 1, 2, 5, and 6 respectively; the part encoding information a of the tail of the quadruped is 10. When encoding, the structure of this part is simplified. For example, only one biological bone is used to represent the shoulder part, the forearm part, the calf part, the palm part, and the foot sole part in the limb.

[0048] For the common parts of the torso, if there are multiple biological bones in the same part, they are expressed in the form of (a, 1), (a, 2), (a, 3),... etc. For example, if there are 4 biological bones in the waist, they are represented by the codes (9, 1), (9, 2), (9, 3) and (9, 4) respectively.

[0049] For the same limb, each biological bone in the non-finger or non-toe part of the limb uses the same part coding information, and according to the extension direction away from the chest or hip, the quantity coding information increases sequentially. For example, the codes of the left shoulder biological bone, the left upper arm biological bone, the left forearm biological bone and the left palm biological bone included in the left upper limb are represented as (1, 1), (1, 2), (1, 3) and (1, 4) in sequence, because there is only one biological bone in the left shoulder biological bone, the left upper arm biological bone, the left forearm biological bone and the left palm biological bone in the upper limb.

[0050] For fingers or toes, they have independent part coding information and sequentially increasing quantity coding information. For example, in the order of thumb, index finger, middle finger, ring finger and little finger, and in the order from near to far from the palm, the codes of the biological bones of the left thumb are (3, 1), (3, 2) and (3, 3), and the codes of the biological bones of the left index finger are (3, 4), (3, 5) and (3, 6), and so on. As Figure 2 shown, sometimes the biological bones of the toes of the foot can also be simplified into a biological bone with an overall shape.

[0051] As for the coding method of ordinary bones, the same part coding information 100 is adopted, and different quantity coding information is numbered sequentially, and the part coding information of the biological bone where the ordinary bone is located is recorded separately.

[0052] It should be noted that when the character animation data defines the biological bones using data or matrix content, a table with the same coding rules as the above content is adopted, so that there is a corresponding relationship in the data.

[0053] S3: Based on the right-handed coordinate system, configure the relative positions of the biological bones of the character according to the coding to obtain the world coordinate matrix of the biological bones in the initial pose.

[0054] The content of step S3 is that the initial pose is defined as the character standing, the torso part is upright, the distance between the soles of the lower limbs is the same as the width of the shoulders of the upper limbs, and the upper limbs linearly extend obliquely to both sides of the body;

[0055] If there is an adjacent lower biological bone of the current biological bone, the X-axis direction of the current biological bone points to the adjacent lower biological bone, and the normal bending side direction of the current biological bone relative to the adjacent upper biological bone is the positive Z-axis; if there is no adjacent lower biological bone of the current biological bone, the direction from the current biological bone to the adjacent upper biological bone is the -X axis, and the normal bending side direction of the current biological bone relative to the adjacent upper biological bone is the positive Z-axis; a vector V is obtained according to the orientation of the X-axis x , and a vector V is obtained according to the orientation of the Z-axis z . The vector V x is cross-multiplied with the vector V z to obtain a vector V y . The direction of the vector V y is the orientation of the Y-axis; then, the vector V of the Y-axis y and the vector V of the X-axis x are cross-multiplied to obtain the corrected Z-axis vector V' z . The rotation matrix synthesized by the vectors V x , V y , and V' z is used as the rotation matrix of the current biological bone; the coordinates of the current biological bone in the right-handed coordinate system are used as the position information, and the position information and rotation matrix of each biological bone of the character are synthesized to obtain the world coordinate matrix of the initial pose of all biological bones of the character; if the target software uses a left-handed coordinate system, the world coordinate matrix of the initial pose of all biological bones in the right-handed coordinate system is converted into the world coordinate matrix of the initial pose of all biological bones in the left-handed coordinate system.

[0056] As Figure 2 shown, the figure shows a schematic diagram of the natural bending of the biological bone. The natural bending direction of the torso is forward, the forearm flexes at a certain angle relative to the upper arm, and the fingers extend relative to the palm; the sole of the foot fits the ground, the calf inclines forward relative to the sole of the foot, and the thigh bends successively relative to the calf.

[0057] S4: Configure a mapping unit. The mapping unit is used to bind the mapping relationship between the controller in the initial pose and the corresponding biological bone; obtain the world coordinate matrix of each controller in the initial pose, and the offset matrix from the corresponding biological bone.

[0058] The content of step S4 is that in the initial pose, the world coordinate matrix M c of the controller is obtained, and the world coordinate matrix of each biological bone and the offset matrix OFF j corresponding to the corresponding controller are obtained and recorded. OFF j = M j * M c.inverse , M jis the world coordinate matrix of the biological bone in the initial pose, M c.inverse is the world coordinate matrix M of the biological bone and the corresponding controller c of the inverse matrix.

[0059] S5: Obtain the world coordinate matrix of each controller in each frame of the animation time period, calculate the world coordinate matrix of each biological bone in each frame and save it.

[0060] Obtain the world coordinate matrix M of each controller in each frame during the animation time period cf , according to the formula M jf = OFF j *M cf , calculate the world coordinate matrix M of the biological bone corresponding to the controller in each frame jf , record and save the encoding of each biological bone, the world coordinate matrix M of the biological bone jf and the number of frames in each frame of the animation time period.

[0061] S6: Calculate the lower limb length of the character, obtain the proportional relationship between the lower limb length and the unit length, perform proportional scaling on the displacement part in the world coordinate matrix of each biological bone in each frame, so that the limb length of the character is unified to the unit length; record the encoding of the biological bone, the world coordinate matrix after proportional scaling of the displacement part and the number of frames, generate an animation data file based on the biological bone, and export it according to the right - hand coordinate system.

[0062] The content of step S6 is to define the matrix scaling function SetMatrixTsScale, and use the matrix scaling function SetMatrixTsScale to scale the displacement part in the biological bone world coordinate matrix M jf obtained in step S5, unify the length of the biological bones of the lower limbs of the current character to the unit length and save it; based on the encoding of the biological bone, the biological bone world coordinate matrix M' j after proportional scaling of the displacement part and the number of frames, generate an animation data file of the biological bone.

[0063] The following is illustrated by a specific embodiment: When an animation data file of a character is needed, through a mapping tool, obtain the encoding of the controller and the biological bone of the character, and according to the initial pose of step S3, obtain the offset matrix OFF j between each biological bone and the corresponding controller, and generate each biological bone in the initial pose; then for the current biological bone with a parent bone, calculate the local matrix M jl , M jl = M j *M p.inverse , where M p.inverseIs the inverse matrix of the world coordinate matrix of the parent bone of the current biological bone. For the current biological bone without a parent bone, the local matrix is not calculated.

[0064] Obtain the lower limb length L′ of the character through the controller data, which satisfies the following formula M′ j = SetMatrixTsScale(M j , L′), and restore the displacement part in the world coordinate matrix M′ j of all biological bones in the animation data according to the ratio of L′.

[0065] After assigning the animation data with limb length scaling to the biological bones, for non-lower limb biological bones, assign them hierarchically from top to bottom according to the relationship between the root bone - parent bone of the biological bones: First, according to the obtained local matrix M jl of the current biological bone and the world matrix M p of the parent bone of the current biological bone, obtain the world coordinate matrix M jw of the current biological bone driven by the parent bone animation = M jl *M p , then take the displacement part of the world coordinate matrix M jw of the current biological bone driven by the parent bone animation and the rotation part of the world coordinate matrix M′ j of all biological bones in the animation data, and synthesize a new matrix, which is the world coordinate matrix M jf of the current non-lower limb bone corresponding to each frame;

[0066] For lower limb biological bones, use inverse kinematics for calculation to obtain the world coordinate matrix of the lower limb biological bones. Specifically, the world coordinate matrix of the biological bones in the non-waist lower limb part is calculated using the following formula: MtList = GetIKBoneMatrix(TsList, TmtList), where TsList is the displacement sequence of the current lower limb in the animation data, TmtList is the matrix of the lower limb bones in the initial pose, MtList is the world coordinate matrix of the lower limb biological bones, and GetIKBoneMatrix is a function to extract the world coordinate matrix of the biological bones.

[0067] After obtaining the world coordinate matrix of all biological bones for each frame, multiply the world coordinate matrix M jf of each biological bone by the inverse matrix of the offset matrix OFF j , and the synthesized matrix is the world coordinate matrix M cf of the corresponding controller for each frame.

[0068] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for generating general biological animation data, characterized in that It includes the following steps: S1: Define the conversion matrix formula between the left - hand coordinate system and the right - hand coordinate system; S2: Define and encode the biological bones of the character. The biological bones in different positions have unique encodings; S3: Based on the right - hand coordinate system, configure the relative positions of the biological bones of the character according to the encoding to obtain the world coordinate matrix of the biological bones in the initial pose; S4: Configure the mapping unit. The mapping unit is used to bind the mapping relationship between the controller in the initial pose and the corresponding biological bone; Obtain the world coordinate matrix of each controller in the initial pose and the offset matrix with the corresponding biological bone; S5: Obtain the world coordinate matrix of each controller in each frame during the animation time period, calculate the world coordinate matrix of each biological bone in each frame and save it; S6: Calculate the length of the lower limbs of the character, obtain the proportional relationship between the lower limb length and the unit length, scale the displacement part in the world coordinate matrix of each biological bone in each frame so that the limb length of the character is unified to the unit length; Record the encoding of the biological bone, the world coordinate matrix after proportional scaling of the displacement part and the number of frames, generate an animation data file based on the biological bone, and export it according to the right - hand coordinate system.

2. The method for generating general biological animation data according to claim 1, characterized in that, The content of step S1 is to define the matrix SWAP YZ for swapping the Y and Z axes and the matrix INVERT Z for flipping the Z axis. Let the position matrix of points in the left - hand coordinate system be PL and the position matrix of points in the right - hand coordinate system be PR. Then the transformation matrix formula for converting points from the right - hand coordinate system to the left - hand coordinate system is PL = (SWAP YZ) @ PR @ (INVERT Z), where @ represents matrix multiplication; the transformation matrix formula for converting points from the left - hand coordinate system to the right - hand coordinate system is PR = (INVERT Z) T @ PL @ (SWAP YZ) T , and the superscript T represents the transpose operation.

3. The generating method of a biological general animation data according to claim 1, characterized in that The content of step S2 is that, with the waist of the character as the reference, the chest, neck and head are extended from one side of the waist, and the hip is extended from the other side of the waist. The trunk part is composed of the head, neck, chest, waist and hip; The left upper limb and the right upper limb are correspondingly arranged on both sides of the chest. The left upper limb includes biological bones corresponding to the left shoulder, left upper arm, left forearm, left palm and left fingers arranged in sequence, and the right upper limb includes biological bones corresponding to the right shoulder, right upper arm, right forearm, right palm and right fingers arranged in sequence; The left lower limb and the right lower limb are correspondingly arranged on both sides of the hip. The left lower limb includes biological bones corresponding to the left thigh, left calf, left foot sole and left toes arranged in sequence, and the right lower limb includes biological bones corresponding to the right thigh, right calf, right foot sole and right toes arranged in sequence; Encode and distinguish the biological bones in different parts of the trunk part, left upper limb, right upper limb, left lower limb and right lower limb; The biological bone of the waist, as the root bone of the trunk part, is the parent bone of the biological bones of the chest and the hip; The biological bone of the hip is the parent bone of the left lower limb and the right lower limb; The biological bone of the chest is the parent bone of the biological bones of the neck, left upper limb and right upper limb; The biological bone of the neck is the parent bone of the biological bone of the head.

4. The method for generating general biological animation data according to claim 3, wherein, The encoding structure of each biological bone is (a, b), where a is the part encoding information and b is the quantity encoding information; The biological bones of the non - finger parts of the same limb connected to the chest, or the non - toe parts of the same limb connected to the hip, have the same part encoding information; The biological bones in different parts of the common part of the trunk have different corresponding part encoding information.

5. A method for generating general biological animation data according to claim 4, characterized in that, The content of step S3 is that the initial pose is defined as the character standing, the trunk part is upright, the distance between the soles of the lower limbs is the same as the width of the shoulders of the upper limbs, and the upper limbs extend linearly to both sides of the body; If there is an adjacent lower biological bone of the current biological bone, the X-axis direction of the current biological bone points to the adjacent lower biological bone, and the normal bending side direction of the current biological bone relative to the adjacent upper biological bone is the positive Z-axis; if there is no adjacent lower biological bone of the current biological bone, the direction from the current biological bone to the adjacent upper biological bone is the -X axis, and the normal bending side direction of the current biological bone relative to the adjacent upper biological bone is the positive Z-axis; the vector V is obtained according to the orientation of the X-axis x , and the vector V is obtained according to the orientation of the Z-axis z . The vector V x is cross-multiplied with the vector V z to obtain the vector V y . The direction of the vector V y is the orientation of the Y-axis; then the vector V of the Y-axis y and the vector V of the X-axis x are cross-multiplied to obtain the corrected Z-axis vector V′ z . The rotation matrix synthesized by the vectors V x , V y , and V′ z is used as the rotation matrix of the current biological bone; Taking the coordinates of the current biological bones in the right - hand coordinate system as position information, synthesize the position information and rotation matrix of each biological bone of the character to obtain the world coordinate matrix of the initial pose of all biological bones of the character; If the target software uses the left - hand coordinate system, convert the world coordinate matrix of the initial pose of all biological bones in the right - hand coordinate system into the world coordinate matrix of the initial pose of all biological bones in the left - hand coordinate system through the conversion matrix formula in step S1.

6. The method for generating general biological animation data according to claim 4, characterized in that, The content of step S4 is to obtain the world coordinate matrix M of the controller in the initial posture c , obtain and record the offset matrix OFF between the world coordinate matrix of each biological bone and the corresponding controller j , OFF j = M j * M c.inverse , where Mj is the world coordinate matrix of the biological bone in the initial posture, and M c.inverse is the inverse matrix of the world coordinate matrix M of the biological bone and the corresponding controller c .

7. A method for generating general biological animation data according to claim 6, characterized in that The content of step S5 is to obtain the world coordinate matrix M of each controller in each frame during the animation time period cf , according to the formula M jf = OFF j *M cf , calculate the world coordinate matrix M of the biological skeleton corresponding to the controller in each frame jf , record and save the encoding of each biological skeleton, the world coordinate matrix M of the biological skeleton jf and the frame number in each frame during the animation time period 8. A method for generating general biological animation data according to claim 7, characterized in that, The content of step S6 is to define a matrix scaling function SetMatrixTsScale, and use the matrix scaling function SetMatrixTsScale to scale the displacement part in the biological skeleton world coordinate matrix M obtained in step S5, and uniformly scale the lengths of the biological skeletons of the lower limbs of the current character to the unit length and save them; based on the encoded biological skeleton, the biological skeleton world coordinate matrix M after the displacement part is scaled proportionally jf and the number of frames, generate an animation data file of the biological skeleton. j ​ 9. A method for generating general biological animation data according to claim 8, characterized in that When an animation data file of a character needs to be used, through the mapping tool, obtain the encodings of the character's controller and the biological skeleton, and according to the initial posture in step S3, obtain the offset matrix OFF between each biological skeleton and the corresponding controller j , generate each biological skeleton in the initial posture; then for the current biological skeleton with a parent skeleton, calculate the local matrix M jl , M jl = M j * M p.inverse , where M p.inverse is the inverse matrix of the world coordinate matrix of the parent skeleton of the current biological skeleton. For the current biological skeleton without a parent skeleton, the local matrix is not calculated; Obtain the lower limb length L' of the character through the controller data, which satisfies the following formula M' j = SetMartixTsScale(M j , L), and restore the displacement part in the world coordinate matrix M' j of all the biological skeletons in the animation data according to the ratio of L; After assigning the animation data with limb length scaling to the biological skeleton, for non-lower limb biological skeletons, they are assigned hierarchically from top to bottom according to the relationship between the root skeleton and the parent skeleton of the biological skeleton: First, according to the obtained local matrix M of the current biological skeleton jl and the world matrix M of the parent skeleton of the current biological skeleton p , the world coordinate matrix M of the current biological skeleton under the animation drive of the parent skeleton is obtained jw = M jl * M p . Then, take the displacement part of the world coordinate matrix M of the current biological skeleton under the animation drive of the parent skeleton jw and the rotation part of the world coordinate matrix M' of all biological skeletons in the animation data j to synthesize a new matrix, which is the world coordinate matrix M of the current non-lower limb skeleton corresponding to each frame jf ; For the lower - limb biological bones, use inverse kinematics to calculate and obtain the world coordinate matrix of the lower - limb biological bones; After obtaining the world coordinate matrix of all biological skeletons for each frame, multiply the world coordinate matrix M of each biological skeleton jf by the inverse matrix of the offset matrix OFF j . The synthesized matrix is the world coordinate matrix M of the controller corresponding to each frame cf .

10. A method for generating biological general animation data according to claim 9, characterized in that, Use inverse kinematics to calculate and obtain the world coordinate matrix of the lower - limb biological bones. Specifically, the world coordinate matrix of the biological bones in the lower - limb parts other than the waist is calculated using the following formula: MtList = GetIKBoneMatrix(TsList, TmtList), where TsList is the displacement sequence of the current lower limb in the animation data, TmtList is the matrix of the lower - limb bones in the initial pose, MtList is the world coordinate matrix of the biological bones of the lower limb, and GetIKBoneMatrix is a function to extract the world coordinate matrix of the biological bones.