Dress animation generation optimization algorithm based on dynamic skeleton

By using dynamic skeletal technology to bind the movement bones of the tube skirt in the animation, and combine the collision detection algorithm, the dynamic performance of the traditional animation mid -tube skirt is unreal and the mold wearing modgery, and the natural and smooth animation generation and real action performance is achieved.

CN119379868APending Publication Date: 2025-01-28SUZHOU MUJINZHI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411462893.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-19
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

In traditional animation, the dynamic performance of the tube skirt is unreal, the simulation is lagging or too stiff, and it is difficult to judge the direction, resulting in mold penetration problems.

Method used

By generating an optimization algorithm based on dynamic bone skirt animation, the sports bones of the waist, hip and hem are bound to calculate the position of the sports bone in real time and integrate the tube skirt model at different time points, generate natural and smooth tube skirt animation, and judge the collision detection algorithm judgment And processing the mold.

Benefits of technology

Realize the generation of natural and smooth tube skirts, improve the authenticity and coherence of animation, reduce the problem of molding, and reduce the needs of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379868A_ABST
    Figure CN119379868A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic skeleton-based barrel skirt animation generation optimization algorithm, and relates to the technical field of animation generation. According to the dynamic skeleton-based skirt animation generation optimization algorithm, an initial skirt model is determined, and motion skeletons are bound to the waist, the hip and the lower hem of the initial skirt model; acquiring human body motion data, and determining position data of the motion skeleton based on the human body motion data; on the basis of the position data of the movement skeleton, acquiring a movement-time barrel skirt model, and marking time points of each movement-time barrel skirt model; according to the time sequence, the initial barrel skirt model and the movement barrel skirt models at all the time points are integrated, the barrel skirt animation is obtained, the problems that in traditional animation, the dynamic performance of a barrel skirt is not real, simulation lags behind or is too stiff are solved, and particularly, the authenticity and continuity of the animation are improved in a complex movement scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of animation generation, and in particular to a tube skirt animation generation optimization algorithm based on dynamic skeletons. Background Art

[0002] In the field of real-time rendering, realistically simulating the movement of character clothes has always been a difficult problem in the industry. Especially for tube skirts with loose hems, traditional cloth animation based on physical simulation requires a lot of computing resources and has too much performance overhead. At the same time, completely hand-made tube skirt animation is not only time-consuming and labor-intensive, but also difficult to simulate the softness and natural drooping effect of the tube skirt, and cannot completely avoid the problem of model penetration (interlacing with the human body model during the operation of the tube skirt animation). In order to solve these problems, cloth animation generation technology based on dynamic bones has been widely used. By binding clothing to a simple bone system, the amount of calculation can be greatly reduced, and the dynamic effect of clothing can also be better simulated.

[0003] However, it is difficult for existing technologies to generate natural and smooth tube skirt animations by calculating the positions of moving bones in real time and integrating tube skirt models at different time points. In addition, existing optimization algorithms are difficult to judge the direction, resulting in unrealistic dynamic performance of tube skirts in traditional animations, lagging simulation or being too rigid, and the problem of model penetration (interpenetration of tube skirt animation with the human body model during operation) cannot be completely avoided. Summary of the invention

[0004] In view of the shortcomings of the prior art, the present invention provides an optimization algorithm for generating tube skirt animation based on dynamic bones, which solves the problems in traditional animations where the dynamic performance of tube skirts is unrealistic, the simulation lags or is too rigid to make directional judgments, and where model penetration (the penetration of the tube skirt with the human body model during the running of the animation) cannot be completely avoided.

