Animation generation method and device, storage medium and electronic equipment

By configuring the rotation function and vertex perturbation function for the vertex of the target model, calculating the vertex coordinates after rotation, and generating a natural cloth model swinging animation with the wind, the problem of unnatural swinging effect of the cloth model in the existing technology is solved, and the animation generation effect is improved .

CN119006664APending Publication Date: 2024-11-22NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411067731.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In the existing animation generation methods, the effect of the fabric model swings with the wind is unnatural, resulting in poor animation generation effects.

Method used

By obtaining the rotation function of the vertex configuration of the target model, including the rotation axis, the rotation axis and the rotation angle subfunction, the rotation function is called to calculate the rotation angle, and the rotation vertex coordinates are calculated based on the rotation angle and vertex coordinates to generate a more natural swing animation .

Benefits of technology

The animation generation effect is improved, making the target model's swinging animation with the wind more natural and in line with the laws of physical motion, reducing the burden of rendering resources, and controlling the swing speed and amplitude.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119006664A_ABST
    Figure CN119006664A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an animation generation method and device, a storage medium and electronic equipment. A target model is obtained, and a material configured for the target model is a material which can deform under stress; obtaining a rotation function configured for the vertex of the target model, wherein the rotation function comprises a rotation axis, a rotation axis and a rotation angle sub-function of the target model; calling a rotation function, and calculating a rotation angle based on the rotation angle subfunction and the time information; based on the rotation angle, the vertex coordinate of the vertex of the target model, the rotation axis and the rotation axis, calculating the vertex coordinate of the vertex of the target model after rotation; and generating a target swing animation corresponding to the target model based on the rotated vertex coordinates of the vertex. Therefore, by configuring the rotation function for the vertex of the target model and controlling the vertex of the target model to rotate around the rotation axis along with the time based on the rotation axis according to the rotation function, a more natural swing animation that the target model swings along with the wind is generated, and the animation generation effect is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an animation generation method, device, storage medium and electronic device. Background Art

[0002] With the rapid development of life and technology, people often use game applications for entertainment. In some game scenes, there are often scenes of cloth objects such as flags and clothes swaying in the wind. In existing animation generation methods, the vertex displacement of the world space is disturbed according to the noise map, and the vertex displacement is used to control the movement of the model vertices, so that the cloth model swings in a specified direction, thereby obtaining the animation of the cloth model swaying in the wind.

[0003] In the process of research and practice of the prior art, it is found that in the existing animation generation method, the effect of the cloth model swaying in the wind is unnatural, resulting in poor animation generation effect. Summary of the invention

[0004] The embodiments of the present application provide an animation generation method, device, storage medium and electronic device, which can generate a more natural swaying animation of a target model swaying with the wind, thereby improving the animation generation effect.

[0005] The present application provides an animation generation method, including:

[0006] Acquire a target model, wherein the material configured for the target model is a material that can be deformed under force;

[0007] Obtaining a rotation function configured for the vertices of the target model, wherein the rotation function includes a rotation axis, a rotation axis, and a rotation angle sub-function of the target model;

[0008] Calling the rotation function to calculate the rotation angle based on the rotation angle sub-function and time information;

[0009] Calculating the rotated vertex coordinates of the vertices of the target model based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and the rotation axis;

[0010] A target swing animation corresponding to the target model is generated based on the rotated vertex coordinates of the vertex.

[0011] Accordingly, an embodiment of the present application provides an animation generating device, including:

[0012] A model acquisition unit, used to acquire a target model, wherein the material configured for the target model is a material that can be deformed under force;

[0013] A function acquisition unit, used to acquire a rotation function configured for the vertices of the target model, wherein the rotation function includes a rotation axis, a rotation axis, and a rotation angle sub-function of the target model;

[0014] An angle calculation unit, used for calling the rotation function and calculating the rotation angle based on the rotation angle sub-function and time information;

[0015] A coordinate calculation unit, configured to calculate the rotated vertex coordinates of the vertices of the target model based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and the rotation axis;

[0016] The animation generating unit is used to generate the target swinging animation corresponding to the target model based on the rotated vertex coordinates of the vertex.

[0017] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program is suitable for loading by a processor to execute the steps in any animation generation method provided in the embodiment of the present application.

[0018] In addition, an embodiment of the present application also provides an electronic device, including a processor and a memory, wherein the memory stores an application program, and the processor is used to run the application program in the memory to implement the animation generation method provided in the embodiment of the present application.

[0019] An embodiment of the present application also provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device performs the steps in the animation generation method provided in the embodiment of the present application.

[0020] The embodiment of the present application obtains a target model, wherein the material configured for the target model is a material that can be deformed under force; obtains a rotation function configured for the vertices of the target model, wherein the rotation function includes the rotation axis, rotation axis, and rotation angle sub-function of the target model; calls the rotation function, and calculates the rotation angle based on the rotation angle sub-function and time information; calculates the rotated vertex coordinates of the vertices of the target model based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and rotation axis; and generates a target swinging animation corresponding to the target model based on the rotated vertex coordinates of the vertices. In this way, by configuring a rotation function for the vertices of the target model, and calculating the rotated vertex coordinates of the vertices of the target model rotating around the rotation axis based on the rotation axis over time according to the rotation function and the vertex coordinates of the vertices in the target model, a more natural swinging animation of the target model swinging with the wind can be generated based on the rotated vertex coordinates, thereby improving the animation generation effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 This is a schematic diagram of an implementation scenario of an animation generation method provided in an embodiment of the present application;

[0023] Figure 2 It is a flowchart of an animation generation method provided in an embodiment of the present application;

[0024] Figure 3 It is a schematic diagram of model rotation of an animation generation method provided in an embodiment of the present application;

[0025] Figure 4a is a schematic diagram of a model disturbance of an animation generation method provided in an embodiment of the present application;

[0026] Figure 4b It is a schematic diagram of a model swing of an animation generation method provided in an embodiment of the present application;

