Animation gait control method and system, electronic equipment and storage medium

By calculating and predicting stride length and theoretical stride frequency, and combining physical constraints and movement intentions, the root bone position is dynamically adjusted, solving the problem of virtual character sliding, improving the realism of the virtual environment and the smoothness of animation, and reducing animation production costs.

CN121746554AActive Publication Date: 2026-03-27HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-28
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In existing technologies, characters in virtual environments often experience slippage because the logical displacement speed is difficult to synchronize with the inherent foot movement speed of animation resources. This severely damages the realism of the virtual environment and lacks a universal mechanism to adapt to characters of different body types.

Method used

By calculating the predicted stride and theoretical stride frequency of a 3D character, and combining physical constraints and movement intentions, the root bone position is dynamically adjusted. Weighted fusion and temporal smoothing are then used to ensure that the character remains firmly in contact with the ground at any speed and trajectory.

Benefits of technology

It effectively avoids the slippage phenomenon, improves the realism of the virtual environment and the smoothness of the animation, and reduces the production cost of animation resources for characters of different body types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121746554A_ABST
    Figure CN121746554A_ABST
Patent Text Reader

Abstract

The invention provides an animation gait control method and system, an electronic device and a storage medium, is suitable for the technical field of virtual reality, calculates a predicted stride and a theoretical stride frequency through a moving speed, and comprehensively considers physical constraints and a moving intention to determine a final root skeleton position. And controlling the three-dimensional role to move according to the predicted stride and the theoretical stride frequency, and adjusting the root skeleton of the three-dimensional role to the final root skeleton position, so that the condition that the three-dimensional role slides when moving is avoided, and the sense of reality of the virtual environment is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of virtual reality, and particularly relates to an animation gait control method and system, an electronic device and a storage medium. BACKGROUND

[0002] In three-dimensional game development, film and television animation production and virtual reality application, the motion control of a character generally adopts a "skeletal animation blending" technology, that is, key frame animation segments of different speeds are prepared in advance, and the segments are played by linear interpolation according to the actual moving speed of the character through an "animation state machine" or a "blending tree" in runtime.

[0003] However, since the logical displacement speed of the character is often difficult to keep perfect real-time synchronization with the inherent foot displacement speed of the animation resource, this will cause the character's feet to be unable to keep absolute stillness when contacting the ground, resulting in a "sliding step" visual error relative to the ground, which seriously damages the realism of the virtual environment. SUMMARY

[0004] Therefore, the embodiments of the present application provide an animation gait control method and system, an electronic device and a storage medium to solve the problem that the prior art seriously damages the realism of the virtual environment.

[0005] To achieve the above object, the embodiments of the present application provide the following technical solutions.

[0006] The first aspect of the embodiments of the present application discloses an animation gait control method, which comprises:

[0007] calculating a predicted stride and a theoretical step frequency of the three-dimensional character according to the moving speed of the three-dimensional character;

[0008] calculating a first root bone position satisfying a physical constraint and a second root bone position satisfying the moving intention of the three-dimensional character;

[0009] performing weighted fusion on the first root bone position and the second root bone position to obtain a final root bone position;

[0010] controlling the three-dimensional character to move according to the predicted stride and the theoretical step frequency, and adjusting the root bone of the three-dimensional character to the final root bone position.

[0011] Preferably, the calculation of the predicted stride and the theoretical step frequency of the three-dimensional character according to the moving speed of the three-dimensional character comprises:

[0012] calculating a double-leg included angle of the three-dimensional character according to the moving speed of the three-dimensional character;

[0013] calculating the predicted stride of the three-dimensional character by using the double-leg included angle and the leg length of the three-dimensional character.

[0014] calculate a theoretical step frequency of the three-dimensional character based on the moving speed of the three-dimensional character and the predicted step length.

[0015] Preferably, the calculating of the theoretical step frequency of the three-dimensional character based on the moving speed of the three-dimensional character and the predicted step length comprises:

[0016] calculating a first step frequency of the three-dimensional character based on the moving speed of the three-dimensional character and the predicted step length;

[0017] limiting the first step frequency by an upper limit value and a lower limit value to obtain the theoretical step frequency of the three-dimensional character.

[0018] Preferably, the weighted fusion of the first root bone position and the second root bone position to obtain the final root bone position comprises:

[0019] calculating a target index, the target index being used to represent whether the foot of the three-dimensional character is stably in contact with the ground;

[0020] dynamically assigning a first weight of the first root bone position and a second weight of the second root bone position by the target index;

[0021] based on the first weight and the second weight, weighted fusion of the first root bone position and the second root bone position to obtain the final root bone position.

[0022] Preferably, before the weighted fusion of the first root bone position and the second root bone position, the method further comprises:

[0023] time domain smoothing processing of the first root bone position and the second root bone position.

[0024] Preferably, before the controlling of the three-dimensional character to move according to the predicted step length and the theoretical step frequency, the method further comprises:

[0025] time domain smoothing processing of the predicted step length and the theoretical step frequency.