[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions: a tube skirt animation generation optimization algorithm based on dynamic bones, comprising the following steps: determining the initial model of the tube skirt, and binding moving bones to the waist, hips and hem of the initial model of the tube skirt; obtaining human body motion data, and determining the position data of the moving bones based on the human body motion data; obtaining the tube skirt model in motion based on the position data of the moving bones, and marking the time points of the tube skirt model in motion; integrating the initial model of the tube skirt and the tube skirt model in motion at each time point in chronological order to obtain the tube skirt animation.

[0006] Furthermore, the method of determining the initial model of the tube skirt comprises the following steps: determining the skirt type; acquiring several pending tube skirt models corresponding to the skirt type and stored in a database based on the skirt type; acquiring basic data of the tube skirt, wherein the basic data of the tube skirt includes a waist circumference of the tube skirt, a length of the tube skirt and a material of the tube skirt; and determining the initial model of the tube skirt from several pending tube skirt models based on the basic data of the tube skirt.

[0007] Furthermore, the method of determining the initial model of the tube skirt from several pending tube skirt models based on the basic data of the tube skirt comprises the following steps: comparing the material of the tube skirt with the model material of each pending tube skirt model, and obtaining a plurality of preferred tube skirt models whose model material is the same as the material of the tube skirt; comparing the model waist circumference and model skirt length of the preferred tube skirt model with the waist circumference and skirt length of the tube skirt, and obtaining a comparison coefficient; and determining the preferred tube skirt model corresponding to the smallest comparison coefficient as the initial model of the tube skirt.

[0008] Furthermore, the calculation formula of the comparison coefficient is:

[0009] Dx=e |Mw-Qw|+|Mc-Qc| ;

[0010] Where Dx is the comparison coefficient, Mw is the model waist circumference, Mc is the model skirt length, Qw is the tube skirt waist circumference, Qc is the tube skirt length, and e is a natural constant.

[0011] Furthermore, the human body motion data includes joint motion data, gait motion data and posture data, wherein the joint motion data includes joint motion angle and joint motion speed, and the gait motion data includes step length and step frequency.

[0012] Furthermore, the method of determining the position data of the moving bones based on the human motion data includes the following steps: obtaining various human motion reference data stored in a database; comparing and analyzing the human motion data with various human motion reference data to obtain a comparison coefficient; and obtaining the position data of the moving bones stored in the database corresponding to the human motion reference data corresponding to the smallest comparison coefficient.

[0013] Furthermore, the human body motion reference data includes joint motion reference data, gait motion reference data and posture reference data, wherein the joint motion reference data includes a joint motion reference angle and a joint motion reference speed, and the gait motion reference data includes a reference step length and a reference step frequency.

[0014] Further, the obtaining of the comparison coefficient comprises the following steps: comparing and analyzing the joint motion data with the joint motion reference data to obtain the joint motion compliance coefficient; comparing and analyzing the gait motion data with the gait motion reference data to obtain the gait motion compliance coefficient; comparing and analyzing the posture data with the posture reference data to obtain the posture compliance coefficient; fusing the joint motion compliance coefficient, the gait motion compliance coefficient and the posture compliance coefficient to obtain the comparison coefficient; the calculation formula of the comparison coefficient is as follows:

[0015] BX = ln(Gyx+Byx+Zx+1);

[0016] Gyx=σ(A1, B1)+σ(A2, B2);

[0017] Byx=e |Mb-Qb|+|Mp-Qp| ;

[0018] Zx=σ(A3,B3);

[0019] Wherein, BX is the comparison coefficient, A1 is the joint motion angle, A2 is the joint motion speed, B1 is the joint motion reference angle, B2 is the joint motion reference speed, σ(A1, B1) is the similarity function between the joint motion angle and the joint motion speed, σ(A2, B2) is the similarity function between the joint motion reference angle and the joint motion reference speed, Mb is the step length, Mp is the step frequency, Qb is the reference step length, Qp is the reference step frequency, A3 is the posture data, B3 is the posture reference data, σ(A3, B3) is the similarity function between the posture data and the posture reference data, e is a natural constant, Gyx is the joint motion compliance coefficient, Byx is the gait motion compliance coefficient, and Zx is the posture compliance coefficient.

[0020] Furthermore, the method of obtaining the tube skirt model in motion based on the position data of the moving bones includes: performing similarity analysis on the position data of the moving bones and the reference motion data of each bone stored in a database to obtain the bone reference motion data that matches the position data of the moving bones; and obtaining the tube skirt model in motion corresponding to the bone reference motion data stored in the database.

[0021] Furthermore, after obtaining the tube skirt animation, it also includes detecting and processing the collision between the tube skirt and the human body parts to prevent interpenetration: traversing the horizontal constraint pairs composed of all horizontally adjacent bone joint nodes; calculating the weight values ​​of the two joint nodes of the horizontal constraint pair based on the horizontal constraint coefficient set by the user; calculating the direction vector and distance between the two points; calculating the difference with the constraint length, and calculating the horizontal displacement; updating the positions of the two points according to the horizontal displacement; the specific algorithm is as follows: calculating the unit direction vector and height of the capsule: V = BA, h = ||V||; V' = V / h; Calculate the projection of the bone node point P to the middle line segment AB of the capsule: t=(PA)·V', t'=max(0,min(t,h)); Calculate the distance from point P to the projection point Q: Q=A+t'*V', d=||PQ||; Determine the position relationship between point P and the upward plane of the capsule: d=R·P+D, PIsFront=d>0; If d>0, point P is in front of the plane; If d<0, point P is behind the plane; If d=0, point P is on the plane; Determine whether the direction of point P relative to the human body has changed: Changed=(PI =InFront); if Changed is equal to 0, the position of the tube skirt skeleton node relative to the capsule body has not changed; if Changed is equal to 1, the position of the tube skirt skeleton node relative to the capsule body has changed; determine whether the point is in the capsule body: if d≤r, the point is in the capsule body or on the surface of the capsule body; if d>r, the point is outside the capsule body; if the point is in the capsule body, calculate the position P' of point P according to whether the direction of P relative to the human body changes: if Changed is equal to 0, P'=Q+(PQ)*Di stanceFrac; if Changed is equal to 1, P'=Q-(PQ)*DistanceFrac; where Di stanceFrac is the distance coefficient between the vector of the skeleton node and the projection point, P: the position vector of the tube skirt skeleton node to be positioned; A: the position direction of the center point of the bottom of the capsule body; B: the position vector of the center point of the top of the capsule body; r: the radius of the capsule body; R: the right vector of the capsule body; InFront: the initial direction of the tube skirt skeleton node relative to the capsule body, InFront is 0 in front of the human body, I nFront is 1 at the back of the human body.

[0022] The present invention has the following beneficial effects:

[0023] (1) The dynamic skeleton-based skirt animation generation optimization algorithm calculates the position of the moving bones in real time and integrates the skirt models at different time points. By binding the moving bones of the waist, hips and hem, it can accurately capture the human body movement data and effectively generate natural and smooth skirt animation. It solves the problems of unrealistic dynamic performance of skirts, lagging simulation or being too rigid in traditional animation, and improves the authenticity and coherence of animation, especially in complex motion scenes.

[0024] (2) The dynamic skeleton-based optimization algorithm for generating animation of tube skirts binds a group of skeletons arranged in a ring shape to the three-dimensional model of the tube skirt. By introducing the judgment of the direction of the tube skirt skeleton nodes relative to the human body, the position of the tube skirt skeleton nodes relative to the tube skirt can be determined. Compared with the existing animation generation algorithm, it can be judged whether there is model penetration.

[0025] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 The present invention is a flow chart of the optimization algorithm for generating tube skirt animation based on dynamic skeleton.

[0027] Figure 2 The present invention is a flow chart of the collision detection algorithm of the tube skirt animation generation optimization algorithm based on dynamic skeleton. DETAILED DESCRIPTION

[0028] The embodiment of the present application uses a tube skirt animation generation optimization algorithm based on dynamic bones, calculates the position of moving bones in real time and integrates tube skirt models at different time points, binds the moving bones of the waist, hips and hem, and accurately captures human body movement data. It can effectively generate natural and smooth tube skirt animation, which solves the problems of unrealistic dynamic performance of tube skirts, lagging simulation or being too rigid in traditional animation, and improves the realism and continuity of the animation, especially in complex motion scenes.

[0029] See also Figure 1 The embodiment of the present invention provides a technical solution: a tube skirt animation generation optimization algorithm based on dynamic bones, comprising the following steps: determining the initial model of the tube skirt, and binding motion bones at the waist, hips and hem of the initial model of the tube skirt; obtaining human body motion data, and determining the position data of the motion bones based on the human body motion data; obtaining the tube skirt model in motion based on the position data of the motion bones, and marking the time points of the tube skirt model in motion; integrating the initial model of the tube skirt and the tube skirt model in motion at each time point in chronological order to obtain the tube skirt animation.

[0030] First, we bind dynamic bones to the key parts of the skirt (such as the waist, hips, and hem) so that these parts can deform accordingly with human body movements. By capturing human body movement data, such as gait, rotation, and bending, we convert it into dynamic bone position information to ensure that the skirt can follow the changes in human body movements. Based on human body movement data at different time points, we generate a series of skirt models that match the dynamic bone positions. Each model corresponds to the state of the skirt when the human body moves. We integrate the skirt models at each time point in chronological order to generate a smooth skirt animation.

[0031] By matching dynamic skeletons with motion data, the swing and deformation of the skirt will be more natural, avoiding the rigid and uncoordinated movements in traditional animations. The animation can be automatically generated based on the motion data, without the need to manually adjust the state of the skirt in each frame, greatly improving the efficiency of animation production. The algorithm can adapt to various complex motion scenes, ensuring that the performance of the skirt is always realistic in different movements, improving the overall animation effect of the character, and through skeleton drive rather than complex physical simulation, this method reduces the demand for hardware resources and optimizes computing efficiency while maintaining realism.

[0032] Specifically, the method of determining the initial model of a tube skirt comprises the following steps: determining a skirt type; obtaining, based on the skirt type, a number of pending tube skirt models corresponding to the skirt type and stored in a database; obtaining basic data of the tube skirt, the basic data of the tube skirt including the waist circumference of the tube skirt, the length of the tube skirt and the material of the tube skirt; and determining the initial model of the tube skirt from a number of pending tube skirt models based on the basic data of the tube skirt.

[0033] In this embodiment, the basic type of tube skirt is first determined according to design requirements or user selection, such as A-line skirt, pencil skirt or pleated skirt. Each skirt type has specific geometric characteristics. According to the selected skirt type, a set of predefined tube skirt models that match the skirt type are extracted from the database. Each model in the database contains different sizes, shapes and details, suitable for various possible tube skirt designs. The user or the design system provides key parameters of the tube skirt, including the waist circumference, skirt length and material of the tube skirt. These data are used to further determine the specific model. Based on the acquired tube skirt basic data, the model that best meets the parameters is selected from several tube skirt models to be determined in the database, and is determined as the final tube skirt initial model, which serves as the basis for subsequent animation generation.

[0034] By obtaining the basic data of the tube skirt (such as waist circumference, skirt length and material), you can flexibly select a tube skirt model that matches the user's needs, realize highly personalized clothing design, and directly call the pending model that matches the skirt type from the database, reducing the time of designing from scratch and improving the efficiency of design and animation production. By selecting the model that best matches the specific parameters (waist circumference, skirt length, material), ensure that the final initial model meets the design requirements and reduce the work of later modifications.

[0035] Specifically, the method of determining the initial model of the tube skirt from several pending tube skirt models based on the basic data of the tube skirt comprises the following steps: comparing the material of the tube skirt with the model material of each pending tube skirt model, and obtaining multiple preferred tube skirt models whose model material is the same as the material of the tube skirt; comparing the model waist circumference and model skirt length of the preferred tube skirt model with the waist circumference and skirt length of the tube skirt, and obtaining a comparison coefficient; and determining the preferred tube skirt model corresponding to the smallest comparison coefficient as the initial model of the tube skirt.

[0036] The calculation formula of the comparison coefficient is:

[0037] D x =e| M w-Qw|+| M c-Qc|;

[0038] Where Dx is the comparison coefficient, Mw is the model waist circumference, Mc is the model skirt length, Qw is the tube skirt waist circumference, Qc is the tube skirt length, and e is a natural constant.

[0039] In this implementation scheme, the material of each pending skirt model in the database is first compared with the skirt material provided by the user, and models with the same or similar materials are screened out. This step ensures that the screened models are consistent with the user's requirements in terms of material, and excludes models that do not meet the material requirements. For the preferred skirt model with matching material, its model waist circumference (Mw) and model skirt length (Mc) are further compared with the skirt waist circumference (Qw) and skirt length (Qc) provided by the user. The preferred skirt model with the smallest comparison coefficient is used as the final initial skirt model, thereby obtaining a model that best meets the user's requirements as the basis for subsequent animation generation.

[0040] Through the double comparison of material and size, it can ensure that the selected tube skirt model best meets the user's requirements in terms of material and size, and maximize personalized design. The automatic screening model is screened through the calculation formula of the comparison coefficient, avoiding the inefficiency of manual screening, saving time and improving work efficiency. By accurately calculating the difference in waist circumference and skirt length, it is ensured that the selected tube skirt model is highly consistent with the user's requirements in size, reducing the subsequent debugging or modification work.

[0041] Specifically, the human body motion data includes joint motion data, gait motion data and posture data, wherein the joint motion data includes joint motion angle and joint motion speed, and the gait motion data includes step length and step frequency.

[0042] The method for determining the position data of the moving bones based on the human motion data includes the following steps: obtaining various human motion reference data stored in a database; comparing and analyzing the human motion data with various human motion reference data to obtain a comparison coefficient; and obtaining the position data of the moving bones stored in the database corresponding to the human motion reference data corresponding to the smallest comparison coefficient.

[0043] The human body motion reference data includes joint motion reference data, gait motion reference data and posture reference data, wherein the joint motion reference data includes a joint motion reference angle and a joint motion reference speed, and the gait motion reference data includes a reference step length and a reference step frequency.

[0044] In the present embodiment, various types of human motion reference data stored are extracted from the database, and these data include reference values ​​of joint motion, gait and posture as the benchmark for subsequent comparison. The actual human motion data (including joint motion angle, joint motion speed, step length, step frequency and posture, etc.) provided by the user are compared with the reference data in the database to analyze the difference between them. According to a formula or algorithm, the actual data and the reference data are quantified and a comparison coefficient is generated. The comparison coefficient is used to measure the difference between the actual motion data and the reference data, and the smaller the value, the closer the two are. The reference data with the minimum comparison coefficient is selected as the best match, which means that the reference data is closest to the actual human motion data. Then, the corresponding motion bone position data is obtained to ensure that the skeletal motion in the animation is accurate.

[0045] By comparing the multi-dimensional data of joint angles, speeds, step lengths, cadences, and postures, we can obtain the motion bone data that is closest to the actual motion state of the human body, making the generated animation more realistic and natural. By calculating the comparison coefficient, we can automatically select the optimal reference data, avoiding the complexity of manual adjustment and comparison one by one, greatly improving work efficiency. Not only the movement of the joints is considered, but also the gait (step length and cadence) and overall posture are combined. This comprehensive analysis of multi-dimensional data ensures the global consistency of the motion bone position and human motion. The calculation of the comparison coefficient ensures that the error is minimized, and the generated motion bone data is more consistent with the real human motion, avoiding unnatural or stiff movements in the animation.

[0046] Specifically, the obtaining of the comparison coefficient includes the following steps: comparing and analyzing the joint motion data and the joint motion reference data to obtain the joint motion compliance coefficient; comparing and analyzing the gait motion data and the gait motion reference data to obtain the gait motion compliance coefficient; comparing and analyzing the posture data and the posture reference data to obtain the posture compliance coefficient; fusing the joint motion compliance coefficient, the gait motion compliance coefficient and the posture compliance coefficient to obtain the comparison coefficient.

[0047] The calculation formula of the comparison coefficient is as follows:

[0048] BX = ln(Gyx+Byx+Zx+1);

[0049] Gyx=σ(A1, B1)+σ(A2, B2);

[0050] Byx=e |Mb-Qb|+|M p -Qp| ;

[0051] Zx=σ(A3,B3);

[0052] Wherein, BX is the comparison coefficient, A1 is the joint motion angle, A2 is the joint motion speed, B1 is the joint motion reference angle, B2 is the joint motion reference speed, σ(A1, B1) is the similarity function between the joint motion angle and the joint motion speed, σ(A2, B2) is the similarity function between the joint motion reference angle and the joint motion reference speed, Mb is the step length, Mp is the step frequency, Qb is the reference step length, Qp is the reference step frequency, A3 is the posture data, B3 is the posture reference data, σ(A3, B3) is the similarity function between the posture data and the posture reference data, e is a natural constant, Gyx is the joint motion compliance coefficient, Byx is the gait motion compliance coefficient, and Zx is the posture compliance coefficient.

[0053] In this embodiment, the actual joint motion data (including angle and speed) are compared with the reference data, and the similarity of the joint motion angle and speed is calculated by similarity functions σ(A1, B1) and σ(A2, B2), respectively, so as to obtain the joint motion conformity coefficient Gyx. The gait motion data is calculated by comparing the actual step length Mb and step frequency Mp with the reference step length Qb and reference step frequency Qp to calculate the gait motion conformity coefficient Byx=e |Mb-Qb|+|Mp-Qp| . The exponent in this formula amplifies the difference in gait data. The posture data A3 and the reference posture data B3 are compared through the similarity function σ(A3, B3) to obtain the posture conformity coefficient Zx, which reflects the consistency of the posture data. Finally, the joint motion conformity coefficient, gait motion conformity coefficient and posture conformity coefficient are fused through the formula BX=ln(Gyx+Byx+Zx+1) to generate the total comparison coefficient BX. This formula takes the logarithm of the accumulation of each conformity coefficient, integrates the influence of different motion dimensions into the calculation range, and smoothes the differences.

[0054] By comparing the data of joint movement, gait and posture respectively, we ensure that every key aspect of human movement can be accurately matched, improve the authenticity and consistency of the overall movement data, and use similarity functions and exponential functions to amplify the differences in joint movement, gait and posture to ensure that subtle differences are not ignored, thereby improving the accuracy of motion skeleton matching. By comprehensively comparing the data of joints, gait and posture and fusing them into a comparison coefficient, it is helpful to screen out the data that best matches the actual movement, reduce errors in animation generation, and make the performance of clothing such as tube skirts in movement more natural and realistic.

[0055] Specifically, the method of obtaining the tube skirt model during movement based on the position data of the moving bones includes: performing similarity analysis on the position data of the moving bones and the reference motion data of each bone stored in a database to obtain the bone reference motion data that matches the position data of the moving bones; and obtaining the tube skirt model during movement corresponding to the bone reference motion data stored in the database.

[0056] In this embodiment, first, the position data of the actual motion skeleton obtained is subjected to similarity analysis with the skeleton reference motion data stored in the database. The matching degree of the actual skeleton data and the reference data is compared by a similarity function to find out the closest skeleton reference motion data. After the similarity analysis, the system will find the skeleton reference motion data that matches the motion skeleton position data. According to the matched skeleton reference motion data, the corresponding tube skirt model during motion is obtained from the database. The model reflects the dynamic performance of the tube skirt in the corresponding action.

[0057] By analyzing the similarity between the motion bone position data and the reference data, it is ensured that the selected skirt model can accurately reflect the dynamic effect of the skirt during actual human movement, making the animation more realistic and natural. This method utilizes the existing bone reference motion data and predefined skirt models in the database to avoid calculating the dynamic performance of the skirt from scratch for each movement, reducing the demand for computing resources and improving processing efficiency. It relies on the bone reference data and corresponding skirt models stored in the database and can flexibly handle different types of movements and different styles of skirts, making the system more adaptable and able to cope with a variety of complex scenarios.

[0058] In the field of real-time rendering, realistically simulating the movement of character clothes has always been a difficult problem in the industry. Especially for tube skirts with loose hems, traditional cloth animation based on physical simulation requires a lot of computing resources and has too much performance overhead. At the same time, completely hand-made tube skirt animation is not only time-consuming and labor-intensive, but also difficult to simulate the softness and natural drooping effect of the tube skirt, and cannot completely avoid the problem of model penetration (interlacing of the tube skirt animation with the human body model during operation).

[0059] In order to solve these problems, cloth animation generation technology based on dynamic bones has been widely used. By binding clothing to a simple bone system, the amount of calculation can be greatly reduced, and the dynamic effect of clothing can be better simulated. However, the existing method of dynamic bone-driven cloth animation is suitable for the simulation of unilateral cloth animation (such as cloaks and flags), and the animation simulation effect of tube skirts, especially long tube skirts, is poor, and there are serious problems of penetration and instability.

[0060] The traditional cloth animation generation algorithm based on dynamic bones includes:

[0061] 1. Binding of skirt skeletons: Bind a group of skeletons arranged in a ring on the 3D model of the skirt. These skeletons surround the waist, hips, hem and other key parts of the skirt, and depict the basic shape and movement characteristics of the skirt.

[0062] 2. Generation of skeletal motion: Automatically generate the motion of the tube skirt skeleton based on the character's motion data (such as walking, running, etc.).

[0063] 3. Skeleton-based skirt deformation: According to the movement of the skeleton, the displacement of the skirt mesh vertices is calculated to achieve the deformation of the skirt shape. The linear skinning method is used to smoothly transfer the movement of the skeleton to the skirt surface.

[0064] 4. Calculate physical constraints: Based on the movement of bones, introduce a set of physical constraints and forces to calculate the position adjustment of bones and correct the position of bones. These constraints include:

[0065] 1) Length constraint: limit the distance between the upper and lower edge bones of the skirt to prevent the skirt from over-stretching.