[0027] Figure 4c is another model swing schematic diagram of an animation generation method provided by an embodiment of the present application;

[0028] Figure 5 is a structural schematic diagram of an animation generating device provided in an embodiment of the present application;

[0029] Figure 6 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0031] The embodiment of the present application provides an animation generation method, device, storage medium and electronic device. The animation generation device can be integrated in an electronic device, and the electronic device can be a server or a terminal.

[0032] Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. Terminals may include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc. Terminals and servers can be directly or indirectly connected via wired or wireless communications, and this application does not limit this.

[0033] See also Figure 1 , taking the animation generation device integrated into an electronic device as an example, Figure 1 A schematic diagram of an implementation scenario of the animation generation method provided in an embodiment of the present application, wherein the electronic device can be a terminal or a server, and the electronic device can obtain a target model, wherein the material configured for the target model is a material that can be deformed under force; obtain a rotation function configured for the vertices of the target model, wherein the rotation function includes a rotation center, a rotation axis, and a rotation angle sub-function of the target model; call the rotation function, and calculate the rotation angle based on the rotation angle sub-function and time information; calculate the rotated vertex coordinates of the vertices of the target model based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation center and the rotation axis; and generate a target swing animation corresponding to the target model based on the rotated vertex coordinates of the vertices.

[0034] It should be noted that Figure 1The implementation environment scenario diagram of the animation generation method shown is only an example. The implementation environment scenario of the animation generation method described in the embodiment of the present application is to more clearly illustrate the technical solution of the embodiment of the present application, and does not constitute a limitation on the technical solution provided by the embodiment of the present application. It is known to those skilled in the art that with the evolution of data processing and the emergence of new business scenarios, the technical solution provided by the present application is also applicable to similar technical problems.

[0035] The solutions provided by the embodiments of the present application are specifically described by the following embodiments. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.

[0036] This embodiment will be described from the perspective of an animation generating device. The animation generating device may be integrated into an electronic device. The electronic device may be a terminal and / or a server, and this application does not limit this.

[0037] See also Figure 2 , Figure 2 : is a flow chart of an animation generation method provided in an embodiment of the present application. The animation generation method comprises:

[0038] In step 101, a target model is obtained.

[0039] The material configured for the target model may be a material that is deformable under force.

[0040] The target model may be a model for which a swinging animation is to be generated, and the swinging animation may be an animation simulating an object swinging with the wind. The material of the target model may be a deformable material such as cloth, plastic, rope, paper, etc., for example, it may be a model of an object such as a flag, clothing, or a strip of cloth.

[0041] In some game scenes, there are often scenes where objects made of cloth, such as flags and clothes, sway in the wind. If the swaying of these objects is unnatural, the game scene will feel less real, thereby reducing the player's gaming experience. Therefore, it is necessary to generate a more natural animation of objects swaying in the wind.

[0042] In step 102, a rotation function configured for a vertex of a target model is obtained.

[0043] The rotation function may include the rotation center, rotation axis and rotation angle sub-functions of the target model.

[0044] Among them, the rotation function can be a function for rotating the target model, which can be used to control the vertices of the target model to rotate around the rotation axis based on the rotation axis. Specifically, based on the rotation function, the rotated coordinates corresponding to the vertices in the target model can be calculated, so as to control the vertices on the target model to rotate based on the rotated coordinates of each vertex in the target model, and the effect of the target model swinging with the wind can be simulated. The rotation axis can be the center of the rotation transformation, and the role of the rotation axis can be used to determine the center point of the rotation. Optionally, the position of the rotation axis can open a parameter according to the original center point (pivot) of the target model, so that the rotation axis of the target model can be determined by adjusting the offset. The rotation axis can indicate the direction of the rotation transformation of the model, and can be expressed in the form of a unit vector. The rotation axis can be a geometric straight line on which the rotational symmetric action is performed. When the rotation action acts on the model, the vertical distance between any vertex in the model and the rotation axis is required to remain constant. The rotation axis can be the center of the rotation axis. The rotation angle sub-function can be a function for determining the rotation angle of the vertex of the target model, and the rotation angle can be the angle at which the target model rotates.

[0045] Optionally, the rotation angle sub-function can be a first sine function, which provides a sinusoidal relationship between time information and the rotation angle. The first sine function can be angle = Asin (T), where T can represent time information, A can represent the amplitude of the sine function, and the value of the amplitude A can be determined according to the swing amplitude of the target model actually required. The larger the value of the amplitude, the larger the angle of rotation of the target model based on the rotation axis, and the smaller the value of the amplitude, the smaller the angle of rotation of the target model based on the rotation axis. Therefore, the specific value of the amplitude A can be set according to actual needs.

[0046] In one embodiment, the first sine function may be provided with a maximum rotation angle as the amplitude of the sine function, a rotation speed parameter as the angular frequency of the sine function, and time information as the independent variable of the sine function.

[0047] Wherein, the maximum rotation angle can be the maximum angle at which the vertices of the target model rotate based on the rotation axis, and the rotation speed parameter can be a parameter for adjusting the speed at which the vertices of the target model rotate based on the rotation axis, and can be used to control the rate of change of the rotation angle. For example, the first sine function can be expressed as angle=Asin(wT), where A can represent the maximum rotation angle, w can represent the rotation speed parameter, and t can represent time information. Due to the existence of w, the speed of change of the value of wT is changed, so that different rotation angles can be obtained. Therefore, when the rotation speed parameter w is greater than 1, the speed of change of the rotation angle can be increased based on the rotation speed parameter w, so that the rotation speed of the target model can be increased. When the rotation speed parameter w is a value of 0-1, the speed of change of the rotation angle can be reduced based on the rotation speed parameter w, so that the rotation speed of the target model can be reduced. In this way, the rotation speed of the target model rotating based on the rotation axis can be flexibly controlled based on the rotation speed parameter.