[0026] The second aspect of the embodiment of the application discloses an animation gait control system, the system comprising:

[0027] a first calculation unit, configured to calculate a predicted step length and a theoretical step frequency of a three-dimensional character by a moving speed of the three-dimensional character;

[0028] a second calculation unit, configured to calculate a first root bone position satisfying a physical constraint, and calculate a second root bone position satisfying a moving intention of the three-dimensional character;

[0029] a weighting unit configured to perform weighted fusion on the first root bone position and the second root bone position to obtain a final root bone position;

[0030] a control unit configured to control the three-dimensional character to move according to the predicted stride and the theoretical step frequency, and adjust a root bone of the three-dimensional character to the final root bone position.

[0031] Preferably, the first calculation unit comprises:

[0032] a first calculation module configured to calculate a double-leg included angle of the three-dimensional character according to a moving speed of the three-dimensional character;

[0033] a second calculation module configured to calculate a predicted stride of the three-dimensional character according to the double-leg included angle of the three-dimensional character and a leg length of the three-dimensional character;

[0034] a third calculation module configured to calculate a theoretical step frequency of the three-dimensional character according to the moving speed of the three-dimensional character and the predicted stride.

[0035] A third aspect of the embodiment of the present application discloses a computer device, comprising a processor and a memory, the processor and the memory are connected through a bus; wherein the processor is used to call and execute a program stored in the memory; the memory is used to store a program, and the program is used to realize the animation gait control method disclosed in the first aspect of the embodiment of the present application.

[0036] A fourth aspect of the embodiment of the present application discloses a storage medium, the storage medium stores computer executable instructions, and the computer executable instructions are used to execute the animation gait control method disclosed in the first aspect of the embodiment of the present application.

[0037] Based on the above-mentioned animation gait control method, system, electronic device and storage medium provided by the embodiment of the present application, the method is: calculating a predicted stride and a theoretical step frequency of a three-dimensional character according to a moving speed of the three-dimensional character; calculating a first root bone position satisfying a physical constraint, and calculating a second root bone position satisfying a moving intention of the three-dimensional character; performing weighted fusion on the first root bone position and the second root bone position to obtain a final root bone position; controlling the three-dimensional character to move according to the predicted stride and the theoretical step frequency, and adjusting a root bone of the three-dimensional character to the final root bone position. The scheme calculates the predicted stride and the theoretical step frequency according to the moving speed, and determines the final root bone position by comprehensively considering the physical constraint and the moving intention. The three-dimensional character is controlled to move according to the predicted stride and the theoretical step frequency, and the root bone of the three-dimensional character is adjusted to the final root bone position, so as to avoid the situation that the three-dimensional character slips when moving, and ensure the reality of the virtual environment. BRIEF DESCRIPTION OF DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments or prior art description. Obviously, the drawings in the following description only represent some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative effort based on the provided drawings.

[0039] Figure 1 A flow chart of an animation gait control method provided for an embodiment of the present application;

[0040] Figure 2 A flow chart of calculating a predicted stride and a theoretical step frequency provided for an embodiment of the present application;

[0041] Figure 3 A flow chart of obtaining a final root skeleton position provided for an embodiment of the present application;

[0042] Figure 4 An example diagram of a hierarchical architecture of an animation gait control method provided for an embodiment of the present application;

[0043] Figure 5 A structural block diagram of an animation gait control system provided for an embodiment of the present application. DETAILED DESCRIPTION

[0044] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only represent some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort fall within the scope of protection of the present application.

[0045] In the present application, the term "comprising" or "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the element defined by the phrase "including a" does not exclude the presence of another identical element in the process, method, article or device including the element.

[0046] In three-dimensional game development, film and television animation production and virtual reality application, the motion control of a character generally adopts a "skeletal animation blending" technology, that is, different speed key frame animation segments are prepared in advance, and in runtime, these segments are played by linear interpolation according to the actual moving speed of the character through an "animation state machine" or a "blending tree".

[0047] However, due to the difficulty in keeping the logical displacement speed of the character (controlled by the code) in perfect real-time synchronization with the inherent displacement speed of the animation resources (produced by the art department), the character's feet cannot be absolutely stationary when they touch the ground, resulting in a "sliding step" visual error relative to the ground. This "sliding step" phenomenon is particularly evident during variable speed movements, sudden stops, or terrain undulations, severely damaging the realism of the virtual environment.

[0048] Research has found that to solve the sliding step, the current solution in the industry is to use reverse dynamics to forcibly lock the foot end coordinates. However, existing algorithms usually adjust the leg bones in isolation, lacking linkage correction for the body's center of gravity (root bone). When characters with different leg lengths and body types need to be driven, the original animation data is no longer applicable (stride mismatch). The existing technology lacks a general mechanism for automatically calculating the stride based on anatomical parameters such as leg length, resulting in developers having to produce multiple sets of animation resources for characters of different body types, greatly increasing production costs.