[0066] 2) Collision detection: Detect and handle collisions between skirts and legs and other body parts to prevent penetration.

[0067] 3) Gravity and damping: Apply gravity and damping to the tube skirt skeleton to simulate the stress conditions of the tube skirt in the real world.

[0068] Detailed processing of the tube skirt surface: add calculation of the tube skirt material properties (such as hardness, elasticity, etc.), and fine-tune the tube skirt animation effect.

[0069] The present invention mainly optimizes the calculation of the physical constraints in step 4 of the above steps:

[0070] Add horizontal constraints: Traditional physical constraints are mainly calculated in the vertical direction without considering horizontal constraints, which can easily lead to excessive deformation of the cloth in the horizontal direction. By adding horizontal constraints, the movement of bone joints in the horizontal direction can be controlled. The nodes on adjacent bone links are connected in pairs in the horizontal direction to form horizontal constraint pairs. The specific algorithm of horizontal physical constraints is as follows:

[0071] 1) Traverse all horizontal constraint pairs consisting of horizontally adjacent bone joint nodes.

[0072] 2) According to the horizontal constraint coefficient set by the user, calculate the weight values ​​of the two joint nodes of the horizontal constraint pair.

[0073] 3) Calculate the direction vector and distance between two points.

[0074] 4) Calculate the difference with the constraint length and calculate the horizontal displacement.