[0048] Thus, since the value of the sine function is between -1 and 1, through the first sine function, the rotation angle of the vertex of the target model based on the rotation axis can be determined based on the maximum rotation angle and the rotation speed parameter as time T changes, so that based on the rotation angle that changes with time, the target model can be controlled to rotate along the rotation axis between the maximum rotation angle of the positive value and the maximum rotation angle of the negative value, so that the swinging process of the target model has a more natural swinging arc, and the swinging speed and swinging amplitude of the target model in the swinging process can be flexibly controlled, thereby improving the naturalness of the swinging animation of the target model. At the same time, based on the functional characteristics of the sine function, when approaching the highest point of rotation, that is, when the rotation angle is close to the maximum rotation angle, the rotation speed of the target model can be controlled to slow down and approach 0, and then accelerate downward rotation to achieve a swinging effect that is more in line with the laws of physics, thereby generating a more natural swinging animation that conforms to the laws of natural motion, further improving the swinging animation generation effect.

[0049] For example, see Figure 3 , Figure 3 This is a model rotation diagram of an animation generation method provided in an embodiment of the present application. It is assumed that the rotation axis of the target model is on the X-axis and the rotation axis is on the coordinate origin (0, 0, 0). Therefore, the rotation function can be used to determine that the target model swings back and forth around the X-axis on the positive and negative axes of the Z-axis, and the swing angle is between the maximum positive rotation angle and the maximum negative rotation angle.

[0050] In step 103, the rotation function is called to calculate the rotation angle based on the rotation angle sub-function and time information.

[0051] Among them, the rotation angle can be the angle of rotation of the vertex of the target model based on the rotation axis, and the time information can be a numerical value that changes with time. When generating the swing animation of the target model, the time information can be counted from 0, and optionally, it can be obtained through the time (Time) node in the Unreal Engine.

[0052] Among them, there can be many ways to calculate the rotation angle based on the rotation angle sub-function and time information. For example, when the rotation angle sub-function is a first sinusoidal function and provides a sinusoidal relationship between time information and the rotation angle, the cumulative rotation time of the target model this time can be obtained as time information, and the rotation angle can be calculated based on the time information and the first sinusoidal function.

[0053] The accumulated rotation time may be the total time for controlling the target model to rotate and swing, and the time information may be counted from 0 to the accumulated rotation time.

[0054] There are many ways to calculate the rotation angle based on the time information and the first sine function. For example, the current time information can be input into the first sine function, so that the calculation result of the first sine function based on the input time information is used as the rotation angle.

[0055] Optionally, there can be multiple ways to calculate the rotation angle based on the time information and the first sine function. For example, when the first sine function is set with a maximum rotation angle as the amplitude of the sine function, a rotation speed parameter is set as the angular frequency of the sine function, and time information is set as the independent variable of the sine function, the rotation angle corresponding to the target model can be calculated based on the time information, the maximum rotation angle, the rotation speed parameter and the first sine function, and the rotation angle changes between a positive maximum rotation angle and a negative maximum rotation angle over time.

[0056] For example, assuming that the first sine function is angle = Asin(wT), where A can represent the maximum rotation angle, w can represent the rotation speed parameter, and T can represent the time information. Thus, the first sine function can be used to calculate the rotation angle of the vertex in the target model based on the maximum rotation angle A, the rotation speed parameter w and the time information T. The rotation angle varies over time between a positive maximum rotation angle |A| and a negative maximum rotation angle -|A|, that is, the rotation angle is in the interval (-|A|, |A|).

[0057] In step 104 , the rotated vertex coordinates of the vertices of the target model are calculated based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and the rotation axis.

[0058] Among them, the vertex coordinates can be the coordinates of the vertices in the target model, can be the coordinates of the vertices of the target model in the world space coordinates, or can be the coordinates in the local coordinate system. The rotated vertex coordinates can be the coordinates of the vertices determined by rotating the vertices of the target model based on the rotation axis and the rotation angle, that is, the vertices can be rotated to the position of the rotated vertex coordinates based on the rotation function. The rotated vertex coordinates of the vertices of the target model can be calculated through the rotation angle, rotation axis and rotation axis in the rotation function, and the vertex coordinates of the vertices of the target model, so that the vertices can be rotated to the corresponding rotated vertex coordinates, so that the vertices of the target model are rotated by the corresponding rotation angle based on the rotation axis, thereby realizing the control of the target model to swing and obtaining the corresponding swinging animation of the target model.

[0059] Among them, based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and the rotation axis, there can be multiple ways to calculate the rotated vertex coordinates of the vertices of the target model. For example, the rotation matrix corresponding to the vertex can be determined based on the rotation angle and the rotation axis; based on the vertex coordinates of each vertex of the target model, the rotation axis and the rotation matrix, the rotated vertex coordinates of each vertex rotating around the rotation axis based on the rotation axis over time are calculated.

[0060] The rotation matrix may be a matrix for rotating the vertices in the target model by the rotation angle based on the rotation axis, and may be a way of describing the rotation. Optionally, the rotation matrix may be obtained using the Rodriguez rotation formula.

[0061] Among them, there are many ways to determine the rotation matrix corresponding to the vertex based on the rotation angle and the rotation axis. For example, the sine and cosine values ​​of the rotation angle can be calculated, so that based on the sine and cosine values ​​of the rotation angle and the rotation axis, a rotation matrix for rotating the vertex to the corresponding rotation angle based on the rotation axis can be constructed.

[0062] After determining the rotation matrix corresponding to the vertex based on the rotation angle and the rotation axis, the rotated vertex coordinates of each vertex rotating around the rotation axis over time based on the rotation axis can be calculated based on the vertex coordinates of each vertex of the target model, the rotation axis and the rotation matrix. There are multiple ways to calculate the rotated vertex coordinates of each vertex rotating around the rotation axis over time based on the vertex coordinates of each vertex of the target model, the rotation axis and the rotation matrix. For example, the vertex coordinates of the vertices in the target model can be translated based on the coordinates of the rotation axis to obtain the translated vertex coordinates of the vertices. The initial rotated vertex coordinates corresponding to each vertex can be calculated based on the translated vertex coordinates of each vertex and the rotation matrix. The initial rotated vertex coordinates of each vertex can be translated and restored based on the coordinates of the rotation axis to obtain the rotated vertex coordinates of each vertex rotating over time.