[0049] To this end, the embodiments of the present application propose an animation gait control method, system, electronic device, and storage medium. The predicted stride and theoretical step frequency are calculated by the movement speed, and the final root bone position is determined by considering physical constraints and movement intentions. The three-dimensional character moves according to the predicted stride and theoretical step frequency, and the root bone of the three-dimensional character is adjusted to the final root bone position, thereby avoiding the sliding step of the three-dimensional character during movement and ensuring the realism of the virtual environment.

[0050] It should be noted that in the control of a three-dimensional character (3D character or virtual character), the most common technical problem when the three-dimensional character moves along a path is the "sliding step" problem. In traditional animation systems, the character's steps often slide like on ice, rather than actually stepping on the ground, which severely damages the immersion.

[0051] The scheme proposed by the embodiments of the present application can ensure that the character "steps firmly" on the ground at any movement speed and any movement trajectory (straight line, curve, sudden turn), presenting a realistic weight and biological movement characteristics. The "three-dimensional character" referred to in the embodiments of the present application is not only a humanoid character, but also various biological form characters.

[0052] Referring to Figure 1 , a flowchart of an animation gait control method provided by an embodiment of the present application is shown, which includes:

[0053] Step S101: Calculate the predicted stride and theoretical step frequency of the three-dimensional character by the movement speed of the three-dimensional character.

[0054] In the implementation of step S101, the current moving speed of the three-dimensional character is obtained, and the predicted step and the theoretical step frequency of the three-dimensional character are calculated respectively based on the obtained moving speed.

[0055] Step S102: calculating a first root bone position satisfying the physical constraint, and calculating a second root bone position satisfying the moving intention of the three-dimensional character.

[0056] It should be noted that the present scheme provides a constraint mode and a trajectory mode.

[0057] In the implementation of step S102, the first root bone position satisfying the physical constraint is calculated in the constraint mode, and the second root bone position satisfying the moving intention of the three-dimensional character is calculated in the trajectory mode.

[0058] Step S103: weighted fusion of the first root bone position and the second root bone position to obtain a final root bone position.

[0059] In the implementation of step S103, the first weight of the first root bone position and the second weight of the second root bone position are dynamically allocated, and the first root bone position and the second root bone position are weighted fused by the first weight and the second weight to obtain the final root bone position.

[0060] It should be noted that in a real-time system, some data may have noise or mutation, and if the mutated data is directly transmitted to the animation parameter, the three-dimensional character may have problems such as jitter and motion twitch. In order to avoid these problems, the present scheme uses the exponential smoothing filter shown in formula (1) to perform time domain smoothing processing on these mutated data.

[0061] (1);

[0062] In formula (1), is the smoothed output value at time t, is the smoothed output value (i.e. historical value) at time t-1, is the original input value at time t, and a is a smoothing coefficient (usually set to 0.85-0.95). The larger the value of a, the stronger the smoothing, but the slower the response; the smaller the value of a, the faster the response, but it may cause jitter.

[0063] In the real world, there is no real "instant change" in the movement of objects, and there will be an acceleration process. By setting different smoothing coefficients for different data, the inertia and mass of the biological movement can be simulated, so that the movement of the three-dimensional character presents a natural acceleration and deceleration process, avoiding mechanical instantaneous changes, greatly improving the smoothness and realism of the animation. Especially when the three-dimensional character changes direction, speed or contact state, the professional level of animation quality can be achieved by smoothing the exponential smoothing filter given by formula (1). For example, when the three-dimensional character starts walking from a stationary position, the step will gradually increase rather than suddenly increase; when the three-dimensional character stops, there will be a natural deceleration process rather than a sudden stop.

[0064] In some embodiments, before the first and second root bone positions are weighted and fused, the first and second root bone positions are time-domain smoothed by the exponential smoothing filter given by formula (1).

[0065] Step S104: controlling the three-dimensional character to move according to the predicted step length and the theoretical step frequency, and adjusting the root bone of the three-dimensional character to the final root bone position.

[0066] In the process of implementing step S104, the three-dimensional character is controlled to move according to the predicted step length and the theoretical step frequency calculated above, and the root bone of the three-dimensional character is adjusted to the final root bone position (i.e., the character pose of the three-dimensional character is updated), so as to avoid the situation that the three-dimensional character slips when moving, and make the movement of the three-dimensional character visually more natural.

[0067] In some embodiments, before the three-dimensional character is controlled to move according to the predicted step length and the theoretical step frequency, the predicted step length and the theoretical step frequency are time-domain smoothed by the exponential smoothing filter given by formula (1).

[0068] In the embodiments of the present application, the predicted step length and the theoretical step frequency are calculated by moving speed, and the final root bone position is determined by comprehensively considering physical constraints and movement intentions. The three-dimensional character is controlled to move according to the predicted step length and the theoretical step frequency, and the root bone of the three-dimensional character is adjusted to the final root bone position, so as to avoid the situation that the three-dimensional character slips when moving, and ensure the realism of the virtual environment.