[0075] 5) Update the positions of the two points according to the horizontal displacement.

[0076] like Figure 2 The figure shows the collision detection algorithm flow chart.

[0077] Optimization of collision detection algorithm: The traditional collision detection algorithm constructs a capsule body on the human body skeleton node to represent the human body model, and calculates the shortest distance from the tube skirt skeleton node to the center line segment of the capsule body. If the distance is less than the radius of the capsule body, interpenetration occurs. However, the algorithm does not take into account the situation that the skeleton node of the tube skirt on the back of the human body may change to the front of the human body after motion calculation. In this case, although the algorithm determines that there is no interpenetration, the actual situation is that serious interpenetration has occurred. In order to solve this problem, the present invention introduces the judgment of the tube skirt skeleton node relative to the human body. The specific algorithm is as follows:

[0078] Define P: the position vector of the tube skirt skeleton node; A: the position vector of the bottom center point of the capsule; B: the position vector of the top center point of the capsule; r: the radius of the capsule; R: the right vector of the capsule; InFront: the initial direction of the tube skirt skeleton node relative to the capsule (0 is in front of the human body, 1 is behind the human body).

[0079] 1) Calculate the unit direction vector and height of the capsule:

[0080] V=BA,h=||V||(length of V)

[0081] V'=V / h