[0063] The translated vertex coordinates may be coordinates obtained by translating the vertex coordinates of the vertices in the target model based on the coordinates of the rotation axis, and the initially rotated vertex coordinates may be coordinates obtained by rotating the translated vertex coordinates.

[0064] Among them, based on the coordinates of the rotation axis, the vertex coordinates of the vertices in the target model are translated, and there are many ways to obtain the translated vertex coordinates of the vertices. For example, assuming that the coordinates of the rotation axis are (0, 2, 0), and the vertex coordinates of a vertex in the target model are (1, 5, 3), then the translated vertex coordinates corresponding to the vertex can be (1, 5-2, 3) = (1, 3, 3).

[0065] Based on the coordinates of the rotation axis, the vertex coordinates of the vertices in the target model are translated to obtain the translated vertex coordinates of the vertices. Then, the initial rotated vertex coordinates corresponding to each vertex can be calculated based on the translated vertex coordinates of each vertex and the rotation matrix. There are many ways to calculate the initial rotated vertex coordinates corresponding to each vertex based on the translated vertex coordinates of each vertex and the rotation matrix. For example, the translated vertex coordinates of each vertex can be multiplied by the rotation matrix to obtain the initial rotated vertex coordinates corresponding to each vertex.

[0066] In one embodiment, the Rodrigues rotation formula can be used to determine the rotation matrix corresponding to the vertex based on the rotation angle and the rotation axis, so that the vertex coordinates of each vertex of the target model, the rotation axis and the rotation matrix can be used to calculate the rotated vertex coordinates of each vertex rotating around the rotation axis based on the rotation axis over time. Specifically, a rotation function LigaRotateAxis() can be constructed to calculate the rotation matrix, so that the rotated vertex coordinates corresponding to each vertex can be calculated based on the rotation matrix, the vertex coordinates of the vertices in the target model and the rotation axis. The specific implementation can be as follows:

[0067]

[0068]

[0069] Among them, center can be expressed as the rotation axis, original can be expressed as the vertex coordinates of the vertex of the target model, u can be expressed as the unit vector corresponding to the rotation axis, and angle can be expressed as the rotation angle subfunction. finalMatrixfloat3x3() can be expressed as a 3×3 rotation matrix, which can include nine elements, namely m00, m01, m02, m10, m11, m12, m20, m21 and m22, among which m00, m11 and m22 are the elements on the diagonal of the rotation matrix, including the square of the rotation axis vector component multiplied by t plus the cosine term c. These terms correspond to the contributions of the axial components that remain unchanged during the rotation. m01, m02, m10, m12, m20 and m21 are the non-diagonal elements of the rotation matrix, which can include the product of different components of the rotation axis vector, sine terms and cosine terms. These elements control the offset of the rotation midpoint and the change of the axial direction. Among them, m01 and mn10 can be used to control the interaction between the x and y components, m02 and m20 can be used to control the interaction between the x and z components, and m12 and m21 can be used to control the interaction between the y and z components. mul(finalMatrix,original) can be used to multiply the rotation matrix finalMatrix and the translated vertex coordinates original, and add the multiplication result to the coordinates of the rotation axis center to get the rotated vertex coordinates corresponding to each vertex.

[0070] In step 105, a target swing animation corresponding to the target model is generated based on the rotated vertex coordinates of the vertices.

[0071] The target swinging animation may be a swinging animation corresponding to the target model, in which the target model performs a rotational motion based on a rotation axis over time.

[0072] There are many ways to generate a target swing animation corresponding to a target model based on the rotated vertex coordinates of the vertices. For example, the vertices of the target model can be controlled to move over time to the rotated vertex coordinates corresponding to the vertices according to the rotated vertex coordinates of the vertices, thereby obtaining a target swing animation corresponding to the target model.

[0073] Optionally, there may be a variety of ways to generate a target swing animation corresponding to a target model based on the vertex coordinates of the vertices after rotation. For example, in order to further enhance the effect of the target swing animation, vertex animation may be added to the target model so that the target model deforms to fit the configured material. For example, for a target model made of cloth material, vertex animation may be added so that the target model simulates the soft effect of cloth. Specifically, a vertex perturbation function of the vertices in the target model may be obtained, and the perturbed vertex coordinates of each vertex may be calculated based on the vertex perturbation function, the vertex coordinates of the vertices of the target model, and the rotated vertex coordinates. Based on the perturbed vertex coordinates of the vertices in the target model, a target swing animation corresponding to the target model may be generated.

[0074] The vertex perturbation function may be a function that perturbs the rotation of the vertices of the target model, so as to make the vertices of the target model move, thereby simulating the physical swing effect of the material corresponding to the target model. The perturbed vertex coordinates may be coordinates obtained by perturbing the rotated vertex coordinates based on the vertex perturbation function.

[0075] Among them, there can be many ways to calculate the perturbed vertex coordinates of each vertex based on the vertex perturbation function, the vertex coordinates of the vertices of the target model and the vertex coordinates after rotation. For example, the basic coordinate offset information of each vertex can be calculated based on the vertex coordinates of each vertex before rotation of the target model, time information and the vertex perturbation function, and the perturbed vertex coordinates of each vertex can be obtained based on the basic coordinate offset information and the vertex coordinates of the vertices of the target model after rotation.

[0076] The basic coordinate offset information may be a value for offsetting the coordinates of the vertices of the target model.