[0069] For the above embodiments of the present application Figure 1 Step S101 involves the content of "calculating the predicted step length and the theoretical step frequency of the three-dimensional character", which is described in detail in the following Figure 2 , a flowchart for calculating the predicted step length and the theoretical step frequency provided by the embodiments of the present application is shown, Figure 2 including the following steps:

[0070] Step S201: Calculate the double-leg angle of the three-dimensional role by the moving speed of the three-dimensional role.

[0071] It should be noted that in order to ensure that the subsequent calculation of the predicted step length and the theoretical step frequency can adapt to three-dimensional roles of different heights and body shapes, first read the skeletal hierarchy of the three-dimensional role, identify the relative positions of the hip joint and the ankle joint, and calculate the leg length L of the three-dimensional role (i.e. the Euclidean distance from the hip joint to the ankle joint).

[0072] Then, the double legs of the three-dimensional role are regarded as two sides of an isosceles triangle, and the hip joint is regarded as the vertex. According to the trigonometric relationship, as shown in formula (2), the step length of the three-dimensional role is determined by the leg length and the double-leg angle.

[0073] (2);

[0074] In formula (2), λ is the step length, i.e. the horizontal distance covered in a single step; L is the leg length, i.e. the skeletal length from the hip joint to the ankle joint (which is an inherent property of the three-dimensional role); and θ is the double-leg angle (reflecting the degree of stretching of the gait).

[0075] Through formula (2), it can be revealed that there are two decisive factors of the step length: physiological structure (leg length) and motion posture (double-leg angle). A long-legged role will have a larger step length. For the same three-dimensional role, when the three-dimensional role is walking leisurely, the double-leg angle is small and the step length is small, and when the three-dimensional role is walking quickly, the double-leg angle increases and the step length becomes large.

[0076] In the process of specifically implementing step S201, in order to simulate the real strategy of the biological body from "walking" to "running" (i.e. mainly increasing the step length at low speed, and increasing the step frequency instead of the step length at high speed), the double-leg angle of the three-dimensional role is calculated by formula (3) and the moving speed v of the three-dimensional role , formula (3) is a nonlinear angle mapping function based on the moving speed.

[0077] (3);

[0078] In formula (3), is the minimum step length angle, usually set to 10°-20°, corresponding to standing or extremely slow movement; is the maximum step length angle, usually set to 60°-90°, corresponding to the maximum step length state; v is the moving speed of the three-dimensional role; is the speed scaling factor, which determines the change rate of the double-leg angle from to , the larger the value, the higher the speed that the three-dimensional role needs to reach to enter the step length saturation area (suitable for long-legged, leisurely gait three-dimensional roles), The smaller, the opposite (suitable for short legs, three-dimensional characters with agile step frequency).

[0079] In practical applications, , the of humanoid characters is moderate (can be set to 1.5-2.5), and the stride and step frequency increase simultaneously when walking turns into running; the of quadruped characters is smaller (can be set to 0.8-1.2) and relies more on step frequency changes.

[0080] The in formula (3) is an exponential saturation term. When the moving speed v is small, the function value grows very quickly, showing that the stride is rapidly enlarged; when the moving speed v exceeds a certain threshold, the function value tends to 1, and the stride no longer increases significantly, switching to "high-frequency small steps".

[0081] Step S202: Calculate the predicted stride of the three-dimensional character using the double-leg angle and leg length of the three-dimensional character.

[0082] In the process of specifically implementing step S202, the double-leg angle of the three-dimensional character is calculated by formula (3) After that, the double-leg angle and the leg length L are substituted into formula (2) to calculate the predicted stride of the three-dimensional character.

[0083] That is, when the predicted stride is calculated by formula (2), the in formula (2) is the calculated by formula (3).

[0084] Step S203: Calculate the theoretical step frequency of the three-dimensional character based on the moving speed and predicted stride of the three-dimensional character.

[0085] In the process of specifically implementing step S203, the predicted stride is calculated, and then the first step frequency F(v) of the three-dimensional character is calculated based on the moving speed v and the predicted stride of the three-dimensional character, combined with formula (4).

[0086] (4).

[0087] In order to ensure that the movement of the three-dimensional character is within the physiological range, after the first step frequency F(v) of the three-dimensional character is calculated, the first step frequency F(v) is limited by the upper step frequency limit value (denoted as F max ) and the lower step frequency limit value (denoted as F min ) to obtain the theoretical step frequency F clamped of the three-dimensional character.

[0088] Specifically, the theoretical step frequency F of the three-dimensional character is obtained by formula (5) clamped .

[0089] F clamped =clamp(F(v),F min ,F max ) (5);

[0090] In formula (5), clamp() is a limiting function.

[0091] Through formula (5), if the first step frequency F(v) is less than the lower limit value F min , the theoretical step frequency F clamped of the three-dimensional character takes F min ; if the first step frequency F(v) is greater than the upper limit value F max , the theoretical step frequency F clamped of the three-dimensional character takes F max ; if the first step frequency F(v) is between F min and F max , the theoretical step frequency F clamped of the three-dimensional character takes F(v).