[0082] 2) Calculate the projection of the skeleton node point P to the middle line segment AB of the capsule:

[0083] t=(PA)·V' (where · represents the dot product operation), t'=max(0,min(t,h))

[0084] 3) Calculate the distance from point P to the projection point Q:

[0085] Q=A+t'*V',d=||PQ||

[0086] 4) Determine the positional relationship between point P and the upward plane of the capsule (normal is the right vector R):

[0087] d=R·P+D, PIsFront=d>0;

[0088] If d>0, point P is in front of the plane

[0089] If d<0, the point is behind the plane

[0090] If d = 0, the point is on the plane

[0091] 5) Determine whether the direction of point P relative to the human body has changed:

[0092] Changed=(PIsFront!=InFront)

[0093] If Changed is equal to 0, the position of the tube skirt bone node relative to the capsule body has not changed.

[0094] If Changed is equal to 1, the position of the tube skirt bone node relative to the capsule body changes.

[0095] 6) Determine whether the point is within the capsule:

[0096] If d≤r, the point is inside the capsule or on the surface of the capsule

[0097] If d>r, then the point is outside the capsule

[0098] 7) If the point is inside the capsule, calculate the position P' of point P according to whether the direction of P relative to the human body changes:

[0099] If Changed is equal to 0, P'=Q+(PQ)*DistanceFrac;