[0077] There are multiple ways to calculate the basic coordinate offset information of each vertex based on the vertex coordinates, time information and vertex perturbation function of each vertex before the rotation of the target model. For example, the vertex perturbation function may include a second sine function, which can control the vertices of the target model to perform corresponding sinusoidal curve offset movements as the vertex coordinates are different. For example, the second sine function can be expressed as Pos_noise=sin(PT), where P represents the vertex coordinates of the vertices of the target model, and T can represent time information. Thus, through the second sine function, the basic coordinate offset information corresponding to each vertex can be calculated based on the vertex coordinates of the vertices of the input target model and time information. Thus, based on the basic coordinate offset information, each vertex in the target model can be controlled to perform corresponding offset movements, so that the target model presents a force deformation effect.

[0078] For example, see Figure 4a , Figure 4aThis is a model perturbation schematic diagram of an animation generation method provided in an embodiment of the present application. The originally vertically suspended target model can be disturbed by the vertex perturbation function so that the target model presents a soft and curved effect, thereby making the target model more closely fit the configured force-bearing and deformable material, thereby improving the naturalness and authenticity of the target model's swinging animation.

[0079] There are multiple ways to obtain the perturbed vertex coordinates of each vertex based on the basic coordinate offset information and the rotated vertex coordinates of the vertices of the target model. For example, the basic coordinate offset information and the rotated vertex coordinates corresponding to each vertex in the target model can be added to obtain the perturbed vertex coordinates of each vertex. Thus, based on the perturbed vertex coordinates of the vertices in the target model, the vertices in the target model can be controlled to move to the corresponding perturbed vertex coordinates over time, thereby generating a target swing animation corresponding to the target model.

[0080] Optionally, the vertex perturbation function may include a second sine function (Pos_noise), a noise direction (Noise_dir), a noise intensity (CurtainWaveIntensity) and a noise mask (Input.diffuse.r), wherein the noise direction may be a parameter indicating the perturbation direction, the noise direction may be the same as the rotation direction, and may be a direction vector perpendicular to the plane of the target model. The noise intensity may be a parameter for controlling the intensity of vertex perturbation. The greater the noise intensity, the greater the basic coordinate offset information corresponding to the vertex, and the greater the influence on the coordinates of the vertex. The noise mask may be a vertex color mask, which may be used to control whether the vertices in the target model are perturbed. Optionally, the noise mask may be the value of the R channel in the vertex color attribute of the vertex of the target model, and the value of the R channel in the vertex color attribute of the vertex may be configured according to the actual perturbation requirement, so that whether the vertices in the target model are perturbed may be set based on the value of the R channel in the vertex color attribute, thereby realizing flexible control of the vertices in the target model.

[0081] In one embodiment, the calculation process of the perturbed vertex coordinates can be expressed as:

[0082] Q=yao(t)+(Pos_noise*Noise_dir*CurtainWaveIntensity*Input.diffuse.r)

[0083] Among them, Q can be expressed as the vertex coordinates after perturbation, yao(t) can be expressed as a rotation function, (Pos_noise*Noise_dir*CurtainWaveIntensity*Input.diffuse.r) can be expressed as a vertex perturbation function, which includes the second sine function (Pos_noise), noise direction (Noise_dir), noise intensity (CurtainWaveIntensity) and noise mask (Input.diffuse.r).

[0084] Correspondingly, for different rotation axes or planar directions of the target model, the parameters of the corresponding rotation function and vertex perturbation function may be different, and may be adaptively selected according to actual conditions, which is not limited in the embodiments of the present application.

[0085] In this way, based on the animation generation method provided by the embodiment of the present application, the rotated vertex coordinates determined based on the rotation function and the basic coordinate offset information determined based on the vertex perturbation function can be accumulated to obtain the perturbed vertex coordinates, so that based on the perturbed vertex coordinates, the target model can be controlled to rotate and swing back and forth based on the rotation axis and the maximum rotation angle. At the same time, the vertices of the target model are controlled to perform an offset movement according to the basic coordinate offset information, so that the target model presents the effect of force deformation and the effect of the target model swinging with the wind. When approaching the highest point of rotation, that is, when the rotation angle is close to the maximum rotation angle, the rotation speed of the target model is controlled to slow down and approach 0, and then accelerate downward to achieve a swinging effect that is more in line with the laws of physics, thereby generating a more natural swinging animation that conforms to the laws of natural motion, further improving the swinging animation generation effect.

[0086] For example, see Figure 4b , Figure 4b This is a schematic diagram of a model swing of an animation generation method provided in an embodiment of the present application. Assuming that the rotation axis is the Z axis, based on the animation generation method provided in an embodiment of the present application, the perturbed vertex coordinates determined by the vertex perturbation function based on the rotation function can be used to control the target model to rotate and swing back and forth on the positive and negative axes of the X axis, and the target model presents a force deformation effect based on the sine curve law, thereby generating a natural swing animation of the target model that conforms to the laws of physical motion.

[0087] In the existing animation generation method, the vertex displacement in the world space is often disturbed according to the noise map, and the vertex displacement is used to control the movement of the model vertices, so that the cloth model swings in a specified direction, thereby obtaining an animation of the cloth model swinging with the wind. In the existing animation generation method, it is necessary to read the corresponding texture map at the vertex stage, which increases the burden of rendering resources. In addition, the swinging animation generated by the existing animation generation method is unnatural when the model swings in place when viewed from the side. For example, please refer to Figure 4c , Figure 4c This is another model swinging schematic diagram of an animation generation method provided in an embodiment of the present application. As shown in the left figure, when the model is swinging in place, the model swings too straight when viewed from the side, which is more obvious when the swing amplitude is large, making the model swing unnatural. In addition, in the existing animation generation method, the swinging speed of the model is difficult to control, resulting in an unnatural effect of the model swinging with the wind, which in turn makes the animation generation effect poor. To this end, the embodiment of the present application provides an animation generation method, which calculates the perturbed vertex coordinates of the vertices through a rotation function and a vertex perturbation function, and then controls the target model to rotate and swing back and forth based on the rotation axis and the maximum rotation angle based on the perturbated vertex coordinates, which can avoid reading the corresponding texture map at the vertex stage, reducing the rendering resource burden and memory usage. At the same time, the embodiment of the present application can control the vertices of the target model to perform offset movements according to the basic coordinate offset information, so that the target model presents the effect of force deformation and fluttering in the wind, and when approaching the highest point of rotation, that is, when the rotation angle is close to the maximum rotation angle, the rotation speed of the target model is controlled to slow down and approach 0, and then accelerate downward to achieve a swinging effect that is more in line with the laws of physics, thereby generating a more natural swinging animation that conforms to the laws of natural movement. In addition, please continue to refer to Figure 4c The right picture in the figure can control the rotation of the target model to have a more natural swing arc, and can also be better reused in the swing control of other models to further improve the swing animation generation effect.