[0092] By limiting the first step frequency in the above manner, it is ensured that a set of theoretical step frequency F clamped that can be executed by the three-dimensional character can be given at any extreme speed.

[0093] In practical applications, F min may take 0.5-1.0 steps / s (lower than this value will cause the motion to appear slow and unnatural), and F max may take 2.5-4.0 steps / s (which can be determined according to the body shape and physiological characteristics of the three-dimensional character).

[0094] The above Figure 2 is a related description of how to calculate the predicted step length and the theoretical step frequency of the three-dimensional character.

[0095] For the content of "obtaining the final root bone position" involved in step S103 of the above embodiment Figure 1 of the application, see Figure 3 , which shows a flowchart for obtaining the final root bone position provided by the embodiment of the application, Figure 3 including the following steps:

[0096] Step S301: Calculate a target index, which is used to represent whether the foot of the three-dimensional character is stably in contact with the ground.

[0097] It should be noted that the core principle for preventing 3D characters from sliding is that when the feet of a 3D character make substantial contact with the ground, the point of contact should become the instantaneous fulcrum of the 3D character's movement. The position of the root bones (i.e., the body's center of gravity or pelvis) is forcibly corrected through a geometric constraint algorithm.

[0098] This solution determines whether the foot is on the ground by calculating a target index in real time. This target index is a contact intensity value within the range [0,1]. Since the foot may slightly brush against uneven ground or briefly contact obstacles when the 3D character is walking, it is not enough to simply detect whether the foot is in contact with the ground. It is also necessary to distinguish between "false contact" and "effective support". Only "effective support" will trigger foot locking.

[0099] Therefore, in the specific implementation step S301, the target index c is calculated by formula (6), which is used to characterize whether the feet of the three-dimensional character are in stable contact with the ground.

[0100] (6);

[0101] In formula (6), h is the vertical distance between the foot bones and the ground (in meters). The height threshold is typically 0.1-0.2 meters, depending on the size of the 3D character. The vertical velocity of the foot relative to the ground (in meters per second). The speed threshold is 1-2 meters per second, and c is the target index. c = 0 indicates that the foot is not in contact with the ground, and c = 1 indicates that the foot is in complete and stable contact with the ground.

[0102] In formula (6) This indicates that the closer the foot is to the ground, the closer the value is to 1.

[0103] When h> At that time, c is 0. This term indicates that the smaller the vertical velocity of the foot (i.e., not a rapid slam into the ground or a rapid upward lift), the closer this term is to 1.

[0104] and Multiplication means that only when both "close enough to the ground" and "slow vertical velocity" are met simultaneously will there be high contact strength (i.e., a large value of c).

[0105] When the calculated target index c is greater than 0.7, it can be determined that the 3D character's feet are in stable contact with the ground, and foot locking is triggered. When the target index c is less than 0.3, it can be determined that the 3D character's feet are not in contact with the ground. When the target index c is between 0.3 and 0.7, it is considered a transitional state, and the feet are partially locked.

[0106] It should be noted that for the above embodiments of the present application Figure 1 The constraint mode mentioned in step S102 includes the "inverse dynamics constraint" part and the "root bone position correction" part.

[0107] Inverse dynamics constraint: When it is detected that the feet of the three-dimensional character are in stable contact with the ground (i.e., the target indicator c is greater than 0.7), it is necessary to ensure that the foot joints of the three-dimensional character remain fixed in the world coordinate system, allowing the body of the three-dimensional character to continue to move in the target direction. This is not simply "nailing the feet to the ground", but dynamically adjusting the entire leg bone chain through the inverse kinematics (IK) system to keep the foot position unchanged while the other parts of the body move normally. In order to achieve this goal, the IK system automatically adjusts the angles of the hip joint and the knee joint, resulting in the position of the pelvis (root bone) being pulled to change.

[0108] Root bone position correction: When it is detected that the feet of the three-dimensional character are in stable contact with the ground (i.e., the target indicator c is greater than 0.7), the position of the root bone is dynamically adjusted to ensure that the feet of the three-dimensional character in contact with the ground remain absolutely stationary in the world coordinate system, thereby completely eliminating the sliding step phenomenon while maintaining the natural smoothness of the overall movement of the three-dimensional character.

[0109] It should be noted that when a three-dimensional character (such as a humanoid character) walks, once the soles of the feet are in stable contact with the ground, the feet become the instantaneous fulcrum of body movement. At this time, the movement of the hip joint is no longer a simple translation, but a spherical movement with the supporting foot as the axis. This movement pattern is a basic law of biomechanics and is the core principle of the present scheme.

[0110] Therefore, for the above embodiments of the present application Figure 1 The "first root bone position satisfying the physical constraint" mentioned in step S102 can be calculated by the spherical constraint model shown in formula (7) when it is detected that the feet of the three-dimensional character are in stable contact with the ground. The first root bone position (denoted as p constrained ) is the new position of the root bone.