[0100] If Changed is equal to 1, P'=Q-(PQ)*DistanceFrac;

[0101] DistanceFrac is the distance coefficient between the vector of the bone node and the projection point.

[0102] An electronic device includes: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the processor executes the above-mentioned dynamic skeleton-based tube skirt animation generation optimization algorithm.

[0103] A computer-readable storage medium is used to store a program, which, when executed by a processor, implements the above-mentioned dynamic skeleton-based tube skirt animation generation optimization algorithm.

[0104] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0105] The present invention is described with reference to flowcharts and / or block diagrams of systems, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0106] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0108] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0109] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. The optimization algorithm for generating skirt animation based on dynamic skeleton is characterized by: The following steps are involved: Determine the initial model of the tube skirt, and bind motion bones to the waist, hips and hem of the initial model of the tube skirt; Acquire human motion data, and determine position data of the moving bones based on the human motion data; Based on the position data of the moving bones, the tube skirt model during movement is obtained, and the time points of the tube skirt model during each movement are marked; In chronological order, the initial model of the tube skirt and the tube skirt model at each time point are integrated to obtain the tube skirt animation.

2. The optimization algorithm for generating skirt animation based on dynamic skeleton according to claim 1 is characterized in that: Determining the initial model of the tube skirt comprises the following steps: Determine the skirt shape; Based on the skirt type, a number of pending tube skirt models corresponding to the skirt type stored in a database are obtained; Obtaining basic data of a tube skirt, wherein the basic data of the tube skirt includes waist circumference, length and material of the tube skirt; The initial model of the tube skirt is determined from several pending tube skirt models based on the basic data of the tube skirt.