[0088] As can be seen from the above, the embodiment of the present application obtains a target model, and the material configured for the target model is a material that can be deformed under force; obtains a rotation function configured for the vertices of the target model, and the rotation function includes the rotation axis, rotation axis, and rotation angle sub-function of the target model; calls the rotation function, and calculates the rotation angle based on the rotation angle sub-function and time information; calculates the rotated vertex coordinates of the vertices of the target model based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and the rotation axis; and generates a target swing animation corresponding to the target model based on the rotated vertex coordinates of the vertices. In this way, by configuring a rotation function for the vertices of the target model, and calculating the rotated vertex coordinates of the vertices of the target model rotating around the rotation axis based on the rotation axis over time according to the rotation function and the vertex coordinates of the vertices in the target model, a more natural swinging animation of the target model swinging with the wind can be generated based on the rotated vertex coordinates, thereby improving the animation generation effect.

[0089] In order to better implement the above method, an embodiment of the present invention further provides an animation generating device, which can be integrated in an electronic device, and the electronic device can be a server or a terminal.

[0090] For example, Figure 5 As shown, it is a schematic diagram of the structure of the animation generation device provided in an embodiment of the present application. The animation generation device may include a model acquisition unit 201, a function acquisition unit 202, an angle calculation unit 203, a coordinate calculation unit 204 and an animation generation unit 205, as follows:

[0091] The model acquisition unit 201 is used to acquire a target model, wherein the material configured for the target model is a material that can be deformed under force;

[0092] A function acquisition unit 202 is used to acquire a rotation function configured for a vertex of a target model, wherein the rotation function includes a rotation axis, a rotation axis, and a rotation angle sub-function of the target model;

[0093] An angle calculation unit 203, used to call the rotation function and calculate the rotation angle based on the rotation angle sub-function and time information;

[0094] A coordinate calculation unit 204, used to calculate the rotated vertex coordinates of the vertices of the target model based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and the rotation axis;

[0095] The animation generating unit 205 is used to generate a target swinging animation corresponding to the target model based on the rotated vertex coordinates of the vertices.

[0096] In some embodiments, the rotation angle sub-function is a first sinusoidal function, which provides a sinusoidal relationship between time information and the rotation angle. The angle calculation unit 203 includes:

[0097] The time information acquisition subunit is used to obtain the cumulative rotation time of the target model as time information;

[0098] The rotation angle calculation subunit is used to calculate the rotation angle based on the time information and the first sine function.

[0099] In some embodiments, the first sine function is provided with a maximum rotation angle as the amplitude of the sine function, a rotation speed parameter as the angular frequency of the sine function, and time information as the independent variable of the sine function, and the rotation angle calculation subunit is used to:

[0100] Based on the time information, the maximum rotation angle, the rotation speed parameter and the first sine function, the rotation angle corresponding to the target model is calculated, and the rotation angle changes between a positive maximum rotation angle and a negative maximum rotation angle over time.

[0101] In some embodiments, the coordinate calculation unit 204 includes:

[0102] A rotation matrix determination subunit, used to determine the rotation matrix corresponding to the vertex based on the rotation angle and the rotation axis;

[0103] The rotation coordinate calculation subunit is used to calculate the rotated vertex coordinates of each vertex around the rotation axis based on the rotation axis over time based on the vertex coordinates of each vertex of the target model, the rotation axis and the rotation matrix.

[0104] In some embodiments, the rotation coordinate calculation subunit is used to:

[0105] Based on the coordinates of the rotation axis, the vertex coordinates of the vertices in the target model are translated to obtain the translated vertex coordinates of the vertices;

[0106] Based on the translated vertex coordinates and the rotation matrix of each vertex, the initial rotated vertex coordinates corresponding to each vertex are calculated;

[0107] Based on the coordinates of the rotation axis, the initial rotated vertex coordinates of each vertex are subjected to translation recovery processing to obtain the rotated vertex coordinates of each vertex that rotates over time.

[0108] In some embodiments, the animation generation unit 205 includes:

[0109] A perturbation function acquisition subunit is used to acquire vertex perturbation functions of vertices in a target model;

[0110] A perturbed coordinate calculation subunit, used for calculating the perturbed vertex coordinates of each vertex based on the vertex perturbation function, the vertex coordinates of the vertices of the target model and the rotated vertex coordinates;

[0111] The swing animation generating subunit is used to generate a target swing animation corresponding to the target model based on the perturbed vertex coordinates of the vertices in the target model.

[0112] In some embodiments, the disturbance coordinate calculation subunit is used to:

[0113] Based on the vertex coordinates, time information and vertex perturbation function of each vertex before the target model is rotated, the basic coordinate offset information of each vertex is calculated;

[0114] Based on the basic coordinate offset information and the rotated vertex coordinates of the vertices of the target model, the perturbed vertex coordinates of each vertex are obtained.

[0115] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.