[0111] (7);

[0112] In formula (7), A k is the world coordinate of the foot joint in contact with the ground (sphere center), p current is the current world coordinate of the root bone, is the current joint distance (distance from the foot joint to the root bone, which is an approximately constant value), v desired is the desired instantaneous velocity, and normalize(v desired ) represents the normalization of vdesired Normalized to unit vector (only keep direction information, usually the moving direction of the three-dimensional character), p constrained The first root bone position that meets the physical constraint.

[0113] The meaning of the above formula (7) is that a virtual sphere is constructed with the foot contact position as the center and the leg length as the radius, and it is required that the root bone position must be located on the sphere. A ray is emitted from the center along the desired direction, and the intersection point of the ray and the sphere is the root bone position closest to the desired motion direction under the premise of meeting the leg length constraint. This way fundamentally eliminates the slide problem because the foot position is strictly fixed in the world coordinate system, while the naturalness of body movement is preserved (when the three-dimensional character walks on uneven ground, the pelvis will naturally fluctuate), and when the three-dimensional character turns, the body will naturally rotate. This physically correct movement greatly improves the realism and immersion of the animation.

[0114] It should be noted that strictly following the physical constraint may cause the three-dimensional character to move stiffly, and strictly following the trajectory may cause the slide problem, so a balance point needs to be found between the two, which should change dynamically with the motion state of the three-dimensional character. Therefore, the present scheme defines a constraint mode and a trajectory mode. In the constraint mode, the first root bone position that meets the physical constraint is calculated by the above formula (7).

[0115] In the trajectory mode, the physical constraint is ignored, and the root bone is moved according to the user input trajectory, so the second root bone position that meets the movement intention of the three-dimensional character (denoted as p trajectory ) can be calculated by formula (8) in the trajectory mode.

[0116] p trajectory =p pervious +v desired ×Δt (8);

[0117] In formula (8), p pervious is the root bone position of the previous frame, v desired is the desired instantaneous speed, Δt is the frame time increment (for example, 1 / 30 second), and p trajectory is the second root bone position that meets the movement intention of the three-dimensional character.

[0118] Step S302: dynamically allocate the first weight of the first root bone position and the second weight of the second root bone position through the target index.

[0119] In the process of specifically implementing step S302, the first weight of the first root bone position and the second weight of the second root bone position are dynamically allocated through the target index c. The first weight is denoted as w constraint , and the second weight is denoted as w traj .

[0120] Specifically, the first weight w constraint and the second weight w traj are allocated by formula (9) and formula (10).

[0121] w constraint =c×(1-airbone factor )(9);

[0122] w traj =1-w constraint (10);

[0123] In formula (9) and formula (10), airbone factor is an air factor (indicating the degree of the object in the air).

[0124] Wherein, airbone factor is determined by detecting the height of the center of gravity and the vertical speed of the three-dimensional role, and specifically can be calculated by formula (11). factor .

[0125] (11);

[0126] In formula (11), h com is the height of the center of gravity, h ground is the height of the ground, and airbone factor approaches 1 when the three-dimensional role is obviously off the ground.

[0127] Step S303: based on the first weight and the second weight, the first root bone position and the second root bone position are weighted and fused to obtain the final root bone position.

[0128] In the process of specifically implementing step S303, based on the first weight w constraint and the second weight w traj , the first root bone position p constrained and the second root bone position p trajectory are weighted and fused by formula (12) to obtain the final root bone position (denoted as p final ).

[0129] p final =w traj ×p trajectory +w constraint ×p constrained (12);

[0130] In practical applications, when calculating the final root bone position by formula (12), if the feet of the three-dimensional character are completely off the ground (in the air), the physical world does not provide any constraint evidence, so the final root bone position 100% follows the artistic intention (equivalent to the weight being completely allocated to the second root bone position). If the three-dimensional character contacts the ground with one foot, the proportion of the physical constraint is 70% (equivalent to most of the weight being allocated to the first root bone position). If the three-dimensional character stands steadily with both feet, the physical evidence is firm, and the proportion of the physical constraint is 90%, leaving only 10% of the artistic fine-tuning space. Through this way of dynamically allocating weights, the three-dimensional character can both make a graceful jump in the air and walk firmly on the ground.

[0131] In other words, through the above way of dynamically allocating weights, various complex scenes can be adapted to, the first weight is increased in scenes that require accurate physical simulation (such as rugged terrain), and the second weight is increased in scenes that require artistic expression (such as acrobatic jumps). This flexibility allows animators to ensure physical correctness while retaining necessary artistic control.

[0132] The above embodiment of the present application Figure 3 is related to the relevant description of obtaining the final root bone position.

[0133] As can be seen from the content of each embodiment, in actual implementation, the present scheme adopts the "pre-calculation layer-physical constraint layer-coordination optimization layer" three-layer architecture shown in Figure 4 to simulate the "prediction-execution-correction" control closed-loop process.