3. The optimization algorithm for generating skirt animation based on dynamic skeleton according to claim 2 is characterized in that: The method of determining the initial model of the tube skirt from a plurality of pending tube skirt models based on the tube skirt basic data comprises the following steps: Compare the material of the tube skirt with the model materials of each pending tube skirt model, and obtain multiple preferred tube skirt models whose model materials are the same as the tube skirt material; Compare the model waist circumference and model skirt length of the optimal tube skirt model with the waist circumference and skirt length of the tube skirt to obtain a comparison coefficient; The optimal tube skirt model corresponding to the smallest comparison coefficient is determined as the initial tube skirt model.

4. The optimization algorithm for generating skirt animation based on dynamic skeleton according to claim 3 is characterized in that: The calculation formula of the comparison coefficient is: Dx=e |Mw-Qw|+|Mc-Qc| ; Where Dx is the comparison coefficient, Mw is the model waist circumference, Mc is the model skirt length, Qw is the tube skirt waist circumference, Qc is the tube skirt length, and e is a natural constant.

5. The dynamic skeleton-based skirt animation generation optimization algorithm according to claim 1 is characterized in that: The human body motion data includes joint motion data, gait motion data and posture data, wherein the joint motion data includes joint motion angle and joint motion speed, and the gait motion data includes step length and step frequency.

6. The optimization algorithm for generating skirt animation based on dynamic skeleton according to claim 4 is characterized in that: The method of determining the position data of the moving bones based on the human body movement data comprises the following steps: Acquire various human motion reference data stored in a database; Comparing and analyzing the human motion data with various human motion reference data to obtain a comparison coefficient; The human body motion reference data corresponding to the minimum comparison coefficient is obtained, and the position data of the motion bones corresponding to the motion reference data stored in the database are obtained.