[0116] As can be seen from the above, the embodiment of the present application obtains the target model through the model acquisition unit 201, and the material configured for the target model is a material that can be deformed under force; the function acquisition unit 202 obtains the rotation function configured for the vertices of the target model, and the rotation function contains the rotation axis, rotation axis and rotation angle sub-function of the target model; the angle calculation unit 203 calls the rotation function and calculates the rotation angle based on the rotation angle sub-function and time information; the coordinate calculation unit 204 calculates the rotated vertex coordinates of the vertices of the target model based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and the rotation axis; the animation generation unit 205 generates the target swing animation corresponding to the target model based on the rotated vertex coordinates of the vertices. In this way, by configuring the rotation function for the vertices of the target model, and according to the rotation function and the vertex coordinates of the vertices in the target model, the rotated vertex coordinates of the vertices of the target model that rotate around the rotation axis based on the rotation axis over time are calculated, so that based on the rotated vertex coordinates, a more natural swinging animation of the target model swinging with the wind can be generated, thereby improving the animation generation effect.

[0117] The present application also provides an electronic device, such as Figure 6 As shown, it shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present application, and the electronic device may be a terminal or a server. Specifically:

[0118] The electronic device 300 includes a processor 301 having one or more processing cores, a memory 302 having one or more computer-readable storage media, and a computer program stored in the memory 302 and executable on the processor. The processor 301 is electrically connected to the memory 302. Those skilled in the art will appreciate that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0119] The processor 301 is the control center of the electronic device 300. It uses various interfaces and lines to connect various parts of the entire electronic device 300, executes various functions of the electronic device 300 and processes data by running or loading software programs and / or modules stored in the memory 302, and calling data stored in the memory 302, thereby monitoring the electronic device 300 as a whole.

[0120] In the embodiment of the present application, the processor 301 in the electronic device 300 will load instructions corresponding to the processes of one or more application programs into the memory 302 according to the following steps, and the processor 301 will run the application programs stored in the memory 302 to implement various functions:

[0121] Get the target model, the material configured for the target model is a material that can be deformed under force;

[0122] Get the rotation function configured for the vertex of the target model, which contains the rotation axis, rotation axis and rotation angle sub-functions of the target model;

[0123] Call the rotation function to calculate the rotation angle based on the rotation angle sub-function and time information;

[0124] Based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and the rotation axis, calculate the rotated vertex coordinates of the vertices of the target model;

[0125] A target swing animation corresponding to the target model is generated based on the rotated vertex coordinates of the vertices.

[0126] This solution can be achieved by obtaining a target model, wherein the material configured for the target model is a material that is deformable under force; obtaining a rotation function configured for the vertices of the target model, wherein the rotation function includes the rotation axis, rotation axis, and rotation angle sub-function of the target model; calling the rotation function, and calculating the rotation angle based on the rotation angle sub-function and time information; calculating the rotated vertex coordinates of the vertices of the target model based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and rotation axis; and generating a target swinging animation corresponding to the target model based on the rotated vertex coordinates of the vertices. In this way, by configuring a rotation function for the vertices of the target model, and calculating the rotated vertex coordinates of the vertices of the target model rotating around the rotation axis based on the rotation axis over time based on the rotation function and the vertex coordinates of the vertices in the target model, a more natural swinging animation of the target model swinging with the wind can be generated based on the rotated vertex coordinates, thereby improving the animation generation effect.

[0127] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0128] Optional, such as Figure 6 As shown, the electronic device 300 further includes: a touch screen 303, a radio frequency circuit 304, an audio circuit 305, an input unit 306, and a power supply 307. The processor 301 is electrically connected to the touch screen 303, the radio frequency circuit 304, the audio circuit 305, the input unit 306, and the power supply 307, respectively. Those skilled in the art can understand that Figure 6 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0129] The touch display screen 303 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 303 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel can be used to collect the user's touch operation on or near it (such as the user uses any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 301, and can receive the command sent by the processor 301 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 301 to determine the type of touch event, and then the processor 301 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 303 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 303 can also be used as a part of the input unit 306 to realize the input function.

[0130] The radio frequency circuit 304 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals with the network device or other electronic devices.

[0131] The audio circuit 305 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 305 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 305 and converted into audio data, and then the audio data is output to the processor 301 for processing, and then sent to another electronic device through the radio frequency circuit 304, or the audio data is output to the memory 302 for further processing. The audio circuit 305 may also include an earplug jack to provide communication between an external headset and the electronic device.

[0132] The input unit 306 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0133] The power supply 307 is used to supply power to various components of the electronic device 300. Optionally, the power supply 307 can be logically connected to the processor 301 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 307 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0134] although Figure 6 Not shown, the electronic device 300 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0135] In the above embodiments, the description of each embodiment has its own emphasis. For the parts not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. It should be noted that the electronic device provided in the embodiment of the present application and the method for generating animation in the above embodiment belong to the same concept. The specific implementation process is detailed in the above method embodiment and will not be repeated here.

[0136] As can be seen from the above, the electronic device provided in the embodiment of the present application can obtain a target model, wherein the material configured for the target model is a material that can be deformed under force; obtain a rotation function configured for the vertices of the target model, wherein the rotation function includes the rotation axis, rotation axis, and rotation angle sub-function of the target model; call the rotation function, and calculate the rotation angle based on the rotation angle sub-function and time information; calculate the rotated vertex coordinates of the vertices of the target model based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and the rotation axis; and generate a target swing animation corresponding to the target model based on the rotated vertex coordinates of the vertices. In this way, by configuring a rotation function for the vertices of the target model, and calculating the rotated vertex coordinates of the vertices of the target model rotating around the rotation axis based on the rotation axis over time according to the rotation function and the vertex coordinates of the vertices in the target model, a more natural swinging animation of the target model swinging with the wind can be generated based on the rotated vertex coordinates, thereby improving the animation generation effect.

[0137] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0138] To this end, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program can be loaded by a processor to execute the steps in any animation generation method provided in the embodiment of the present application. For example, the computer program can execute the following steps:

[0139] Get the target model, the material configured for the target model is a material that can be deformed under force;

[0140] Get the rotation function configured for the vertex of the target model, which contains the rotation axis, rotation axis and rotation angle sub-functions of the target model;

[0141] Call the rotation function to calculate the rotation angle based on the rotation angle sub-function and time information;