[0134] Pre-calculation layer: responsible for planning motion parameters in advance, just like humans will predict the step length and step frequency according to the destination and their own conditions before walking, this layer calculates the theoretically optimal gait parameters (predicted step length and theoretical step frequency) according to the moving speed and body structure of the three-dimensional character. This layer does not consider the immediate environment, but only focuses on "how should it move in an ideal state".

[0135] Physical constraint layer: responsible for immediate response and physical constraint. Just like the spinal cord reflex of the human body can automatically adjust the posture at the moment of foot contact, this layer judges the contact state of the feet and the ground in real time through collision detection, and once stable contact is detected, the foot position is immediately "locked", and the three-dimensional character is forced to move with the contact point as the fulcrum. This is the physical basis for preventing slipping, and through this layer, the first root bone position that satisfies the physical constraint and the second root bone position that satisfies the moving intention of the three-dimensional character are calculated.

[0136] Coordination optimization layer: responsible for coordinating the output of the previous two layers. The cerebellum in the biological body is responsible for motor coordination and balance. This layer reconciles the "brain's intention (where to go)" and the "spinal cord's reflex (where to actually go)", through dynamic weight distribution and time smoothing processing, to ensure that the motion of the three-dimensional character is natural and smooth, without abrupt switching or jitter. This layer outputs the non-slip animation pose of the three-dimensional character.

[0137] In summary, in the first aspect, the present solution uses spherical geometric constraint principles to solve the problem of foot sliding caused by the mismatch between the movement speed of a three-dimensional character and animation; in the second aspect, the present solution automatically calculates the step length according to the leg length to solve the animation reuse problem of three-dimensional characters of different body types and reduce animation production costs; in the third aspect, the present solution simulates the biological movement law to improve the smoothness of animation.

[0138] Corresponding to the animation gait control method provided by the embodiment of the present application, referring to Figure 5 The embodiment of the present application also provides a structural diagram of an animation gait control system, which comprises a first calculation unit 501, a second calculation unit 502, a weighting unit 503, and a control unit 504.

[0139] The first calculation unit 501 is used to calculate the predicted step length and the theoretical step frequency of a three-dimensional character through the movement speed of the three-dimensional character.

[0140] The second calculation unit 502 is used to calculate the first root bone position that satisfies the physical constraint and the second root bone position that satisfies the movement intention of the three-dimensional character.

[0141] The weighting unit 503 is used to perform weighted fusion on the first root bone position and the second root bone position to obtain the final root bone position.

[0142] The control unit 504 is used to control the three-dimensional character to move according to the predicted step length and the theoretical step frequency, and adjust the root bone of the three-dimensional character to the final root bone position.

[0143] In the embodiment of the present application, the predicted step length and the theoretical step frequency are calculated through the movement speed, and the final root bone position is determined by comprehensively considering the physical constraint and the movement intention. The three-dimensional character is controlled to move according to the predicted step length and the theoretical step frequency, and the root bone of the three-dimensional character is adjusted to the final root bone position, so as to avoid the situation of sliding when the three-dimensional character moves, and ensure the realism of the virtual environment.

[0144] Preferably, in combination Figure 5 with the content shown in the figure, the first calculation unit 501 comprises a first calculation module, a second calculation module, and a third calculation module, and the execution principles of each module are as follows:

[0145] The first calculation module is configured to calculate a double-leg included angle of the three-dimensional role according to a moving speed of the three-dimensional role.

[0146] The second calculation module is configured to calculate a predicted stride of the three-dimensional role according to the double-leg included angle of the three-dimensional role and a leg length of the three-dimensional role.

[0147] The third calculation module is configured to calculate a theoretical stride frequency of the three-dimensional role according to the moving speed of the three-dimensional role and the predicted stride of the three-dimensional role.

[0148] In specific implementation, the third calculation module is specifically configured to: calculate a first stride frequency of the three-dimensional role according to the moving speed of the three-dimensional role and the predicted stride of the three-dimensional role; and limit the first stride frequency by an upper limit value of stride frequency and a lower limit value of stride frequency to obtain the theoretical stride frequency of the three-dimensional role.

[0149] Preferably, in combination with the content shown in the figure, the weighting unit 503 comprises a calculation module, an assignment module and a weighting module, and the execution principles of the respective modules are as follows: Figure 5 The calculation module is configured to calculate a target index, and the target index is used to represent whether the foot of the three-dimensional role is stably in contact with the ground.

[0150] The assignment module is configured to dynamically assign a first weight of the first root bone position and a second weight of the second root bone position according to the target index.

[0151] The weighting module is configured to perform weighted fusion on the first root bone position and the second root bone position according to the first weight and the second weight to obtain the final root bone position.

[0152] Preferably, in combination with the content shown in the figure, the animation gait control system further comprises:

[0153] Figure 5 The first processing unit is configured to perform time-domain smoothing processing on the first root bone position and the second root bone position.

[0154] The second processing unit is configured to perform time-domain smoothing processing on the predicted stride and the theoretical stride frequency.