7. The optimization algorithm for generating skirt animation based on dynamic skeleton according to claim 6 is characterized in that: The human body motion reference data includes joint motion reference data, gait motion reference data and posture reference data, wherein the joint motion reference data includes a joint motion reference angle and a joint motion reference speed, and the gait motion reference data includes a reference step length and a reference step frequency.

8. The optimization algorithm for generating skirt animation based on dynamic skeleton according to claim 7 is characterized in that: The obtaining of the comparison coefficient comprises the following steps: Compare and analyze the joint motion data and the joint motion reference data to obtain the joint motion compliance coefficient; Compare and analyze the gait motion data with the gait motion reference data to obtain the gait motion compliance coefficient; Compare and analyze the posture data with the posture reference data to obtain the posture compliance coefficient; The joint motion compliance coefficient, gait motion compliance coefficient and posture compliance coefficient are integrated to obtain a comparison coefficient; The calculation formula of the comparison coefficient is as follows: BX = ln(Gyx+Byx+Zx+1); Gyx=σ(A1, B1)+σ(A2, B2); Byx=e |Mb-Qb|+|Mp-Qp| ; Zx=σ(A3,B3); Wherein, BX is the comparison coefficient, A1 is the joint motion angle, A2 is the joint motion speed, B1 is the joint motion reference angle, B2 is the joint motion reference speed, σ(A1, B1) is the similarity function between the joint motion angle and the joint motion speed, σ(A2, B2) is the similarity function between the joint motion reference angle and the joint motion reference speed, Mb is the step length, Mp is the step frequency, Qb is the reference step length, Qp is the reference step frequency, A3 is the posture data, B3 is the posture reference data, σ(A3, B3) is the similarity function between the posture data and the posture reference data, e is a natural constant, Gyx is the joint motion compliance coefficient, Byx is the gait motion compliance coefficient, and Zx is the posture compliance coefficient.

9. The optimization algorithm for generating skirt animation based on dynamic skeleton according to claim 1 is characterized in that: The method of obtaining the tube skirt model during movement based on the position data of the moving skeleton includes: Performing similarity analysis on the position data of the moving bones and the reference motion data of each bone stored in the database to obtain the reference motion data of the bone that matches the position data of the moving bones; The tube skirt model in motion is obtained by obtaining the corresponding skeleton reference motion data stored in the database.

10. The optimization algorithm for generating skirt animation based on dynamic skeleton according to claim 1 is characterized in that: After getting the skirt animation, we also need to detect and process the collision between the skirt and the human body to prevent interpenetration: Traverse the horizontal constraint pairs composed of all horizontally adjacent bone joint nodes; Based on the horizontal constraint coefficient set by the user, the weight values ​​of the two joint nodes of the horizontal constraint pair are calculated; Calculate the direction vector and distance between two points; Calculate the difference with the constraint length and calculate the horizontal displacement; Update the positions of the two points according to the horizontal displacement; The specific algorithm is as follows: Calculate the unit direction vector and height of the capsule: V=BA,h=||V||; V'=V / h; Calculate the projection of the bone node point P to the middle line segment AB of the capsule: t=(PA)·V', t'=max(0,min(t,h)); Calculate the distance from point P to the projection point Q: Q=A+t'*V',d=||PQ||; Determine the position relationship between point P and the upward plane of the capsule: d=R·P+D, PIsFront=d>0; If d>0, point P is in front of the plane; If d < 0, the point is behind the plane; If d = 0, the point is on the plane; Determine whether the direction of point P relative to the human body has changed: Changed=(PIsFront!=InFront); If Changed is equal to 0, the position of the tube skirt skeleton node relative to the capsule body does not change; if Changed is equal to 1, the position of the tube skirt skeleton node relative to the capsule body changes; Determine whether the point is within the capsule: If d≤r, the point is inside the capsule or on the surface of the capsule; If d>r, the point is outside the capsule body; If the point is inside the capsule, calculate the position P' of point P according to whether the direction of P relative to the human body has changed: if Changed is equal to 0, P' = Q + (PQ) * DistanceFrac; If Changed is equal to 1, P'=Q-(PQ)*DistanceFrac; Where DistanceFrac is the distance coefficient between the vector of the bone node and the projection point, P is the position vector of the skeleton node of the skirt; A is the position vector of the center point of the bottom of the capsule; B: position vector of the top center point of the capsule; r: capsule radius; R: capsule right vector; InFront: the initial direction of the tube skirt skeleton node relative to the capsule, InFront is 0 in front of the human body, and InFront is 1 behind the human body.