A bone dynamic deformation method, storage medium and electronic device
By acquiring the root bone motion data of the 3D skeleton-bound character, detecting acceleration changes, filtering bones to be deformed, and generating deformation parameters, the problem of insufficient deformation effects in existing skeletal animations is solved, and the naturalness and realism of skeletal animation deformations are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
- Filing Date
- 2026-06-15
- Publication Date
- 2026-07-14
AI Technical Summary
Existing 3D skeletal animation technology has shortcomings in deformation triggering mechanisms, layered processing logic, physical law adaptation, and automation and controllability, resulting in insufficient naturalness and realism in skeletal animation deformation effects.
By acquiring the root bone motion data of the 3D skeleton-bound character, detecting acceleration changes, filtering out the bones to be deformed, and using acceleration changes and preset parameters to generate deformation parameters, deformation superposition processing is performed to ensure constant volume and controlled deformation amplitude, generating target animation data with deformation effects.
It improves the naturalness and realism of skeletal animation deformation effects by precisely triggering deformation conditions and physical constraints, thereby enhancing the naturalness and realism of deformation.
Smart Images

Figure CN122391436A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital animation technology, and in particular to a method for dynamic bone deformation, a storage medium, and an electronic device. Background Technology
[0002] Currently, procedural 3D skeletal animation technology focuses on two main aspects. First, it emphasizes physical simulation and real-time calculation, resulting in a relatively crude deformation triggering mechanism that lacks prioritization based on bone quality. Second, it focuses on automated bone rigging and virtual human motion synthesis, which, while effectively improving production efficiency, does not address the procedural control of bone scaling and deformation or the deep adaptation to physical laws. It is evident that existing technologies generally suffer from problems such as a single triggering basis, lack of layered deformation processing, separation of deformation and elasticity concepts, insufficient physical adaptation, and difficulty in balancing automation and controllability. These issues hinder the achievement of precise and efficient bone scaling and deformation, reducing the naturalness and realism of skeletal animation deformation effects.
[0003] Therefore, how to improve the naturalness and realism of skeletal animation deformation effects has become a key technical problem that needs to be solved by those skilled in the art. Summary of the Invention
[0004] In view of the above problems, the present invention provides a method, storage medium, and electronic device for dynamic bone deformation that overcomes or at least partially solves the above problems. The technical solution is as follows:
[0005] A method for dynamic bone deformation, comprising:
[0006] Acquire basic animation data, wherein the basic animation data includes the root bone motion data of the 3D skeleton-bound character in each frame;
[0007] Using the root skeleton motion data, the acceleration change information of the three-dimensional skeleton-bound character is detected;
[0008] Determine whether the acceleration change information meets the preset bone deformation triggering condition. If so, select at least one bone to be deformed from all the bones of the three-dimensional skeleton-bound character.
[0009] Using the acceleration change information and preset basic skeletal parameters, the deformation parameters of each bone to be deformed are obtained, wherein the deformation parameters are used to maintain a constant volume and control the deformation amplitude during bone deformation.
[0010] Based on the deformation parameters, the corresponding bones to be deformed in the basic animation data are subjected to deformation overlay processing to generate target animation data with deformation effects.
[0011] Optionally, the step of using the root skeleton motion data to detect the acceleration change information of the 3D skeleton-bound character includes:
[0012] Extract the root bone acceleration data of the 3D skeleton-bound character in the current frame, the previous frame, and the two frames before the basic animation data;
[0013] Obtain the current frame smooth acceleration and the previous frame smooth acceleration of the 3D skeleton-bound character in the basic animation data;
[0014] The acceleration change vector is obtained by using the smoothed acceleration of the current frame and the smoothed acceleration of the previous frame;
[0015] Based on the acceleration change vector, the acceleration change rate is obtained;
[0016] Determine the directional angle between the smooth acceleration of the current frame and the smooth acceleration of the previous frame.
[0017] Optionally, the step of selecting at least one bone to be deformed from all the bones of the 3D skeleton-bound character includes:
[0018] Traverse the bone hierarchy of the three-dimensional skeleton-bound character and identify the end bones;
[0019] Calculate the angle between the extension direction vector of each bone of the three-dimensional skeleton-bound character and the acceleration change vector in the acceleration change information;
[0020] From the end bones, select the bones whose vector angle is less than or equal to a preset direction consistency angle threshold as candidate bones;
[0021] The priority score of each candidate bone is obtained based on the layer depth, the vector angle, and the bone quality of each candidate bone.
[0022] Candidate bones whose priority scores are greater than or equal to a preset score threshold are selected as the bones to be deformed.
[0023] Optionally, the deformation parameters include a volume retention constraint relationship between the length direction and the radius direction, and the process of obtaining the volume retention constraint relationship includes:
[0024] The basic deformation amplitude is obtained by using the acceleration change rate, the bone mass, elastic coefficient, and layer depth of the bone to be deformed in the acceleration change information.
[0025] Determine the deformation direction vector, wherein the deformation direction vector is opposite in direction to the acceleration change vector in the acceleration change information;
[0026] The length direction reference scaling ratio is obtained by using the basic deformation amplitude, the deformation direction vector, and the extension direction vector of the bone to be deformed;
[0027] Based on the physical constraints that keep the bone volume constant, a radius-direction reference scaling ratio corresponding to the length-direction reference scaling ratio is determined to establish the volume-preserving constraint relationship.
[0028] Optionally, the deformation parameters further include a deformation amplitude curve that varies with time, and the process of obtaining the deformation amplitude curve includes:
[0029] The natural angular frequency is obtained by using the elastic coefficient and mass of the skeleton to be deformed;
[0030] The damped vibration angular frequency is obtained by using the natural angular frequency and the damping ratio of the skeleton to be deformed;
[0031] Using the basic deformation amplitude, the damping ratio, the natural angular frequency, and the damped vibration angular frequency, a deformation amplitude curve that varies with time is generated.
[0032] Optionally, the step of performing deformation overlay processing on the corresponding skeleton to be deformed in the basic animation data based on the deformation parameters to generate target animation data with deformation effects includes:
[0033] Utilize the time information of the current frame relative to the deformation trigger moment in the basic animation data;
[0034] Using the time information and the deformation amplitude curve, determine the length direction scaling factor of the skeleton to be deformed in the current frame;
[0035] Using the length scaling factor and the volume preservation constraint, the radius scaling factor of the skeleton to be deformed in the current frame is determined;
[0036] The length scaling factor and the radius scaling factor are combined with the original scaling data of the deformable bone in the basic animation data to generate the bone scaling data of the three-dimensional skeleton bound to the character in the current frame of the target animation data.
[0037] Optionally, determining the length scaling factor of the skeleton to be deformed in the current frame using the time information and the deformation amplitude curve includes:
[0038] Using the time information and the deformation amplitude curve, the current deformation amplitude of the skeleton to be deformed in the current frame is obtained;
[0039] Using the current deformation amplitude, the deformation direction vector, and the extension direction vector of the skeleton to be deformed, the length direction scaling factor of the skeleton to be deformed in the current frame is obtained, wherein the length direction scaling factor is constrained by a preset maximum deformation amplitude.
[0040] Optionally, before determining whether the acceleration change information meets the preset skeletal deformation triggering condition, the method further includes:
[0041] Based on the character type of the 3D skeleton-bound character, select the corresponding preset skeleton basic parameters.
[0042] A computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the aforementioned skeletal dynamic deformation method.
[0043] An electronic device includes at least one processor, at least one memory connected to the processor, and a bus; wherein the processor and the memory communicate with each other via the bus; the processor is used to call program instructions in the memory to execute the skeletal dynamic deformation method.
[0044] By employing the above technical solution, this invention provides a method, storage medium, and electronic device for dynamic skeletal deformation. The method acquires basic animation data, including root bone motion data of a 3D skeletal bound character in each frame. Using the root bone motion data, it detects acceleration changes in the 3D skeletal bound character. It determines whether the acceleration changes meet preset skeletal deformation trigger conditions; if so, it selects at least one bone to be deformed from all bones of the 3D skeletal bound character. Using the acceleration changes and preset basic skeletal parameters, it obtains deformation parameters for each bone to be deformed, whereby the deformation parameters are used to maintain a constant volume and control the deformation amplitude during bone deformation. Based on the deformation parameters, it performs deformation overlay processing on the corresponding bones to be deformed in the basic animation data to generate target animation data with deformation effects. This invention, by acquiring the root bone motion data of a 3D skeletal bound character, accurately triggering deformation conditions based on acceleration changes, selecting bones to be deformed, and maintaining a constant volume and controlling the deformation amplitude during bone deformation, achieves programmed deformation overlay processing of bones, thereby effectively improving the naturalness and realism of skeletal animation deformation effects.
[0045] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0046] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0047] Figure 1 A flowchart illustrating one embodiment of the bone dynamic deformation method provided in this invention is shown.
[0048] Figure 2 The diagram shows a specific implementation of step S110 in the bone dynamic deformation method provided by the present invention.
[0049] Figure 3 The diagram shows a specific implementation of step S130 in the bone dynamic deformation method provided by the present invention.
[0050] Figure 4 A flowchart illustrating the process of obtaining the volume-preserving constraint relationship provided in an embodiment of the present invention is shown.
[0051] Figure 5 A flowchart illustrating the process of obtaining the deformation amplitude curve provided in an embodiment of the present invention is shown.
[0052] Figure 6 The diagram shows a specific implementation of step S150 in the bone dynamic deformation method provided by the present invention.
[0053] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present invention is shown. Detailed Implementation
[0054] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
[0055] In recent years, three-dimensional (3D) skeletal animation technology has played a crucial role in the representation of virtual characters, especially in achieving naturalness and physical realism in character movement. Current technologies primarily focus on combining physical simulation with real-time computation techniques to enhance the dynamic responsiveness and realism of animation. However, these technologies still have the following shortcomings in deformation triggering mechanisms and skeletal layering processing logic:
[0056] 1. Existing 3D skeleton scaling deformation triggers rely on a single trigger, often depending on velocity, position, or a single acceleration component, without simultaneously considering changes in the magnitude and direction of acceleration. This makes deformation prone to false triggers or missed triggers, and the trigger timing is difficult to strictly correspond to the real physical characteristics of the character's movement.
[0057] 2. The skeletal deformation lacks a layered processing logic. It usually adopts the method of uniform deformation of the entire skeleton or random deformation of local parts, which fails to reflect the physical law that the end bones are more easily deformed due to weaker constraints. Therefore, the deformation effect appears awkward and does not conform to common sense in physics.
[0058] 3. Current technology separates the definitions of deformation and elasticity, resulting in a redundant parameter system, which increases the complexity of the technical logic and reduces the efficiency and consistency of the implementation of the solution.
[0059] 4. The physical laws and the adaptation to bone deformation are not clear enough. The design of spring damping and volume retention is not quantitatively derived in combination with individual attributes such as bone mass and elastic coefficient. The bouncing process lacks a clear end judgment standard, which can easily cause bone scaling volume distortion and stiff and unnatural deformation and bouncing performance.
[0060] 5. Existing procedural deformation schemes are difficult to balance automation and controllability of effects. Schemes with a high degree of automation are prone to excessive deformation distortion and uncontrollable effects, while schemes with controllable effects require a lot of manual frame-by-frame adjustment of bone parameters, resulting in low production efficiency and high cost. Furthermore, there is no unified character parameter calibration system, which leads to poor adaptability of parameter adjustment among various character types such as realistic, cartoon, and mechanical.
[0061] In view of the above-mentioned shortcomings of the existing technology, there is an urgent need for a unified skeletal scaling and deformation method based on dual determination of acceleration magnitude and direction change, combined with the principle of priority processing of skeletal hierarchy and spring damping law, so as to solve the deficiencies of the existing technology in terms of deformation trigger accuracy, deformation hierarchy rationality, physical law matching and multi-character adaptability.
[0062] Based on this, the present invention provides a method for dynamic bone deformation. By acquiring the motion data of the root bones of a three-dimensional skeleton-bound character for each frame, detecting their acceleration changes, and determining whether the preset bone deformation triggering conditions are met, if so, the bones to be deformed are selected from all the bones. Based on the acceleration changes and the basic bone parameters, deformation parameters that maintain constant volume and control the deformation amplitude during bone deformation are obtained. The deformation parameters are used to perform deformation superposition processing on the bones in the basic animation data to generate target animation data with deformation effects. Thus, by accurately triggering the deformation conditions, combined with physical constraints and dynamic amplitude changes, procedural bone deformation is achieved, significantly improving the naturalness and realism of animation deformation.
[0063] like Figure 1The diagram shows a flowchart of one embodiment of the skeletal dynamic deformation method provided by this invention. The method may include:
[0064] S100. Obtain basic animation data, which includes the root bone motion data of the 3D skeleton-bound character in each frame.
[0065] Among them, basic animation data refers to 3D skeletal animation data that has completed keyframe recording, which includes the skeletal transformation information of the character in each frame of the time sequence, including at least the motion data of the root bone and the original scaling data of all bones.
[0066] Among them, the 3D skeletonized character refers to a 3D character model that has completed skeleton binding and formed a clear hierarchical relationship. The hierarchical relationship is a tree structure of "root bone - child bones". Each bone is associated with bone attribute parameters, which include: the parent-child hierarchical relationship of the bone, the end bone identifier, the original length, the elastic coefficient, the damping coefficient, and the bone mass.
[0067] Among them, root bone motion data refers to motion state data related to the root bone extracted from the basic animation data, including the root bone's position, velocity, acceleration in each frame, and the time interval between adjacent frames.
[0068] Specifically, embodiments of the present invention can acquire basic animation data of a 3D skeletonized character with completed keyframe recording. This basic animation data includes bone transformation information for each frame in the time series. Motion data of the root bone in each frame is extracted from this basic animation data, including the root bone's position, velocity, and acceleration. Acceleration data for the current frame, the previous frame, and the two frames prior are cached, while the time interval between adjacent frames is recorded. Furthermore, pre-configured parameters such as the character's bone hierarchy, the original length of each bone, elastic coefficient, damping coefficient, bone mass, and end-effector identifier can also be acquired.
[0069] S110. Using root skeleton motion data, detect the acceleration changes of the 3D skeleton-bound character.
[0070] The acceleration change information refers to the information obtained by processing the acceleration data in the root skeleton motion data to describe the acceleration change state. It can include: acceleration change vector, acceleration change rate, and acceleration direction change angle. The acceleration change vector is calculated from the difference between the smooth acceleration of the current frame and the smooth acceleration of the previous frame. The acceleration change rate is the ratio of the magnitude of the acceleration change vector to the inter-frame time interval. The acceleration direction change angle is the angle between the normalized vectors of the smooth acceleration of the current frame and the smooth acceleration of the previous frame.
[0071] Specifically, in this embodiment of the invention, the root skeleton acceleration data of multiple consecutive frames can be smoothed and filtered, the acceleration change vector can be calculated based on the smoothed acceleration data of adjacent frames, the acceleration change rate can be determined based on the magnitude of the change vector, and the direction angle can be determined based on the direction change of the acceleration of adjacent frames after smoothing.
[0072] S120. Determine whether the acceleration change information meets the preset skeletal deformation triggering conditions. If so, proceed to step S130.
[0073] The preset skeletal deformation triggering condition refers to a pre-set criterion used to determine whether skeletal deformation needs to be triggered. Optionally, the preset skeletal deformation triggering condition provided in this embodiment of the invention may include: the rate of change of acceleration is greater than a preset rate of change threshold and the directional angle is greater than a preset directional change threshold.
[0074] Specifically, in this embodiment of the invention, a pre-configured rate of change threshold and direction change threshold (e.g., 30°) can be obtained. It is determined whether the calculated rate of change of acceleration is greater than the rate of change threshold and whether the angle of change of acceleration direction is greater than the direction change threshold. Only when both conditions are met simultaneously is it determined that the preset skeletal deformation triggering condition is satisfied, and subsequent deformation processing is performed; otherwise, deformation is not triggered, the current frame's skeleton maintains its original scaling ratio, and processing continues into the next frame.
[0075] S130. Among all the bones of the 3D skeleton-bound character, select at least one bone to be deformed.
[0076] Among them, the bones to be deformed refer to the bones selected from all the bones of the 3D skeleton-bound character that need to be subjected to scaling deformation effects. The selection of bones to be deformed can be based on the bone hierarchy depth, the consistency between the bone extension direction and the acceleration change direction, and the bone quality parameters, with priority given to end bones.
[0077] Specifically, in this embodiment of the invention, bones can be prioritized based on their layer depth, the consistency between the direction of bone extension and the direction of acceleration change, and bone quality parameters, and bones that meet the preset priority conditions can be selected as the bones to be deformed.
[0078] S140. Using acceleration change information and preset basic skeletal parameters, obtain the deformation parameters of each bone to be deformed. The deformation parameters are used to maintain constant volume and control the deformation amplitude during bone deformation.
[0079] The preset skeletal base parameters refer to a set of basic data pre-configured based on the character type, skeletal structure, and motion characteristics before deformation processing of the 3D skeleton-bound character. This data is used to control deformation behavior and serves as a fixed input for the entire skeletal deformation process, ensuring that the deformation effect conforms to the character's style and is physically reasonable. The preset skeletal base parameters may include bone mass, preset maximum deformation amplitude, damping ratio, elastic coefficient, and preset rate of change threshold.
[0080] Among them, deformation parameters refer to the set of parameters used to control the scaling and deformation effects of a single bone.
[0081] Specifically, in this embodiment of the invention, for each skeleton to be deformed, the basic deformation amplitude is first calculated based on fundamental skeleton parameters such as the rate of change of acceleration, skeleton mass, elastic coefficient, and end effector weight. Then, the inverse direction of the acceleration change vector is normalized to obtain the deformation direction vector. Next, a volume maintenance constraint relationship is established between the length and radius directions: the scaling ratio in the radius direction is equal to the reciprocal of the square root of the scaling ratio in the length direction. Finally, with the deformation trigger moment as the zero point of time, the natural angular frequency and damping ratio are calculated based on the skeleton's elastic coefficient, mass parameters, and damping coefficient, generating a deformation amplitude curve that decays exponentially with time and exhibits cosine oscillation, where the initial deformation amplitude is equal to the basic deformation amplitude.
[0082] S150. Based on the deformation parameters, perform deformation overlay processing on the corresponding bones to be deformed in the basic animation data to generate target animation data with deformation effects.
[0083] The target animation data refers to the complete animation data generated by superimposing the calculated deformation parameters onto the basic animation data, which includes the scaling and deformation effects of the bones. This includes the scaling ratio in the length direction and the scaling ratio in the radius direction of each bone in each frame.
[0084] Specifically, in this embodiment of the invention, the current deformation amplitude can be obtained from the deformation amplitude curve based on the time offset of the current frame relative to the deformation trigger time. Based on the deformation amplitude, the deformation direction vector and the bone extension direction vector, the length direction scaling factor constrained by the maximum deformation amplitude is calculated. The radius direction scaling factor is derived from the length direction scaling factor using the volume preservation constraint relationship. Then, the two scaling factors are combined with the original scaling data in the basic animation to generate the bone scaling data of the current frame.
[0085] This invention provides a method for dynamic skeletal deformation. The method includes: acquiring basic animation data, wherein the basic animation data includes root bone motion data of a 3D skeletal bound character in each frame; using the root bone motion data, detecting acceleration change information of the 3D skeletal bound character; determining whether the acceleration change information meets preset skeletal deformation trigger conditions; if so, selecting at least one bone to be deformed from all bones of the 3D skeletal bound character; using the acceleration change information and preset basic skeletal parameters, obtaining deformation parameters for each bone to be deformed, wherein the deformation parameters are used to maintain a constant volume and control the deformation amplitude during bone deformation; and performing deformation overlay processing on the corresponding bones to be deformed in the basic animation data based on the deformation parameters to generate target animation data with deformation effects. This invention, by acquiring the root bone motion data of a 3D skeletal bound character, accurately triggering deformation conditions based on acceleration change information, selecting bones to be deformed, and combining volume maintenance constraints with a deformation amplitude curve changing over time, achieves procedural deformation overlay processing of bones, thereby effectively improving the naturalness and realism of skeletal animation deformation effects.
[0086] Optional, based on Figure 1 The method shown is as follows: Figure 2 The diagram shows a specific implementation of step S110 in the skeletal dynamic deformation method provided in this invention. Step S110 may specifically include:
[0087] S200: Extract the root bone acceleration data of the 3D skeleton-bound character in the current frame, the previous frame, and the two frames before that from the basic animation data.
[0088] Among them, root bone acceleration data refers to one of the motion state parameters of the root bone of the 3D skeleton bound to the character in each frame, which is extracted from the basic animation data. Specifically, it is the acceleration vector of the root bone in 3D space, which includes components in the three directions of X-axis, Y-axis and Z-axis.
[0089] Specifically, in this embodiment of the invention, the root bone motion trajectory in the basic animation data can be read frame by frame. For the i-th frame currently being processed, the root bone acceleration vectors of the i-th frame, the (i-1)-th frame, and the (i-2)-th frame are extracted respectively. Each acceleration vector contains components in the X, Y, and Z axes. The original acceleration data of these three frames are temporarily stored in a cache for subsequent smoothing and filtering calculations.
[0090] S210: Obtain the current frame smooth acceleration and the previous frame smooth acceleration of the 3D skeleton-bound character in the basic animation data.
[0091] The smooth acceleration of the current frame refers to the acceleration vector obtained after smoothing and filtering the root skeleton acceleration data of the current frame.
[0092] Among them, the smoothed acceleration of the previous frame refers to the acceleration vector obtained by processing the root skeleton acceleration data of the previous frame using the same smoothing filtering method as the current frame.
[0093] Specifically, this embodiment of the invention can employ a three-frame averaging method. The root skeleton acceleration data of the cached current frame, previous frame, and two frames are summed along each axis and then divided by 3 to obtain the smoothed acceleration vector of the current frame. Similarly, the acceleration data of the previous frame, two frames, and three frames are averaged to obtain the smoothed acceleration vector of the previous frame. This smoothing process eliminates noise caused by excessive keyframes or abrupt data changes, improving the accuracy of acceleration change detection.
[0094] S220. Obtain the acceleration change vector by using the smooth acceleration of the current frame and the smooth acceleration of the previous frame.
[0095] The acceleration change vector refers to the vector difference between the smooth acceleration of the current frame and the smooth acceleration of the previous frame. This vector contains information about both the magnitude and direction of the acceleration change.
[0096] Specifically, in this embodiment of the invention, the smooth acceleration of the current frame can be vector subtracted from the smooth acceleration of the previous frame. That is, the X, Y, and Z components of the smooth acceleration of the current frame are subtracted from the corresponding components of the smooth acceleration of the previous frame to obtain a new three-dimensional vector. This vector is the acceleration change vector, which simultaneously contains the magnitude and direction change information of the root skeleton acceleration between frames.
[0097] S230. Obtain the rate of change of acceleration based on the acceleration change vector.
[0098] Among them, the rate of change of acceleration refers to a quantitative indicator that describes the degree of drastic change in the magnitude of acceleration of the root skeleton. The larger the value, the more drastic the change in acceleration.
[0099] Specifically, in this embodiment of the invention, the magnitude of the acceleration change vector can be calculated first. That is, summing the squares of each component and then taking the square root: ,in, for The X, Y, and Z axis components in 3D space. Then, the inter-frame time interval corresponding to the frame rate of the basic animation data is obtained. (e.g., at 60 frames per second) =1 / 60 of a second). Divide the module length by The quotient obtained is the rate of change of acceleration. : This value quantifies the severity of changes in the magnitude of root bone acceleration and is one of the key indicators for subsequent determination of whether deformation has been triggered.
[0100] S240. Determine the directional angle between the smooth acceleration of the current frame and the smooth acceleration of the previous frame.
[0101] The directional angle refers to the spatial angle between the current frame's smooth acceleration vector and the previous frame's smooth acceleration vector after they have been normalized.
[0102] Specifically, in this embodiment of the invention, the smoothed acceleration vectors of the current frame and the previous frame are normalized separately, that is, each vector is divided by its own magnitude to obtain two unit vectors. Then, the dot product of these two unit vectors is calculated, and the angle between the two vectors is obtained by using the inverse cosine function. This angle is the direction angle. This angle is used to measure the magnitude of the change in the acceleration direction and is compared with a preset angle threshold to assist in deformation trigger judgment.
[0103] The embodiments of the present invention obtain smooth acceleration by using a three-frame averaging method and then calculate the acceleration change vector and the angle between its magnitude and direction. This can effectively filter out key frame anomalies and data mutation interference, and achieve accurate and stable detection of acceleration change rate and direction change, thereby providing a reliable dual basis for deformation triggering.
[0104] Optional, based on Figure 2 The method shown is as follows: Figure 3 The diagram shows a specific implementation of step S130 in the skeletal dynamic deformation method provided in this invention. Step S130 may specifically include:
[0105] S300: Traverse the bone hierarchy of the 3D skeleton-bound character and identify the end bones.
[0106] In this context, the bone hierarchy refers to the depth value passed down from the root bone according to the parent-child relationship. The root bone itself has a hierarchy depth of 0, the child bones directly connected to the root bone have a hierarchy depth of 1, and so on, with the hierarchy depth increasing by 1 for each lower level of child bones. This hierarchy is used to measure the position of a bone in the bone tree; the larger the hierarchy, the further away from the root bone the bone is, and the closer it is to the end of the tree.
[0107] Terminal bones refer to bones located at the end of the skeletal chain, far from the root bones, and without lower-level sub-bones or containing only tiny appendage sub-bones. The specific criterion is: hierarchical depth. Furthermore, there are no sub-bones, or their sub-bones are only used for decoration and do not affect the main chain movement. For example: fingertips, toetips, ear tips, hair ends, palms, soles, etc. The terminal bones are the main targets of the deformation effect.
[0108] Specifically, in this embodiment of the invention, the entire bone tree can be recursively traversed starting from the root bone. The layer depth of each bone is recorded (root bone depth is 0, child bone depth is parent bone depth plus 1), and each bone is checked for lower-level child bones. Bones with a layer depth greater than or equal to 3 and no child bones or only minor subordinate child bones are marked as terminal bones, such as the fingertips, toes, ear tips, and hair ends of a 3D character bound to the bone.
[0109] S310. Calculate the angle between the extension direction vector of each bone of the 3D skeleton-bound character and the acceleration change vector in the acceleration change information.
[0110] The extended direction vector refers to the three-dimensional direction vector pointing from the parent node position of the bone to the position of the bone itself, used to describe the orientation of the bone in three-dimensional space. The extended direction vector can be calculated from the joint position in the bone binding data, and after normalization, it can be used as a unit direction vector in subsequent angle calculations to measure the spatial relationship between the bone orientation and the direction of acceleration change.
[0111] The vector angle refers to the spatial angle between the bone's extension direction vector and the acceleration change direction vector, with a value ranging from 0° to 180°. This vector angle is used to determine whether the bone's extension direction is consistent with the acceleration change direction. The smaller the angle, the higher the directional consistency, and the more likely the bone is to produce a significant deformation effect; bones with an angle greater than 90° will be excluded from the candidate bones.
[0112] Specifically, in this embodiment of the invention, for each bone, the extension direction vector of the bone is calculated from its parent joint position to its own joint position and normalized to a unit vector. Simultaneously, the acceleration change vector is also normalized. The dot product of the two unit vectors is calculated, and then the spatial angle between them is obtained using the inverse cosine function. This angle ranges from 0° to 180° and is used to measure the consistency between the bone orientation and the acceleration change direction.
[0113] S320. From the end bones, select bones whose vector angle is less than or equal to the preset direction consistency angle threshold as candidate bones.
[0114] Specifically, in this embodiment of the invention, all identified end bones can be traversed, and the calculated vector angle of each end bone can be compared with a preset direction consistency angle threshold (e.g., 90 degrees). For example, only end bones with vector angles less than or equal to the preset direction consistency angle threshold are retained as candidate bones, because an angle exceeding the preset direction consistency angle threshold means that the bone's extension direction is opposite to or perpendicular to the direction of acceleration change, which is not suitable for producing deformation effects that conform to the expected physical laws.
[0115] S330. Based on the hierarchical depth, vector angle, and bone quality of each candidate bone, obtain the priority score for each candidate bone.
[0116] Among them, bone mass refers to one of the pre-configured bone attribute parameters, which is used to characterize the inertia or resistance to deformation of the bone during the deformation process. The smaller the bone mass value, the greater the deformation amplitude under the same rate of change of acceleration; the mass of the terminal bones is generally lower than that of the near-root bones to simulate the physical characteristics of lightness and easy deformation.
[0117] The priority score refers to the comprehensive score used to quantify the priority of each candidate bone for deformation processing.
[0118] Specifically, embodiments of the present invention can first be based on their hierarchical depth. Calculate terminal weights , Then, based on the angle between the vectors Calculate the directional consistency weight , Then obtain the pre-configured bone quality. Finally, calculate the priority score. The priority score comprehensively reflects the contribution of the end extent, orientation matching degree, and mass of the bone to the deformation amplitude. The higher the score, the more significant the deformation of the bone should be.
[0119] S340. Select candidate bones with priority scores greater than or equal to a preset score threshold as the bones to be deformed.
[0120] The preset score threshold refers to a pre-set critical priority score value used to filter bones to be deformed. Only candidate bones with a priority score greater than or equal to the preset score threshold will be ultimately determined as bones to be deformed. Bones with a priority score lower than the threshold will not participate in subsequent deformation parameter calculations to avoid producing barely perceptible or undesirable deformation effects. Optionally, the preset score threshold provided in this embodiment of the invention can be 0.4.
[0121] Specifically, in this embodiment of the invention, the priority score of each candidate bone can be compared with a preset score threshold. The top 10 candidate bones with priority scores greater than or equal to the preset score threshold are selected as the final bones to be deformed and enter the subsequent deformation parameter calculation stage; for bones with priority scores lower than the threshold, their deformation processing is skipped, so as to control the number of deformable bones and ensure the effectiveness of the deformation effect.
[0122] This invention, by combining a priority scoring mechanism that prioritizes end bones, determines directional consistency, and weights bone quality, can accurately select end bones that match the direction of acceleration change and are physically easy to deform, thereby avoiding invalid deformation calculations and improving the visual rationality and physical naturalness of the deformation effect.
[0123] Optionally, the deformation parameters provided in the embodiments of the present invention may include the volume retention constraint relationship between the length direction and the radius direction.
[0124] The length direction refers to the axial direction along the bone's extension direction (i.e., the direction from the bone's parent node to its child node). The scaling changes of the bone in this direction are manifested as stretching or compression, corresponding to the scaling ratio in the length direction.
[0125] The radial direction refers to the radial direction perpendicular to the extension direction of the bone. The scaling change of the bone in this direction is manifested as thinning or thickening, corresponding to the scaling ratio in the radial direction.
[0126] The volume preservation constraint refers to the mathematical constraint between the scaling ratio in the length direction and the scaling ratio in the radius direction when the skeleton deforms. This constraint ensures that the volume of the skeleton remains unchanged before and after deformation, i.e., the scaling ratio in the radius direction remains constant. Equal to the scaling ratio in the length direction The reciprocal of the square root ( The volume conservation constraint is continuously applied throughout the deformation process, ensuring that the deformation of each frame of the skeleton conforms to the physical law of volume conservation. It is the core link connecting the deformation in the length direction and the deformation in the radius direction.
[0127] Optional, based on Figure 3 The method shown is as follows: Figure 4 The diagram shows a flowchart illustrating the process of obtaining the volume-preserving constraint relationship according to an embodiment of the present invention. This process may include:
[0128] S400: Using the acceleration change rate, bone mass, elastic coefficient, and layer depth of the bone to be deformed from the acceleration change information, the basic deformation amplitude is obtained.
[0129] The elasticity coefficient is one of the pre-configured bone attribute parameters used to control the recovery speed of bone deformation. Its value ranges from 0 to 1. The larger the elasticity coefficient value, the faster the bone recovers to its original state after deformation, and the greater the basic deformation amplitude; the smaller the elasticity coefficient value, the slower the deformation recovery and the smaller the deformation amplitude.
[0130] The basic deformation amplitude refers to the maximum relative deformation ratio that the bone to be deformed should produce along the deformation direction at the moment of deformation triggering, that is, the amplitude value of deformation from the start to the peak moment. The value of the basic deformation amplitude is a dimensionless proportionality coefficient. For example, 0.1 means that the deformation amplitude is 10% of the original bone length, and it will be used as the initial value of the deformation amplitude curve.
[0131] Specifically, embodiments of the present invention can use the rate of change of acceleration. Bone mass of the skeleton to be deformed Elasticity coefficient and terminal weights that are positively correlated with hierarchy depth Enter the formula:
[0132] ,
[0133] Obtain the basic deformation amplitude .
[0134] S410. Determine the deformation direction vector, wherein the deformation direction vector is opposite in direction to the acceleration change vector in the acceleration change information.
[0135] The deformation direction vector refers to the unit vector used to describe the geometric direction of bone deformation. Its direction is opposite to that of the acceleration change vector, that is, the deformation direction vector is equal to the normalized result of the opposite direction of the acceleration change vector.
[0136] Specifically, embodiments of the present invention can calculate the acceleration change vector. Length of the module Then Dividing each component by its magnitude yields a normalized unit vector. Finally, inverting each component of this unit vector gives the deformation direction vector. ,Right now The deformation direction vector is a unit vector that only indicates the direction of deformation (e.g., the orientation of stretching or compression) and does not contain information about the magnitude of deformation.
[0137] S420. Using the basic deformation amplitude, deformation direction vector, and extension direction vector of the skeleton to be deformed, obtain the length direction reference scaling ratio.
[0138] The length-direction baseline scaling ratio refers to the scaling factor in the bone length direction calculated based on the relationship between the basic deformation amplitude, the deformation direction vector, and the bone extension direction vector before applying the maximum deformation amplitude constraint. A value greater than 1 indicates stretching, and a value less than 1 indicates compression.
[0139] Specifically, embodiments of the present invention can obtain the extension direction vector of the bone to be deformed. (From parent joint to child joint), and basic deformation amplitude. and deformation direction vector .calculate and The dot product (i.e., the cosine of the angle between the two vectors), then add 1. Multiplying by this dot product yields the reference scaling factor in the length direction. ,Right now A length-direction baseline scaling factor greater than 1 indicates stretching, less than 1 indicates compression, and a negative dot product produces a compression effect.
[0140] S430. Based on the physical constraints that keep the bone volume unchanged, determine the radius reference scaling ratio corresponding to the length direction reference scaling ratio to establish a volume preservation constraint relationship.
[0141] The physical constraint provided in this embodiment of the invention to keep the volume of the skeleton constant refers to a physical rule based on the principle of volume conservation: the skeleton is approximated as a cylinder, and when the skeleton is stretched or compressed in the length direction, its radius direction must change accordingly in the opposite direction so that the total volume of the skeleton before and after deformation remains unchanged.
[0142] The radius-direction scaling factor refers to the scaling factor in the radius direction directly derived from the length-direction scaling factor, based on the physical constraints of maintaining volume. The radius-direction scaling factor is used to compensate for the impact of changes in length on bone thickness, ensuring that the deformed bone volume matches the original volume and avoiding visual distortion.
[0143] Specifically, in this embodiment of the invention, based on the principle of volume conservation, the skeleton is approximated as a cylinder, and the volume before and after deformation satisfies the following... ,in, and Given the original length and radius, and These represent the length and radius after deformation. Due to the scaling ratio along the length direction... Radial scaling ratio =r / r0, substituting into the volume conservation formula, we get... This means that the volume remains constrained, and the actual radius scaling ratio must be derived from the actual length scaling ratio in each subsequent frame according to this relationship.
[0144] The embodiments of the present invention calculate the basic deformation amplitude based on the rate of change of acceleration and skeletal properties, and derive the scaling ratio in the radius direction based on the physical constraint of volume conservation, thereby establishing a constraint relationship that automatically maintains the constant volume of the skeleton, so that the deformation effect can avoid visual distortion at any scaling degree.
[0145] Optionally, the deformation parameters provided in the embodiments of the present invention may further include a deformation amplitude curve that varies with time.
[0146] Among them, the deformation amplitude curve refers to the function curve describing the change of deformation amplitude with time. With the deformation triggering moment as the zero point of time, the deformation amplitude changes exponentially with time from the initial value and is accompanied by cosine oscillation. This law is defined by the spring damping system determined by the elastic coefficient, mass parameter and damping coefficient of the skeleton.
[0147] Optional, based on Figure 4 The method shown is as follows: Figure 5 The diagram shows a flowchart illustrating the process of obtaining the deformation amplitude curve according to an embodiment of the present invention. This process may include:
[0148] S500: The natural angular frequency is obtained by utilizing the elastic coefficient and mass of the skeleton to be deformed.
[0149] Among them, natural angular frequency This refers to the natural angular frequency of vibration in the undamped state of a spring-damped system, which is determined by the elastic coefficient and mass parameters of the skeleton. The calculation formula is as follows: ,in, The elastic coefficient, This refers to bone mass. The inherent angular frequency reflects the intrinsic rhythm of bone returning to its original state after deformation. A larger value indicates a larger elastic coefficient or a smaller mass, resulting in a faster bouncing rhythm and a shorter oscillation period.
[0150] S510. The damped vibration angular frequency is obtained by using the natural angular frequency and the damping ratio of the skeleton to be deformed.
[0151] The damping ratio is a dimensionless parameter describing the damping strength in a spring-damped system. It is determined by the damping coefficient, the mass of the spring frame, and the elastic modulus. The calculation formula is as follows: ,in, The damping coefficient is... For bone quality, The elastic modulus. The damping ratio. The value range is from 0 to 1. The closer to 0, the weaker the damping, and the slower the oscillation decays after deformation; The closer to 1, the stronger the damping, and the faster the oscillation decays after deformation; when When the value is 1, it is the critical damping, and there is no oscillation; it directly regresses.
[0152] Among them, the damped vibration angular frequency This refers to the actual angular frequency of a vibrating system under damped conditions, determined by both the natural angular frequency and the damping ratio. The calculation formula is as follows: When the damping ratio When the value is less than 1, it exhibits underdamped oscillation, and the damped oscillation angular frequency is... Slightly less than the natural angular frequency ;when When it approaches 1, As the frequency approaches zero, the oscillation gradually disappears. The damped angular frequency is used to control the frequency of the cosine term in the deformation amplitude curve, determining the fluctuation speed of the deformation value around zero during the bounce.
[0153] S520. Using the basic deformation amplitude, damping ratio, natural angular frequency, and damped vibration angular frequency, generate a deformation amplitude curve that varies with time.
[0154] Specifically, in this embodiment of the invention, the deformation triggering moment can be taken as the zero point of time. Take the basic deformation amplitude As the initial value of the curve. Combined with the damping ratio. Natural angular frequency and damped vibration angular frequency Construct a functional relationship between the deformation amplitude and time. ,in, For the initial phase ( ,because hour (Substituting into the calibrable term). The exponential decay term controls the decay rate of the deformation amplitude, and the cosine term simulates the oscillation regression during the bounce process. For any time offset, substituting into this function yields the corresponding current deformation amplitude value. Furthermore, embodiments of this invention allow setting the total deformation duration. ,when When the deformation ends, it can be determined by solving the above equation, or a fixed value can be preset. The calculation formula can be: This is to ensure that the deformation amplitude decreases to less than 1% of the initial value.
[0155] This invention utilizes the elastic coefficient, mass, and damping ratio of the skeleton to calculate the natural angular frequency and damped vibration angular frequency, generating a deformation amplitude curve characterized by exponential decay and cosine oscillation. This allows the entire deformation process to naturally follow the physical laws of spring damping, achieving a programmed elastic effect without the need for manual interpolation.
[0156] Optional, based on Figure 5 The method shown is as follows: Figure 6 The diagram shows a specific implementation of step S150 in the skeletal dynamic deformation method provided in this embodiment of the invention. Step S150 may include:
[0157] S600: Utilize the time information of the current frame relative to the deformation trigger moment in the basic animation data.
[0158] The time information can be the time difference between the animation time of the current frame and the deformation trigger time, i.e., the time offset, for example: taking the deformation trigger time as the zero point of time ( The time offset of the current frame is... It equals the timestamp of the current frame minus the timestamp of the triggering frame. The time offset is used to look up the corresponding deformation amplitude value from the deformation amplitude curve. As time goes on, the offset gradually increases, and the deformation amplitude decreases accordingly.
[0159] Specifically, in this embodiment of the invention, the timestamp of the frame where the deformation triggering time occurs can be obtained, and the timestamp of the frame currently being processed can be obtained. The timestamp of the triggering frame is subtracted from the timestamp of the current frame to obtain the time offset. If the current frame is before the trigger frame, the offset is negative, and deformation has not yet started, so no superposition is performed; if the current frame is after the trigger frame, the offset is positive, and it is used for subsequent deformation amplitude queries.
[0160] S610. Using time information and deformation amplitude curve, determine the length direction scaling factor of the bone to be deformed in the current frame.
[0161] The length scaling factor refers to the final scaling factor of the bone to be deformed in the length direction (bone extension direction) in the current frame. A value greater than 1 indicates stretching, and a value less than 1 indicates compression. After calculation, it must be subject to clipping constrained by a preset maximum deformation amplitude to prevent excessive deformation distortion.
[0162] Specifically, in this embodiment of the invention, the deformation amplitude of the bone to be deformed in the current frame can be determined by time information and deformation amplitude curve, and then the scaling factor of the bone to be deformed in the length direction in the current frame, i.e., the length scaling factor, can be determined based on the deformation amplitude.
[0163] S620. Using the length scaling factor and volume preservation constraint, determine the radius scaling factor of the skeleton to be deformed in the current frame.
[0164] The radius scaling factor refers to the scaling factor of the bone to be deformed in the radial direction perpendicular to the bone's extension direction in the current frame. It is used to compensate for the influence of changes in the length direction on the bone's thickness and ensure that the bone volume remains unchanged before and after deformation.
[0165] Specifically, embodiments of the present invention can maintain the constraint relationship based on volume ( Yes, the final length scaling factor. Calculate the reciprocal of its square root, which is the scaling factor in the radial direction. The radius scaling factor ensures that when the bone shrinks in the length direction, it becomes thicker in the radius direction, or when it stretches in the length direction, it becomes thinner in the radius direction, keeping the bone volume constant before and after deformation.
[0166] S630. Combine the length scaling factor and the radius scaling factor with the original scaling data of the corresponding deformable bone in the basic animation data to generate the bone scaling data of the 3D skeleton bound to the character in the current frame of the target animation data.
[0167] The original scaling data refers to the pre-stored bone scaling information in the basic animation data that has not undergone deformation overlay processing. It includes at least the original scaling ratio of each bone in the length direction and the original scaling ratio in the radius direction. Normally, the original scaling ratio is 1 (i.e., no scaling), but for bones that already have a base scaling (such as some characters that are inherently non-uniformly scaled), their actual values are used.
[0168] Among them, bone scaling data refers to the final scaling information of each bone in the 3D skeletal character in the current frame after deformation overlay processing, including at least the scaling factor in the length direction and the scaling factor in the radius direction. Bone scaling data is a core component of the target animation data, directly driving the bones of the character model to achieve stretching / compression deformation effects while ensuring consistent volume.
[0169] Specifically, this embodiment of the invention can obtain the original length scaling data (which may not be 1 due to previous scaling in the animation) and the original radius scaling data of the bone to be deformed in the current frame from the basic animation data. The length scaling factor is directly overlaid or linearly interpolated onto the original length scaling data, and the radius scaling factor is similarly superimposed onto the original radius scaling data. For non-deformable bones, their original scaling data remains unchanged. The final length and radius scaling data of all bones are written into the target animation data structure in frame order to generate the complete bone scaling data for the current frame. After all frames are processed, the target animation data with deformation effect is obtained.
[0170] Optionally, the formula for linear interpolation superposition provided in the embodiments of the present invention can be: ,in, This represents the scaling factor value of the previous frame (or the previous sampling point); Represents the original calculated value of the scaling factor for the current frame (or current sampling point) (without interpolation); These are interpolation coefficients, with values ranging from [0, 1]. When hour, Completely equal to ;when hour, Completely equal to ; When it is between 0 and 1, Pick and The weighted average value is used to achieve a smooth transition between adjacent frames and avoid abrupt scaling changes.
[0171] This invention achieves dynamic superposition of deformation with natural attenuation, volume conservation, and no distortion by calculating the time offset frame by frame and querying the spring damping deformation curve, combined with direction matching and volume preservation constraints to generate length and radius scaling factors limited by the maximum amplitude.
[0172] Optionally, in the above Figure 6 Based on one or more corresponding embodiments, another optional embodiment provided by the present invention includes step S610, which may specifically include:
[0173] By using time information and deformation amplitude curves, the current deformation amplitude of the skeleton to be deformed in the current frame is obtained.
[0174] The current deformation amplitude refers to the deformation ratio calculated from the deformation amplitude curve at the time offset of the current frame.
[0175] Specifically, embodiments of the present invention can include time offset. Substitute into the deformation amplitude curve function In the process, the deformation amplitude value corresponding to the current frame is calculated. This value reflects the relative deformation intensity (ratio relative to the base deformation amplitude) that the deformable skeleton should produce at the current moment. As the value increases, it gradually decreases until it approaches zero.
[0176] Using the current deformation amplitude, deformation direction vector, and extension direction vector of the bone to be deformed, the length direction scaling factor of the bone to be deformed in the current frame is obtained. The length direction scaling factor is constrained by the preset maximum deformation amplitude.
[0177] The preset maximum deformation amplitude constraint refers to a pre-defined boundary condition used to limit the amplitude of bone deformation. This constraint limits the scaling factor in the length direction to a certain value. Within the range, This represents the maximum deformation range. If the calculated scaling factor in the length direction exceeds this range, it is forcibly truncated to the boundary value to avoid visual distortion caused by excessive stretching or compression of the skeleton.
[0178] Specifically, embodiments of the present invention can obtain the original length-direction scaling ratio of the bone in the basic animation. (usually 1), and the deformation direction vector. and extension direction vector .calculate and The dot product of the original scaling factor and the current deformation amplitude is calculated, and then the product of the original scaling factor multiplied by 1 and the dot product is added to obtain the initial length scaling factor. ,Right now Next, check... Does it exceed the preset maximum deformation range? If it exceeds, then Cut to [ , Within the specified range (upper limit for stretching, lower limit for extrusion), the final length scaling factor is obtained. .
[0179] Optionally, in the above Figure 6 Based on one or more corresponding embodiments, in another optional embodiment provided by the present invention, before step S120, the method further includes:
[0180] Based on the character type of the 3D skeleton-bound character, select the corresponding preset skeleton basic parameters.
[0181] Specifically, in this embodiment of the invention, a set of preset basic skeletal parameters matching the style type of the 3D skeleton-bound character (such as realistic human, cartoon character, mechanical character, and animal character) can be selected from a pre-set parameter template library, so as to quickly adapt to the deformation requirements of different characters without modifying the core algorithm logic.
[0182] Optionally, in embodiments of the present invention, a higher acceleration change rate threshold (0.3–0.5) can be used for realistic human characters to avoid frequent deformation triggered by minute movements. The maximum deformation amplitude is strictly controlled between 5% and 15% of the original bone length to prevent exaggerated deformation. The elastic coefficient is set to 0.7–0.9 to ensure rapid deformation recovery with a moderate amplitude. The damping ratio is set to 0.4–0.6, resulting in a moderately fast decay rate and fewer bounces (usually 1–2 oscillations). The deformation primarily affects the delicate distal bones such as fingers, toes, and ear tips, resulting in a natural and soft overall effect that conforms to the physical characteristics of real human muscles and skin.
[0183] Optionally, in this embodiment of the invention, a lower acceleration change rate threshold (0.2-0.3) can be used for cartoon characters to make deformation easier to trigger and enhance the exaggeration of the movement; the maximum deformation amplitude is extended to 20%-50% of the original bone length, allowing the bones to be significantly stretched or compressed; the elastic coefficient is set to 0.9-1.0, resulting in a large deformation amplitude and extremely fast recovery, with a compact bounce rhythm; the damping ratio is set to 0.1-0.3, resulting in multiple oscillations and rebounds after deformation, presenting a jelly-like elastic effect. All end bones (such as body hair, ears, hands, feet, tail, etc.) can produce significant deformation, with an overall lively and exaggerated style that conforms to the physical expression laws of cartoon animation.
[0184] Optionally, in this embodiment of the invention, a higher acceleration change rate threshold (0.6–0.8) can be used for the mechanical character, triggering deformation only when subjected to drastic acceleration changes (such as sudden start or stop) to simulate the rigidity of metallic materials; the maximum deformation amplitude is limited to 2% of the original bone length to avoid significant expansion and contraction deformation of mechanical parts; the elastic coefficient is set to 0.2–0.4, resulting in slow deformation recovery to simulate metal fatigue or slow hydraulic return; the damping ratio is set to 0.7–0.9, resulting in almost no oscillation after deformation and a smooth return to the original state. Only the bones at the joint ends (such as fingertips or antennas) undergo slight deformation, while the main structure remains rigid, conforming to the rigidity characteristics of mechanical motion.
[0185] Optionally, in this embodiment of the invention, the acceleration change rate threshold (0.4-0.6) for animal characters can be used, falling between realism and cartoonishness, to accommodate moderate sensitivity in animal movement; the maximum deformation amplitude is set to 10% of the original bone length, achieving a balance between exaggerated expression and physical credibility; the elastic coefficient is set to 0.6-0.8 to simulate the elasticity of animal muscles and fur; the damping ratio is set to 0.3-0.5, ensuring a moderate deformation decay rate and a natural, non-exaggerated bouncing effect. Deformation is primarily applied to the tail, ears, and extremities (such as paws and hooves), conforming to animal movement characteristics (e.g., the swaying deformation when a dog wags its tail), resulting in a vivid overall effect that conforms to biomechanical principles.
[0186] Optionally, in the above Figure 1 Based on one or more corresponding embodiments, in another optional embodiment provided by this invention, frequently used data (such as bone level depth, end-point weights, bone extension direction vectors, etc.) are pre-calculated and cached to avoid repeatedly calculating the same values during frame-by-frame processing, thus reducing CPU overhead. Since the deformation parameter calculations of different bones are independent, multi-threaded parallel computation can be used. For example, the selected bones to be deformed can be assigned to multiple threads, simultaneously calculating the basic deformation amplitude, scaling ratio, time curve, etc., of each bone, significantly accelerating the overall processing speed. For bones whose deformation amplitude is already less than a preset minimum threshold (e.g., 0.01), further changes have almost no impact on the visual effect; therefore, the subsequent deformation calculation of this bone is terminated early to avoid invalid computation. This strategy is particularly suitable for the tail end of deformation, significantly reducing the amount of computation.
[0187] Optionally, in the above Figure 1Based on one or more corresponding embodiments, in another optional embodiment provided by this invention, during frame-by-frame processing, objects such as skeletal data and frame data are repeatedly created and destroyed, and frequent memory allocation and reclamation reduce efficiency. The number of memory allocations is reduced by reusing existing objects (such as reusing temporary vectors and matrices). Skeletal attribute parameters and historical acceleration data are compressed and stored, for example, by using smaller data types (such as float instead of double), or by storing only necessary fields as needed, reducing overall memory usage. For large animation data, instead of loading all of it into memory at once, only the data required for the current processing frame and adjacent frames is loaded. Data is released promptly after processing a frame to avoid excessively high memory spikes. This is particularly effective for long animations or high-precision models.
[0188] Optionally, in the above Figure 1 Based on one or more corresponding embodiments, in another optional embodiment provided by this invention, the calculation accuracy is dynamically reduced according to the frame rate of the current processing device or the real-time requirements set by the user. For example, when the frame rate is low (e.g., below 30fps), the number of sampling points in the deformation amplitude curve calculation can be reduced, or an approximate formula can be used to replace the precise exponential / cosine calculation, prioritizing processing speed over absolute accuracy. For segments with similar motion trajectories (e.g., uniform motion or stillness) in consecutive frames, deformation parameters can be calculated in batches. Because the rate of change of acceleration is extremely low or does not trigger deformation in such segments, there is no need to repeatedly detect frame by frame. By identifying motion patterns, merging processing can significantly reduce function calls and computational overhead.
[0189] Although the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous.
[0190] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0191] This invention provides a computer-readable storage medium storing a program that, when executed by a processor, implements the skeletal dynamic deformation method.
[0192] This invention provides a processor for running a program, wherein the program executes the skeletal dynamic deformation method during runtime.
[0193] like Figure 7As shown, this embodiment of the invention provides an electronic device 1000, which includes at least one processor 1001, at least one memory 1002 connected to the processor 1001, and a bus 1003. The processor 1001 and the memory 1002 communicate with each other via the bus 1003. The processor 1001 is used to call program instructions in the memory 1002 to execute the aforementioned skeletal dynamic deformation method. The electronic device in this document can be a server, PC, PAD, mobile phone, etc.
[0194] The present invention also provides a computer program product that, when executed on an electronic device, is suitable for executing a program that initializes a method for dynamic skeletal deformation.
[0195] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, electronic devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0196] In a typical configuration, an electronic device includes one or more processors (CPUs), memory, and a bus. The electronic device may also include input / output interfaces, network interfaces, etc.
[0197] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM, and memory includes at least one memory chip. Memory is an example of computer-readable media.
[0198] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0199] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0200] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0201] In the description of this invention, it should be understood that if the terms "upper", "lower", "front", "rear", "left" and "right" are used to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the position or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.
[0202] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0203] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied 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.
[0204] The above are merely embodiments of the present invention and are not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the present invention.
Claims
1. A method for dynamic bone deformation, characterized in that, include: Acquire basic animation data, wherein the basic animation data includes the root bone motion data of the 3D skeleton-bound character in each frame; Using the root skeleton motion data, the acceleration change information of the three-dimensional skeleton-bound character is detected; Determine whether the acceleration change information meets the preset bone deformation triggering condition. If so, select at least one bone to be deformed from all the bones of the three-dimensional skeleton-bound character. Using the acceleration change information and preset basic skeletal parameters, the deformation parameters of each bone to be deformed are obtained, wherein the deformation parameters are used to maintain a constant volume and control the deformation amplitude during bone deformation. Based on the deformation parameters, the corresponding bones to be deformed in the basic animation data are subjected to deformation overlay processing to generate target animation data with deformation effects.
2. The method according to claim 1, characterized in that, The step of detecting acceleration changes in the 3D skeleton-bound character using the root skeleton motion data includes: Extract the root bone acceleration data of the 3D skeleton-bound character in the current frame, the previous frame, and the two frames before the basic animation data; Obtain the current frame smooth acceleration and the previous frame smooth acceleration of the 3D skeleton-bound character in the basic animation data; The acceleration change vector is obtained by using the smoothed acceleration of the current frame and the smoothed acceleration of the previous frame; Based on the acceleration change vector, the acceleration change rate is obtained; Determine the directional angle between the smooth acceleration of the current frame and the smooth acceleration of the previous frame.
3. The method according to claim 1, characterized in that, The step involves selecting at least one bone to be deformed from all the bones of the character bound to the 3D skeleton, including: Traverse the bone hierarchy of the three-dimensional skeleton-bound character and identify the end bones; Calculate the angle between the extension direction vector of each bone of the three-dimensional skeleton-bound character and the acceleration change vector in the acceleration change information; From the end bones, select the bones whose vector angle is less than or equal to a preset direction consistency angle threshold as candidate bones; The priority score of each candidate bone is obtained based on the layer depth, the vector angle, and the bone quality of each candidate bone. Candidate bones whose priority scores are greater than or equal to a preset score threshold are selected as bones to be deformed.
4. The method according to claim 1, characterized in that, The deformation parameters include the volume retention constraint relationship between the length direction and the radius direction, and the process of obtaining the volume retention constraint relationship includes: The basic deformation amplitude is obtained by using the acceleration change rate, the bone mass, elastic coefficient, and layer depth of the bone to be deformed in the acceleration change information. Determine the deformation direction vector, wherein the deformation direction vector is opposite in direction to the acceleration change vector in the acceleration change information; The length direction reference scaling ratio is obtained by using the basic deformation amplitude, the deformation direction vector, and the extension direction vector of the bone to be deformed; Based on the physical constraints that keep the bone volume constant, a radius-direction reference scaling ratio corresponding to the length-direction reference scaling ratio is determined to establish the volume-preserving constraint relationship.
5. The method according to claim 4, characterized in that, The deformation parameters also include a deformation amplitude curve that varies with time, and the process of obtaining the deformation amplitude curve includes: The natural angular frequency is obtained by using the elastic coefficient and mass of the skeleton to be deformed; The damped vibration angular frequency is obtained by using the natural angular frequency and the damping ratio of the skeleton to be deformed; Using the basic deformation amplitude, the damping ratio, the natural angular frequency, and the damped vibration angular frequency, a deformation amplitude curve that varies with time is generated.
6. The method according to claim 5, characterized in that, The process of performing deformation overlay processing on the corresponding skeleton to be deformed in the basic animation data based on the deformation parameters to generate target animation data with deformation effects includes: Utilize the time information of the current frame relative to the deformation trigger moment in the basic animation data; Using the time information and the deformation amplitude curve, determine the length direction scaling factor of the skeleton to be deformed in the current frame; Using the length scaling factor and the volume preservation constraint, the radius scaling factor of the skeleton to be deformed in the current frame is determined; The length scaling factor and the radius scaling factor are combined with the original scaling data of the deformable bone in the basic animation data to generate the bone scaling data of the three-dimensional skeleton bound to the character in the current frame of the target animation data.
7. The method according to claim 6, characterized in that, The step of determining the length scaling factor of the skeleton to be deformed in the current frame using the time information and the deformation amplitude curve includes: Using the time information and the deformation amplitude curve, the current deformation amplitude of the skeleton to be deformed in the current frame is obtained; Using the current deformation amplitude, the deformation direction vector, and the extension direction vector of the skeleton to be deformed, the length direction scaling factor of the skeleton to be deformed in the current frame is obtained, wherein the length direction scaling factor is constrained by a preset maximum deformation amplitude.
8. The method according to any one of claims 1 to 7, characterized in that, Before determining whether the acceleration change information meets the preset skeletal deformation triggering condition, the method further includes: Based on the character type of the 3D skeleton-bound character, select the corresponding preset skeleton basic parameters.
9. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements the skeletal dynamic deformation method as described in any one of claims 1 to 8.
10. An electronic device, characterized in that, The electronic device includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; the processor is used to call program instructions in the memory to execute the skeletal dynamic deformation method as described in any one of claims 1 to 8.