[0155] Preferably, the embodiment of the present application further provides a computer device, comprising a processor and a memory, the processor and the memory are connected through a bus; wherein the processor is used to call and execute a program stored in the memory; the memory is used to store the program, and the program is used to realize the animation gait control method provided by the above-mentioned method embodiment.

[0156] Preferably, the embodiment of the present application further provides a storage medium, and the storage medium stores computer executable instructions, and the computer executable instructions are used to execute the animation gait control method provided by the above-mentioned method embodiment.

[0157] Preferably, the embodiment of the present application further provides a storage medium, and the storage medium stores computer executable instructions, and the computer executable instructions are used to execute the animation gait control method provided by the above-mentioned method embodiment.

[0158] ​In summary, the embodiments of the present invention provide an animation gait control method, system, electronic device, and storage medium. By calculating the predicted stride length and theoretical step frequency using movement speed, and comprehensively considering physical constraints and movement intentions, the final root bone position is determined. The 3D character is controlled to move according to the predicted stride length and theoretical step frequency, and the root bone of the 3D character is adjusted to the final root bone position, thereby avoiding slippage during 3D character movement and ensuring the realism of the virtual environment.

[0159] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0160] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0161] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An animation gait control method, characterized in that, The method includes: The predicted stride and theoretical step frequency of the three-dimensional character are calculated based on its movement speed. Calculate the position of the first bone that satisfies the physical constraints, and calculate the position of the second bone that satisfies the movement intention of the three-dimensional character; The positions of the first and second bones are weighted and fused to obtain the final root bone position; The three-dimensional character is controlled to move according to the predicted stride and the theoretical stride frequency, and the root skeleton of the three-dimensional character is adjusted to the final root skeleton position.

2. The method according to claim 1, characterized in that, Calculate the predicted stride and theoretical step frequency of the 3D character based on its movement speed, including: Calculate the angle between the legs of the three-dimensional character based on its movement speed; The predicted stride of the 3D character is calculated using the angle between its two legs and its leg length. Based on the movement speed of the 3D character and the predicted stride length, the theoretical step frequency of the 3D character is calculated.

3. The method according to claim 2, characterized in that, Based on the movement speed of the 3D character and the predicted stride length, the theoretical step frequency of the 3D character is calculated, including: Based on the movement speed of the 3D character and the predicted stride, calculate the first step frequency of the 3D character; The first step frequency is limited by an upper limit and a lower limit to obtain the theoretical step frequency of the three-dimensional character.

4. The method according to claim 1, characterized in that, The first and second root bone positions are weighted and fused to obtain the final root bone position, including: Calculate a target index, which is used to characterize whether the feet of the three-dimensional character are firmly in contact with the ground; The first weight of the first bone position and the second weight of the second bone position are dynamically allocated through the target index; Based on the first weight and the second weight, the first root bone position and the second root bone position are weighted and fused to obtain the final root bone position.

5. The method according to claim 1, characterized in that, Before performing weighted fusion of the first and second bone positions, the process also includes: The positions of the first and second bones are smoothed in the time domain.

6. The method according to claim 1, characterized in that, Before controlling the 3D character to move according to the predicted stride and the theoretical step frequency, the method further includes: The predicted stride length and the theoretical stride frequency are smoothed in the time domain.

7. An animation gait control system, characterized in that, The system includes: The first calculation unit is used to calculate the predicted stride and theoretical step frequency of the three-dimensional character based on its movement speed. The second calculation unit is used to calculate the position of the first bone that satisfies the physical constraints, and to calculate the position of the second bone that satisfies the movement intention of the three-dimensional character. The weighting unit is used to perform weighted fusion of the first root bone position and the second root bone position to obtain the final root bone position; A control unit is used to control the 3D character to move according to the predicted stride and the theoretical stride frequency, and to adjust the root skeleton of the 3D character to the final root skeleton position.

8. The system according to claim 7, characterized in that, The first computing unit includes: The first calculation module is used to calculate the angle between the legs of the three-dimensional character based on the character's movement speed. The second calculation module is used to calculate the predicted stride of the three-dimensional character using the angle between its two legs and its leg length. The third calculation module is used to calculate the theoretical step frequency of the three-dimensional character based on the character's movement speed and the predicted stride.

9. A computer device, characterized in that, include: A processor and a memory are connected via a bus; wherein the processor is used to call and execute a program stored in the memory; The memory is used to store a program for implementing the animation gait control method as described in any one of claims 1-6.

10. A storage medium, characterized in that, The storage medium stores computer-executable instructions for performing the animation gait control method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Virtual character walking animation generation method and device, equipment and storage medium

    CN114283229A

  • Sectional driving method and device for human body model and storage medium

    CN114758039A

  • Animation processing method and device, equipment, storage medium and program product

    CN115797513A

  • Quadruped robot action design and complex behavior generation method and system

    CN118114709A

  • Bone animation data optimization method and related device

    CN118552675A