A method for generating skeleton system model animation based on Unity3D engine
By using GAN and LSTM to generate interpolation models in Unity3D and combining with the physics engine for real-time simulation, the problem of unnatural transition of shoulder joint motion is solved, and a more natural and coordinated animation effect is achieved.
Patent Information
- Application Number
- CN202411135688.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-08-19
AI Technical Summary
The existing skeletal system model animation generation method relies on manual drawing keyframe animation and simple interpolation algorithm, resulting in unnatural transitions in shoulder joint movement.
Through data preparation and preprocessing, additional data is generated using GAN, motion capture data is cleaned and filtered, interpolation training is used to use LSTM, interpolation model is generated, and the model is integrated in Unity3D, combined with the physics engine for real-time physical simulation and stress analysis, and optimize IK solution.
The natural transition of shoulder joint movement is achieved, the animation is more realistic and smooth, and the movements of each part are more coordinated and natural, in line with physical laws.
Smart Images

Figure CN119131210B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of skeleton model animation, and in particular to a method for generating skeleton system model animation based on Unity3D engine. Background Art
[0002] Skeleton animation, also known as skeletal animation, is a computer animation technology that divides a three-dimensional model into two parts: the skin used to draw the model, and the skeleton used to control the movement. Unlike traditional stop-motion animation, skeletal animation uses a well-established skeleton to apply one or more pictures to make them move, which saves a lot of time and energy compared to drawing the movements one by one, and can produce more vivid movements.
[0003] For example, the patent publication number CN109147052B discloses a hair simulation production method based on the Unity3D engine, including creating a hairstyle, creating a mesh and a skeleton, the skeleton is created by setting the skeleton control node in the hair to determine the skeleton control position, and using Lagrangian difference to calculate the difference of hair movement; initializing the mesh vertices, texture coordinate mapping, color, skeleton, and triangle information constructed by the mesh vertices, combining the triangles into a patch, assigning texture coordinate mapping information to the patch, and creating a mesh rendering; the hairstyle is processed by controlling the configuration parameters, and a single cluster of hair is merged into a complete hair through a skinned mesh renderer, and the hairstyle is updated according to the refresh of the configuration parameters; the configuration parameter information of the hairstyle is stored to save the hairstyle. The invention also provides a hair simulation production system based on the Unity3D engine, which realizes the customized creation and modification of human hair, which is flexible and highly portable.
[0004] Although the above scheme has the above advantages, the current skeletal system model animation generation method usually relies on manually drawn keyframe animation, and generates skeletal system model animation with relatively simple interpolation algorithm and inverse kinematics IK solution method, which can easily lead to unnatural shoulder joint movement transition, including: hand-raising action: from the natural drooping position to the fully raised position, the rotation and movement of the shoulder joint are not smooth, and the transition appears stiff; waving action: such as waving or swinging arms, the coordination between the shoulder joint and the upper arm is poor, resulting in incoherent movement trajectory; other complex movement combinations: such as continuous combinations of arm raising, rotation, stretching and other actions, the transition of the shoulder joint appears stiff and lacks natural coordination; therefore, there is an urgent need for a method for generating skeletal system model animation based on the Unity3D engine to solve such problems. Summary of the invention
[0005] In view of the shortcomings of the prior art, the present invention provides a method for generating skeletal system model animation based on the Unity3D engine, which solves the problem that the traditional skeletal system model animation generation method in the prior art usually relies on manually drawn key frame animation, relatively simple interpolation algorithm and inverse kinematics IK solution method to generate skeletal system model animation, which easily leads to unnatural shoulder joint movement transition.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions:
[0007] The present invention provides a method for generating a skeletal system model animation based on a Unity3D engine, comprising:
[0008] Step 1. Data preparation and preprocessing: clean, filter and enhance existing motion capture data, use GAN to generate additional data and enrich the training dataset;
[0009] Step 2. Model training and integration: Use LSTM to perform interpolation training on the enhanced data, generate an interpolation model, and integrate it into Unity3D; In step 2, a long short-term memory network LSTM is used to perform interpolation training on the preprocessed motion data to generate a model;
[0010] Step 3. Animation blending and IK settings: Set up AnimatorController in Unity3D, use interpolation models for dynamic weight adjustment and multi-level animation control; combine physics engines for real-time physics simulation and stress analysis, and optimize IK solutions;
[0011] Step 4. Make real-time adjustments using Unity3D’s adjustment tools and gesture-based control system for animation preview and editing.
[0012] The present invention is further configured to optimize the motion capture data in step 1, use advanced signal processing technology (low-pass filter denoising, time warping and interpolation frame filling, training generative adversarial network (GAN)) to clean and filter the existing motion capture data to remove noise and abnormal data;
[0013] Use time warping and interpolation to generate diverse shoulder joint motion data;
[0014] Train the Generative Adversarial Network (GAN) to generate a rich dataset of high-quality shoulder joint motion data;
[0015] The present invention is further configured that the data preparation and preprocessing steps include:
[0016] Assume that the data is in the form of a time series and each frame contains the position information (x, y, z) and rotation information (α, β, γ) of the shoulder joint;
[0017] Use a low-pass filter to remove high-frequency noise: y(t) = αx(t) + (1-α)y(t-1), where y(t) is the filtered data, x(t) is the original data, and α is the filter coefficient (0 < α < 1);
[0018] Use ZScore statistics to detect and remove abnormal data: Where z is ZScore, x is the data point, μ is the data mean, σ is the standard deviation, and when |z|>3, the data point is considered as abnormal data;
[0019] Then the time series data is distorted to generate motion data of different speeds: x'(t) = x(γt), where x(t) is the original data, γ is the time distortion coefficient, γ>1 is considered as acceleration, and γ<1 is considered as deceleration;
[0020] Use interpolation methods to add extra frames to time series data. Where xi is the interpolated data point, x 0 and x 1 Represents two adjacent original data points, n is the number of interpolation points, and i is the index of the interpolation point;
[0021] Generate high-quality shoulder joint motion data using generative adversarial networks (GANs);
[0022] The present invention is further configured as follows: GAN model construction steps:
[0023] Generator model: G(z) = σ(W g z+b g ), where G(z) represents the generator output, z is a random noise vector, and W g and b g is the weight and bias of the generator, σ is the Sigmoid activation function;
[0024] Discriminator model: D(x) = σ(W d x+b d ), where D(x) is the discriminator output, x is the input data, and W d and b d is the weight and bias of the discriminator, σ is the Sigmoid activation function;
[0025] The generator and discriminator are trained using the alternating optimization method, and the generator loss function is:
[0026] Discriminator loss function:
[0027] Alternating optimization steps:
[0028] Update the discriminator parameters (W d ,b d ):
[0029] Update the generator parameters (W g ,b g ): Where η is the learning rate, G(z) is the sample generated by the generator, D(G(z)) represents the output probability of the discriminator for the generated sample, E represents the expected value, and z represents the random noise distribution p z (z) is a noise vector sampled from the real data distribution p. data The real samples collected in (x) are Denotes the discriminator LD to its parameters (W d ,b d ), Denotes the generator loss function L G For its parameters (W g ,b g ) gradient; optimizing and enhancing the motion capture data through step 1;
[0030] The present invention is further configured that step 3 dynamically adjusts the AnimationCurve parameters in Unity3D using the trained deep learning model, so that the interpolation curve of the shoulder joint movement is smoother and more natural;
[0031] The animation mixing and hierarchical control methods are:
[0032] In Unity3D's AnimatorController, use the interpolation generation model to adjust the weight of the animation mixer, perform dynamic weight adjustment, and automatically optimize the animation transition according to the current state of the shoulder joint;
[0033] At the same time, the movement of the shoulder joint, upper arm and arm is controlled at different levels, and multi-level motion control is performed, so that the movement of each part is more coordinated and natural;
[0034] The present invention is further configured to dynamically adjust the AnimationCurve parameters in Unity3D using the trained deep learning model LSTM interpolation model in the animation mixing and IK setting stage, and perform animation mixing and multi-level control in AnimatorController:
[0035] 1) Dynamically adjust AnimationCurve parameters:
[0036] Use TensorFlowSharp and ONNX Runtime plugins to load the LSTM model into Unity3D;
[0037] Use the LSTM model to predict the motion data of the shoulder joint in real time and generate a smooth interpolation curve;
[0038] 2) Create and update the AnimationCurve object in Unity3D so that its parameters are dynamically adjusted according to the output of the LSTM model;
[0039] Assume that the shoulder joint position and rotation of the current animation frame are (x t ,y t ,z t ,α t ,β t ,γ t );
[0040] LSTM model prediction: in Represents the position and rotation of the shoulder joint in the next frame predicted by the LSTM model;
[0041] 3) Update the key frame of AnimationCurve according to the prediction results;
[0042] The present invention is further configured such that the animation mixing and IK setting stage also includes animation mixing and multi-level control, specifically:
[0043] Create an AnimatorController in Unity3D and add a multi-level animation state machine;
[0044] Use the interpolation generation model to dynamically adjust the weight of the animation mixer Blend Tree in the AnimatorController;
[0045] Through animation blending and IK settings, the trained deep learning model is used in Unity3D to solve the problem of unnatural shoulder joint movement transition;
[0046] The present invention is further configured to combine the dynamics simulation with the physical engine in the animation mixing and IK setting steps, specifically:
[0047] Combined with the physics engine of Unity3D, a real-time physical simulation model of the shoulder joint is established. The real-time physical simulation model uses the data in the previous step 2 and the results of the interpolation algorithm to make the movement of the shoulder joint conform to the laws of physics.
[0048] Perform dynamic stress and strain analysis in real-time physical simulation, dynamically adjust motion parameters according to the stress of the shoulder joint in different motion states, and thus generate more realistic animation transitions;
[0049] The present invention is further configured to use the built-in IK system of Unity3D in step 3, combined with the deep learning interpolation model and the physical simulation result;
[0050] An adaptive IK solving algorithm is used here to dynamically adjust the IK solving parameters according to the current state of the shoulder joint to further optimize the smoothness and naturalness of the motion transition;
[0051] The present invention is further configured to perform real-time animation preview and editing in Unity3D during the real-time adjustment step, so that the user can dynamically adjust the motion trajectory of the shoulder joint during runtime, and preview and optimize the animation effect in real time;
[0052] The deep learning model and physical simulation results generated in the previous steps are utilized here.
[0053] Compared with the prior art, the present invention has the following beneficial effects:
[0054] The present invention uses advanced signal processing technology and generative adversarial networks (GANs) to effectively clean and filter noise and abnormal data in the data, generate diversified motion data, enrich the training data set, and make the animation more realistic and smooth. At the same time, the long short-term memory network (LSTM) is used for interpolation training to generate an interpolation model. LSTM can better capture complex patterns and subtle changes in time series, generate more natural motion transitions, and have stronger dynamic adaptability.
[0055] The present invention optimizes the problem of inflexible static animation mixing and weight adjustment, uses the trained LSTM model to dynamically adjust the AnimationCurve parameters in Unity3D, makes the interpolation curve of shoulder joint movement smoother and more natural, and makes the movement of each part more coordinated and natural through dynamic weight adjustment and multi-level animation control; combines the physical engine to perform real-time physical simulation and stress analysis, makes the skeletal movement conform to the laws of physics, and generates more realistic animation transitions;
[0056] The invention solves the problem that the traditional skeletal system model animation generation method in the prior art usually relies on manually drawn key frame animation, relatively simple interpolation algorithm and inverse kinematics IK solution method to generate skeletal system model animation, which easily leads to unnatural shoulder joint movement transition. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 The present invention is a flow chart of a method for generating a skeletal system model animation based on the Unity3D engine. DETAILED DESCRIPTION
[0058] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0059] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0060] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0061] Example 1
[0062] See also Figure 1 The present invention provides a method for generating a skeleton system model animation based on a Unity3D engine, comprising:
[0063] Step 1. Data preparation and preprocessing: clean, filter and enhance existing motion capture data, use GAN to generate additional data and enrich the training dataset;
[0064] Optimize motion capture data, use advanced signal processing techniques (low-pass filter denoising, time warping and interpolation, training generative adversarial networks (GANs)) to clean and filter existing motion capture data to remove noise and abnormal data;
[0065] Use time warping and interpolation to generate diverse shoulder joint motion data;
[0066] Train the Generative Adversarial Network (GAN) to generate a rich dataset of high-quality shoulder joint motion data;
[0067] Data preparation and preprocessing steps include:
[0068] Assume that the data is in the form of a time series and each frame contains the position information (x, y, z) and rotation information (α, β, γ) of the shoulder joint;
[0069] Use a low-pass filter to remove high-frequency noise: y(t) = αx(t) + (1-α)y(t-1), where y(t) is the filtered data, x(t) is the original data, and α is the filter coefficient (0 < α < 1);
[0070] Use ZScore statistics to detect and remove abnormal data: Where z is ZScore, x is the data point, μ is the data mean, σ is the standard deviation, and when |z|>3, the data point is considered as abnormal data;
[0071] Then the time series data is distorted to generate motion data of different speeds: x'(t) = x(γt), where x(t) is the original data, γ is the time distortion coefficient, γ>1 is considered as acceleration, and γ<1 is considered as deceleration;
[0072] Use interpolation methods to add extra frames to time series data. where x i is the interpolated data point, x 0 and x 1 Represents two adjacent original data points, n is the number of interpolation points, and i is the index of the interpolation point;
[0073] Generate high-quality shoulder joint motion data using generative adversarial networks (GANs);
[0074] GAN model construction steps:
[0075] Generator model: G(z) = σ(W g z+b g ), where G(z) represents the generator output, z is a random noise vector, and W g and b g is the weight and bias of the generator, σ is the Sigmoid activation function;
[0076] Discriminator model: D(x) = σ(W d x+b d ), where D(x) is the discriminator output, x is the input data, and W d and b d is the weight and bias of the discriminator, σ is the Sigmoid activation function;
[0077] The alternating optimization method is used to train the generator and discriminator, and the generator loss function is:
[0078] Discriminator loss function:
[0079] Alternating optimization steps:
[0080] Update the discriminator parameters (W d ,b d ):
[0081] Update the generator parameters (W g ,b g ): Where η is the learning rate, G(z) is the sample generated by the generator, D(G(z)) represents the output probability of the discriminator for the generated sample, E represents the expected value, and z represents the random noise distribution p z (z) is a noise vector sampled from the real data distribution p. data The real samples collected in (x) are Represents the discriminator L D For its parameters (W d ,b d ), Denotes the generator loss function L G For its parameters (W g ,b g ) gradient; optimizing and enhancing the motion capture data through step 1;
[0082] Step 2. Model training and integration: Use LSTM to perform interpolation training on the enhanced data, generate an interpolation model, and integrate it into Unity3D; In step 2, a long short-term memory network LSTM is used to perform interpolation training on the preprocessed motion data to generate a model;
[0083] Step 3. Animation blending and IK settings: Set up AnimatorController in Unity3D, use the interpolation model to perform dynamic weight adjustment and multi-level animation control; combine the physics engine to perform real-time physics simulation and stress analysis to optimize IK solution; use the trained deep learning model to dynamically adjust the AnimationCurve parameters in Unity3D to make the interpolation curve of shoulder joint movement smoother and more natural;
[0084] The animation mixing and hierarchical control methods are:
[0085] In Unity3D's AnimatorController, use the interpolation generation model to adjust the weight of the animation mixer, perform dynamic weight adjustment, and automatically optimize the animation transition according to the current state of the shoulder joint;
[0086] At the same time, the movement of the shoulder joint, upper arm and arm is controlled at different levels, and multi-level motion control is performed, so that the movement of each part is more coordinated and natural;
[0087] In the animation blending and IK setting stage, the trained deep learning model LSTM interpolation model is used to dynamically adjust the AnimationCurve parameters in Unity3D, and animation blending and multi-level control are performed in AnimatorController:
[0088] 1) Dynamically adjust AnimationCurve parameters:
[0089] Use TensorFlowSharp and ONNX Runtime plugins to load the LSTM model into Unity3D;
[0090] Use the LSTM model to predict the motion data of the shoulder joint in real time and generate a smooth interpolation curve;
[0091] 2) Create and update the AnimationCurve object in Unity3D so that its parameters are dynamically adjusted according to the output of the LSTM model;
[0092] Assume that the shoulder joint position and rotation of the current animation frame are (x t ,y t ,z t ,α t ,β t ,γ t );
[0093] LSTM model prediction: in Represents the position and rotation of the shoulder joint in the next frame predicted by the LSTM model;
[0094] 3) Update the key frame of AnimationCurve according to the prediction results (pseudo code):
[0095] AnimationCurve curveX=new AnimationCurve();
[0096] AnimationCurve curveY=new AnimationCurve();
[0097] AnimationCurve curveZ=new AnimationCurve();
[0098] AnimationCurve curveAlpha=new AnimationCurve();
[0099] AnimationCurve curveBeta=new AnimationCurve();
[0100] AnimationCurve curveGamma=new AnimationCurve();
[0101] / / Assume that some keyframes have been added before
[0102] curveX.AddKey(new Keyframe(t,x_t));
[0103] curveX.AddKey(new Keyframe(t+1,\hat{x}_{t+1}));
[0104] / / Similar processing for Y, Z, Alpha, Beta, Gamma
[0105] animationClip.SetCurve("",typeof(Transform),"localPosition.x",curveX);
[0106] animationClip.SetCurve("",typeof(Transform),"localPosition.y",curveY);
[0107] animationClip.SetCurve("",typeof(Transform),"localPosition.z",curveZ);
[0108] animationClip.SetCurve("",typeof(Transform),"localRotation.eulerAngles.x",curveAlpha);
[0109] animationClip.SetCurve("",typeof(Transform),"localRotation.eulerAngles.y",curveBeta);
[0110] animationClip.SetCurve("",typeof(Transform),"localRotation.eulerAngles.z",curveGamma);
[0111] The animation blending and IK setup stage also includes animation blending and multi-level control, specifically:
[0112] Create an AnimatorController in Unity3D and add a multi-level animation state machine;
[0113] Use the interpolation generation model to dynamically adjust the weight of the animation mixer Blend Tree in the AnimatorController;
[0114] Through animation blending and IK settings, the trained deep learning model is used in Unity3D to solve the problem of unnatural shoulder joint movement transition;
[0115] The animation blending and IK setting steps combine the dynamics simulation with the physics engine. Specifically:
[0116] Combined with the physics engine of Unity3D, a real-time physical simulation model of the shoulder joint is established. The real-time physical simulation model uses the data in the previous step 2 and the results of the interpolation algorithm to make the movement of the shoulder joint conform to the laws of physics.
[0117] Perform dynamic stress and strain analysis in real-time physical simulation, dynamically adjust motion parameters according to the stress of the shoulder joint in different motion states, and thus generate more realistic animation transitions;
[0118] In step 3, the built-in IK system of Unity3D is used, combined with the deep learning interpolation model and physical simulation results; an adaptive IK solution algorithm is used here to dynamically adjust the IK solution parameters according to the current state of the shoulder joint to further optimize the smoothness and naturalness of the motion transition;
[0119] Step 4. Real-time adjustment, using Unity3D’s adjustment tools and gesture-based control system for animation preview and editing;
[0120] In the real-time adjustment step, real-time animation preview and editing are performed in Unity3D. Users can dynamically adjust the movement trajectory of the shoulder joint during runtime, and preview and optimize the animation effect in real time.
[0121] The deep learning model and physical simulation results generated in the previous steps are utilized here.
[0122] The method for generating a skeletal system model animation based on the Unity3D engine provided by the present invention aims to solve the problem of unnatural transition of shoulder joint movement;
[0123] In terms of data preparation and preprocessing, we use generative adversarial networks (GANs) to generate additional data to enrich the training dataset, and use low-pass filters to denoise, clean and filter existing data, and remove noise and abnormal data. We also use the ZScore statistical method to detect and remove abnormal data, and generate diversified shoulder joint motion data through time warping and interpolation frame filling techniques. Time warping operations generate motion data at different speeds, and interpolation frames add additional frames to time series data. Finally, we train generative adversarial networks (GANs) to generate high-quality shoulder joint motion data and enrich the enhanced dataset.
[0124] The model uses the long short-term memory network LSTM to perform interpolation training on the enhanced data, generate an interpolation model, and integrate it into Unity3D; the preprocessed motion data will be used to train the LSTM model, which can effectively predict the natural motion trajectory of the shoulder joint and generate a more natural animation transition effect; after training, the model is saved and loaded into Unity3D;
[0125] In the animation mixing and IK setting stage, AnimatorController is set up in Unity3D, and the interpolation model is used to perform dynamic weight adjustment and multi-level animation control. The physical engine is combined to perform real-time physical simulation and stress analysis to optimize the inverse kinematics IK solution. In this stage, the trained deep learning model is used to dynamically adjust the AnimationCurve parameters in Unity3D to make the interpolation curve of the shoulder joint movement smoother and more natural. Specifically, the shoulder joint position and rotation of the current animation frame are predicted in real time through the LSTM model to generate a smooth interpolation curve, and the key frames of AnimationCurve are updated according to the prediction results. In addition, animation mixing and hierarchical control are performed in AnimatorController, and the interpolation generation model adjusts the weight of the animation mixer, performs dynamic weight adjustment, and automatically optimizes the animation transition according to the current state of the shoulder joint. The movement of the shoulder joint, upper arm and arm is controlled at different levels to achieve multi-level motion control, making the movement of each part more coordinated and natural.
[0126] The dynamic simulation is combined with the physical engine to establish a real-time physical simulation model of the shoulder joint. The data from the previous step and the results of the interpolation algorithm are used to make the shoulder joint movement conform to the laws of physics. Dynamic stress and strain analysis is performed in the real-time physical simulation, and the motion parameters are dynamically adjusted according to the stress conditions of the shoulder joint under different motion states to generate more realistic animation transitions.
[0127] The above contents are only for explaining the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A method for generating a skeletal system model animation based on the Unity3D engine, characterized in that: include: Step 1. Data preparation and preprocessing: clean, filter and enhance existing motion capture data, use GAN to generate additional data and enrich the training dataset; Step 2. Model training and integration: Use the long short-term memory network LSTM to perform interpolation training on the enhanced data, generate an interpolation model, and integrate it into Unity3D; In step 2, the long short-term memory network LSTM is used to perform interpolation training on the preprocessed motion data to generate a model; Step 3. Animation blending and IK settings: Set up AnimatorController in Unity3D, use interpolation models for dynamic weight adjustment and multi-level animation control; combine physics engines for real-time physics simulation and stress analysis, and optimize IK solutions; Step 4. Make real-time adjustments using Unity3D’s adjustment tools and gesture-based control system for animation preview and editing.
2. The method for generating a skeletal system model animation based on the Unity3D engine according to claim 1, characterized in that: In step 1, the motion capture data is optimized by using advanced signal processing techniques, including low-pass filter denoising, time warping and interpolation frame filling, and training of generative adversarial networks (GANs), to clean and filter the existing motion capture data and remove noise and abnormal data; Use time warping and interpolation to generate diverse shoulder joint motion data; Train the Generative Adversarial Network (GAN) to generate a rich dataset of high-quality shoulder joint motion data.
3. The method for generating skeleton system model animation based on Unity3D engine according to claim 2, characterized in that: Data preparation and preprocessing steps include: Assume that the data is in the form of a time series and each frame contains the position information (x, y, z) and rotation information (α, β, γ) of the shoulder joint; Use a low-pass filter to remove high-frequency noise: y(t) = αx(t) + (1-α)y(t-1), where y(t) is the filtered data, x(t) is the original data, and α is the filter coefficient, satisfying 0<α<1; Use ZScore statistics to detect and remove abnormal data: Where z is ZScore, x is the data point, μ is the data mean, σ is the standard deviation, and when |z|>3, the data point is considered as abnormal data; Then the time series data is distorted to generate motion data of different speeds: x′(t)=x(γt), where x(t) is the original data, γ is the time distortion coefficient, γ>1 is considered as acceleration, and γ<1 is considered as deceleration; Use interpolation methods to add extra frames to time series data. where x i is the interpolated data point, x0 and x1 represent two adjacent original data points, n is the number of interpolation points, and i is the index of the interpolation point; Generate high-quality shoulder joint motion data using generative adversarial network (GAN).
4. The method for generating a skeletal system model animation based on the Unity3D engine according to claim 3, characterized in that: GAN model construction steps: Generator model: G(z) = σ(W g z+b g ), where G(z) represents the generator output, z is a random noise vector, and W g and b g is the weight and bias of the generator, σ is the Sigmoid activation function; Discriminator model: D(x) = σ(W d x+b d ), where D(x) is the discriminator output, x is the input data, and W d and b d is the weight and bias of the discriminator, σ is the Sigmoid activation function; The alternating optimization method is used to train the generator and discriminator, and the generator loss function is: Discriminator loss function: Alternating optimization steps: Update the discriminator parameters (W d ,b d ): Update the generator parameters (W g ,b g ): Where η is the learning rate, G(z) is the sample generated by the generator, D(G(z)) represents the output probability of the discriminator for the generated sample, E represents the expected value, and z represents the random noise distribution p z (z) is a noise vector sampled from the real data distribution p. data The real samples collected in (x) are Represents the discriminator L D For its parameters (W d ,b d ), Denotes the generator loss function L G For its parameters (W g ,b g )’s gradient.
5. The method for generating skeleton system model animation based on Unity3D engine according to claim 4, characterized in that: Step 3: Use the trained deep learning model to dynamically adjust the AnimationCurve parameters in Unity3D; The animation mixing and hierarchical control methods are: In Unity3D's AnimatorController, use the interpolation generation model to adjust the weight of the animation mixer, perform dynamic weight adjustment, and automatically optimize the animation transition according to the current state of the shoulder joint; At the same time, the movement of the shoulder joint, upper arm and arm are controlled at different levels to perform multi-level motion control.
6. The method for generating skeleton system model animation based on Unity3D engine according to claim 5, characterized in that: In the animation blending and IK setting stage, the trained deep learning model LSTM interpolation model is used to dynamically adjust the AnimationCurve parameters in Unity3D, and animation blending and multi-level control are performed in AnimatorController: 1) Dynamically adjust AnimationCurve parameters: Use TensorFlowSharp and ONNX Runtime plugins to load the LSTM model into Unity3D; Use the long short-term memory network (LSTM) model to predict the motion data of the shoulder joint in real time and generate a smooth interpolation curve. 2) Create and update the AnimationCurve object in Unity3D so that its parameters are dynamically adjusted according to the output of the LSTM model; Assume that the shoulder joint position and rotation of the current animation frame are (x t ,y t ,z t ,α t ,β t ,γ t ); LSTM model prediction: in Represents the position and rotation of the shoulder joint in the next frame predicted by the LSTM model; 3) Update the keyframe of AnimationCurve according to the prediction results.
7. The method for generating skeleton system model animation based on Unity3D engine according to claim 6, characterized in that: The animation blending and IK setup stage also includes animation blending and multi-level control, specifically: Create an AnimatorController in Unity3D and add a multi-level animation state machine; Use the interpolation generation model to dynamically adjust the weights of the animation mixer Blend Tree in the AnimatorController.
8. The method for generating skeleton system model animation based on Unity3D engine according to claim 7, characterized in that: The animation blending and IK setting steps combine the dynamics simulation with the physics engine. Specifically: Combined with the physics engine of Unity3D, a real-time physical simulation model of the shoulder joint is established. The real-time physical simulation model uses the data in the previous step 2 and the results of the interpolation algorithm; Dynamic stress and strain analysis is performed in real-time physical simulation, and motion parameters are dynamically adjusted according to the stress conditions of the shoulder joint under different motion states.
9. The method for generating skeleton system model animation based on Unity3D engine according to claim 8, characterized in that: In step 3, Unity3D's built-in IK system is used, combined with the deep learning interpolation model and physical simulation results; An adaptive IK solving algorithm is used here to dynamically adjust the IK solving parameters according to the current state of the shoulder joint.
10. The method for generating skeleton system model animation based on Unity3D engine according to claim 9, characterized in that: In the real-time adjustment step, real-time animation preview and editing are performed in Unity3D. The user dynamically adjusts the motion trajectory of the shoulder joint during runtime, and previews and optimizes the animation effect in real time. The deep learning model and physical simulation results generated in the previous steps are used here.
Citation Information
Patent Citations
A method and system for hair simulation based on the Unity3D engine
CN109147052B
Three-dimensional skeleton and LSTM-based worker action recognition method and device
CN111553229A
Human skeleton data generation method based on GAN network
CN114596635A