[0142] Based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and the rotation axis, calculate the rotated vertex coordinates of the vertices of the target model;

[0143] A target swing animation corresponding to the target model is generated based on the rotated vertex coordinates of the vertices.

[0144] This solution can be achieved by obtaining a target model, wherein the material configured for the target model is a material that is deformable under force; obtaining a rotation function configured for the vertices of the target model, wherein the rotation function includes the rotation axis, rotation axis, and rotation angle sub-function of the target model; calling the rotation function, and calculating the rotation angle based on the rotation angle sub-function and time information; calculating the rotated vertex coordinates of the vertices of the target model based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and rotation axis; and generating a target swinging animation corresponding to the target model based on the rotated vertex coordinates of the vertices. In this way, by configuring a rotation function for the vertices of the target model, and calculating the rotated vertex coordinates of the vertices of the target model rotating around the rotation axis based on the rotation axis over time based on the rotation function and the vertex coordinates of the vertices in the target model, a more natural swinging animation of the target model swinging with the wind can be generated based on the rotated vertex coordinates, thereby improving the animation generation effect.

[0145] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0146] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0147] Since the computer program stored in the computer-readable storage medium can execute the steps in any animation generation method provided in the embodiments of the present application, the beneficial effects that can be achieved by any animation generation method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0148] Among them, according to one aspect of the present application, a computer program product is provided, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device executes the methods provided in the various optional implementations provided in the above embodiments.

[0149] The above is a detailed introduction to an animation generation method, device, storage medium and electronic device provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. An animation generation method, characterized in that: include: Acquire a target model, wherein the material configured for the target model is a material that can be deformed under force; Obtaining a rotation function configured for the vertices of the target model, wherein the rotation function includes a rotation axis, a rotation axis, and a rotation angle sub-function of the target model; Calling the rotation function to calculate the rotation angle based on the rotation angle sub-function and time information; Calculating the rotated vertex coordinates of the vertices of the target model based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and the rotation axis; A target swing animation corresponding to the target model is generated based on the rotated vertex coordinates of the vertex.

2. The animation generation method according to claim 1, characterized in that: The rotation angle sub-function is a first sinusoidal function, which provides a sinusoidal relationship between time information and the rotation angle. The calculation of the rotation angle based on the rotation angle sub-function and the time information includes: Obtaining the accumulated rotation time of the target model during this rotation as the time information; Based on the time information and the first sine function, a rotation angle is calculated.

3. The animation generation method according to claim 2, characterized in that: The first sine function is provided with a maximum rotation angle as the amplitude of the sine function, a rotation speed parameter as the angular frequency of the sine function, and time information as an independent variable of the sine function. The calculation of the rotation angle based on the time information and the first sine function includes: Based on the time information, the maximum rotation angle, the rotation speed parameter and the first sine function, a rotation angle corresponding to the target model is calculated, and the rotation angle changes between a positive maximum rotation angle and a negative maximum rotation angle over time.

4. The animation generation method according to claim 1, characterized in that: The step of calculating the rotated vertex coordinates of the vertices of the target model based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and the rotation axis, comprises: Based on the rotation angle and the rotation axis, determining a rotation matrix corresponding to the vertex; Based on the vertex coordinates of each vertex of the target model, the rotation axis and the rotation matrix, the rotated vertex coordinates of each vertex after rotating around the rotation axis based on the rotation axis over time are calculated.

5. The animation generation method according to claim 4, characterized in that: The step of calculating the rotated vertex coordinates of each vertex of the target model, the rotation axis, and the rotation matrix based on the vertex coordinates of each vertex of the target model, which is rotated around the rotation axis based on the rotation axis over time, includes: Based on the coordinates of the rotation axis, translating the vertex coordinates of the vertices in the target model to obtain translated vertex coordinates of the vertices; Based on the translated vertex coordinates of each vertex and the rotation matrix, calculate the initial rotated vertex coordinates corresponding to each vertex; Based on the coordinates of the rotation axis, the initial rotated vertex coordinates of each vertex are subjected to translation recovery processing to obtain the rotated vertex coordinates of each vertex that rotates over time.

6. The animation generation method according to any one of claims 1 to 5, characterized in that: The generating the target swing animation corresponding to the target model based on the rotated vertex coordinates of the vertex includes: Obtaining vertex perturbation functions of vertices in the target model; Calculate the perturbed vertex coordinates of each vertex based on the vertex perturbation function, the vertex coordinates of the vertices of the target model, and the rotated vertex coordinates; Based on the disturbed vertex coordinates of the vertices in the target model, a target swing animation corresponding to the target model is generated.

7. The animation generation method according to claim 6, characterized in that: The calculating the perturbed vertex coordinates of each vertex based on the vertex perturbation function, the vertex coordinates of the vertices of the target model and the rotated vertex coordinates comprises: Calculating basic coordinate offset information of each vertex based on the vertex coordinates of each vertex before the target model is rotated, the time information, and the vertex perturbation function; Based on the basic coordinate offset information and the rotated vertex coordinates of the vertices of the target model, the perturbed vertex coordinates of each vertex are obtained.

8. An animation generating device, characterized in that: include: A model acquisition unit, used to acquire a target model, wherein the material configured for the target model is a material that can be deformed under force; A function acquisition unit, used to acquire a rotation function configured for the vertices of the target model, wherein the rotation function includes a rotation axis, a rotation axis, and a rotation angle sub-function of the target model; An angle calculation unit, used for calling the rotation function and calculating the rotation angle based on the rotation angle sub-function and time information; A coordinate calculation unit, configured to calculate the rotated vertex coordinates of the vertices of the target model based on the rotation angle and the vertex coordinates of the vertices of the target model, as well as the rotation axis and the rotation axis; The animation generating unit is used to generate the target swinging animation corresponding to the target model based on the rotated vertex coordinates of the vertex.

9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the methods of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: It includes a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any method described in claims 1 to 7.