Method and device for generating animation
By obtaining the elastic material simulation component, calculating the collision result between the elastic node and the collision node, and determining the position to be displayed in the animation frame, the problem of the effect difference between virtual human cloth animation simulation between different game engines is solved, and cross-platform cloth animation is realized. Generation and consistency effects.
Patent Information
- Application Number
- CN202210339622.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-01
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-04-01
AI Technical Summary
In the existing technology, the effects of virtual human cloth animation simulation vary greatly between different game engines, causing developers to need to repeat configurations and affecting work efficiency.
By obtaining the elastic material simulation component, including the elastic node list and the collision node list, calculating the collision result between the elastic node and the collision node, determining the position of the elastic node to be displayed in the animation frame, and rendering the animation based on this position, achieving cross-platform Cloth animation generation.
It reduces the repetitive configuration work of developers on different platforms and ensures the consistency of cloth animation simulation effects on different game engines.
Smart Images

Figure CN114882153B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for generating animation. The present application further provides related non-volatile readable storage media and electronic devices. Background Art
[0002] With the development of computers, cloth animation simulation technology has been widely used in the field of games. When a virtual person is running, jumping, etc., the cloth animation simulation technology is used to obtain the deformation and fluttering effects of the clothes on the virtual character, so as to show rich movement details and increase the realism of the animation.
[0003] In the prior art, different game engines have their own elastic cloth simulation solutions to achieve the motion simulation of elastic cloth objects. Since the mechanisms of each engine are different, when importing virtual human assets, it is necessary to repeatedly configure each engine, and the configuration parameters need to be readjusted, resulting in large differences in cloth animation simulation effects between different engines, and developers have to repeat configurations and other inefficient workloads. Summary of the invention
[0004] In view of this, the present application provides an animation generation method and device, a non-volatile readable storage medium and an electronic device to solve the problem in the prior art that the cloth animation simulation of virtual humans has a large gap in different game engines, requires repeated configuration, and affects the work efficiency of developers.
[0005] The present application provides a method for generating an animation, including:
[0006] Obtain an elastic material simulation component, wherein the elastic material simulation component includes an elastic node list and a collision node list;
[0007] The elastic node list includes a plurality of elastic nodes, each of the elastic nodes includes first node information, the elastic node is a node generated according to a bone node of a bone bound to a first target object, and the first target object is an elastic object;
[0008] The collision point list includes a plurality of collision nodes, each of which includes second node information, and the collision node is a node generated according to a bone node of a bone bound to a second target object, and the second target object is a rigid object;
[0009] For each elastic node in the elastic node list, calculating the collision result between the elastic node and each collision node in the collision node list in turn, and determining the position of the elastic node to be displayed in the current animation frame according to the collision result;
[0010] The current animation frame is rendered according to the to-be-displayed position of the elastic node.
[0011] Optionally, after obtaining the elastic material simulation component, the method further includes:
[0012] Establishing association relationships between the plurality of elastic nodes and each mesh of the first target object, and establishing association relationships between the plurality of collision nodes and each mesh of the second target object respectively;
[0013] The first target object and the second target object are virtual objects included in the animation to be displayed.
[0014] Optionally, for each elastic node in the elastic node list, sequentially calculating a collision result between the elastic node and each collision node in the collision node list, and determining a position of the elastic node to be displayed in the current animation frame according to the collision result, includes:
[0015] In response to the movement of the first target object, adjusting the positions of the elastic nodes corresponding to the respective grids of the first target object to obtain an updated elastic node list;
[0016] In response to the movement of the second target object, adjusting the positions of the collision nodes corresponding to the respective grids of the second target object to obtain an updated collision node list;
[0017] For each elastic node in the updated elastic node list, the collision result between the elastic node and each collision node in the updated collision node list is calculated in turn, and the position to be displayed of the elastic node in the current animation frame is determined according to the collision result.
[0018] Optionally, rendering the current animation frame according to the to-be-displayed position of the elastic node includes:
[0019] Determining, according to the to-be-displayed position of the elastic node, a target position of a target grid of a first target object corresponding to the elastic node;
[0020] The current animation frame is rendered according to the target position of the target grid of the first target object.
[0021] Optionally, the method further includes:
[0022] For a first target bone node of the skeleton bound to the first target object, generate a first bounding volume of the first target bone node, and use the first bounding volume as the elastic node;
[0023] For the second target bone node of the bone bound to the second target object, a second bounding volume of the second target bone node is generated, and the second bounding volume is used as the collision node.
[0024] Optionally, the first enclosing volume is a sphere, and the second enclosing volume is a capsule.
[0025] Optionally, the first node information includes: the name of the skeleton node corresponding to the elastic node, the radius of the first bounding volume corresponding to the elastic node, and the offset coordinate value of the first bounding volume relative to the corresponding skeleton node.
[0026] Optionally, the second node information includes: the name of the bone node corresponding to the collision node, the radius of the capsule head corresponding to the collision node, the height of the cylinder in the capsule, the offset coordinate value of the center of the capsule relative to the corresponding bone node, and the reference axis of the extension direction of the cylinder in the capsule.
[0027] Optionally, determining the position of the elastic node to be displayed in the current animation frame according to the collision result includes:
[0028] If the collision result is a collision, determining to adjust the position of the elastic node, and calculating the position to be displayed of the elastic node in the current animation frame;
[0029] If the collision result is that no collision occurs, it is determined that the position of the elastic node is not adjusted.
[0030] Optionally, in response to the movement of the first target object, the positions of the elastic nodes corresponding to the respective grids of the first target object are adjusted:
[0031] In response to the movement of the first target object, controlling the elastic node to reset to an initial rotation angle, and obtaining the world coordinates and world rotation angle of the elastic node;
[0032] Calculate the rigid force and air resistance of the elastic node respectively through the coordinates of the elastic node in the two animation frames before the current animation frame and the world coordinates;
[0033] The resultant force received by the elastic node is obtained by synthesizing the rigid force, the air resistance and the gravity received by the elastic node;
[0034] Obtaining the adjusted coordinates of the elastic node in the current animation frame according to the resultant force received by the elastic node, the coordinates of the elastic node in the two animation frames before the current animation frame, and the time increment between animation frames;
[0035] The position of the elastic node is adjusted according to the adjustment coordinates.
[0036] The present application also provides a device for generating an animation, comprising:
[0037] An acquisition unit is used to acquire an elastic material simulation component, wherein the elastic material simulation component includes an elastic node list and a collision node list; wherein the elastic node list includes a plurality of elastic nodes, each of which includes first node information, and the elastic node is a node generated according to a bone node of a bone bound to a first target object, and the first target object is an elastic object; the collision node list includes a plurality of collision nodes, each of which includes second node information, and the collision node is a node generated according to a bone node of a bone bound to a second target object, and the second target object is a rigid object;
[0038] a determination unit, configured to calculate, for each elastic node in the elastic node list, a collision result between the elastic node and each collision node in the collision node list in turn, and determine a position of the elastic node to be displayed in a current animation frame according to the collision result;
[0039] A rendering unit is used to render the current animation frame according to the to-be-displayed position of the elastic node.
[0040] The present application also provides a terminal device, including a processor and a memory; wherein,
[0041] The memory is used to store one or more computer instructions; the processor is used to execute the computer executable instructions:
[0042] Obtain an elastic material simulation component, wherein the elastic material simulation component includes an elastic node list and a collision node list;
[0043] The elastic node list includes a plurality of elastic nodes, each of the elastic nodes includes first node information, the elastic node is a node generated according to a bone node of a bone bound to a first target object, and the first target object is an elastic object;
[0044] The collision node list includes a plurality of collision nodes, each of the collision nodes includes second node information, the collision node is a node generated according to a bone node of a bone bound to a second target object, and the second target object is a rigid object;
[0045] For each elastic node in the elastic node list, calculating the collision result between the elastic node and each collision node in the collision node list in turn, and determining the position of the elastic node to be displayed in the current animation frame according to the collision result;
[0046] The current animation frame is rendered according to the to-be-displayed position of the elastic node.
[0047] The present application also provides a non-volatile storage medium on which one or more computer instructions are stored, and the instructions can be read and executed by a processor:
[0048] Obtain an elastic material simulation component, wherein the elastic material simulation component includes an elastic node list and a collision node list;
[0049] The elastic node list includes a plurality of elastic nodes, each of the elastic nodes includes first node information, the elastic node is a node generated according to a bone node of a bone bound to a first target object, and the first target object is an elastic object;
[0050] The collision node list includes a plurality of collision nodes, each of the collision nodes includes second node information, the collision node is a node generated according to a bone node of a bone bound to a second target object, and the second target object is a rigid object;
[0051] For each elastic node in the elastic node list, calculating the collision result between the elastic node and each collision node in the collision node list in turn, and determining the position of the elastic node to be displayed in the current animation frame according to the collision result;
[0052] The current animation frame is rendered according to the to-be-displayed position of the elastic node.
[0053] Compared with the prior art, the embodiments of the present application have the following advantages:
[0054] An embodiment of the present application provides a method for animation generation, including obtaining an elastic material simulation component, wherein the elastic material simulation component includes an elastic node list and a collision node list; wherein the elastic node list includes multiple elastic nodes, each of the elastic nodes includes first node information, and the elastic node is a node generated according to a bone node of a bone bound to a first target object, and the first target object is an elastic object; the collision point list includes multiple collision nodes, each of the collision nodes includes second node information, and the collision node is a node generated according to a bone node of a bone bound to a second target object, and the second target object is a rigid object; for each elastic node in the elastic node list, the collision result between the elastic node and each collision node in the collision node list is calculated in turn, and the position of the elastic node to be displayed in the current animation frame is determined according to the collision result; and the current animation frame is rendered according to the position to be displayed of the elastic node. The method provided by the present application uses the skeleton nodes of the virtual human asset itself as the basis for animation simulation, so that the animation simulation effect of elastic cloth objects can be realized by relying on the virtual human asset itself. In this way, in the process of cross-platform transfer of virtual human assets, as long as the relevant data of the elastic cloth objects is transferred along with the virtual human asset as a plug-in, for example, by transferring it through a configuration table, the animation generation of the elastic cloth can be conveniently realized; therefore, the solution provided by the present application can realize the loading of cloth animation on different game engines by loading the plug-in and the configuration table, which can reduce the repeated configuration work of developers on different platforms and ensure that the cloth animation simulation effects of different game engines are basically consistent. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0056] Figure 1 It is a schematic diagram of a virtual character in the game;
[0057] Figure 2 is a flow chart of an animation generation method provided by an embodiment of the present application;
[0058] Figure 3 This is a flow chart of elastic node generation provided by an embodiment of the present application;
[0059] Figure 4 This is a schematic diagram of an attribute record of an elastic node provided by an embodiment of the present application;
[0060] Figure 5 This is a flowchart of collision node generation provided by an embodiment of the present application;
[0061] Figure 6 This is a schematic diagram of attribute records of a collision node provided by an embodiment of the present application;
[0062] Figure 7 is a schematic diagram of a virtual human enclosing volume provided by an embodiment of the present application;
[0063] Figure 8 is a flow chart of adjusting the position of an elastic node provided by an embodiment of the present application;
[0064] Fig. 9 is a schematic diagram of a rigid force provided by an embodiment of the present application;
[0065] Fig.10 This is a schematic diagram of an elastic cloth node provided by an embodiment of the present application when a collision occurs between the elastic cloth node and the collision node;
[0066] Fig.11 is a block diagram of an animation generating device provided by an embodiment of the present application;
[0067] Fig.12 It is a schematic diagram of the logical structure of a game terminal provided in one embodiment of the present application. DETAILED DESCRIPTION
[0068] In order to enable those skilled in the art to better understand the technical solution of the present application, the present application is described clearly and completely below in conjunction with the drawings in the embodiments of the present application. However, the present application can be implemented in many other ways different from the above description. Therefore, based on the embodiments provided by the present application, all other embodiments obtained by those of ordinary skill in the art without creative work should fall within the scope of protection of the present application.
[0069] It should be noted that the terms "first", "second" and "third" in the various parts and drawings of the embodiments of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. Such data can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than that illustrated or described herein. The terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0070] The present application provides an embodiment of a method for generating an animation. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0071] Before introducing the method for generating animations provided by the present application, the relevant background of the scheme is introduced first. A game engine refers to the core components of some pre-written editable computer game systems or some interactive real-time image applications, the purpose of which is to allow game designers to easily and quickly make game programs without starting from scratch. The engine is equivalent to the framework of the game. Today's game engines have developed into a complex system composed of multiple subsystems, from modeling, animation to light and shadow, particle effects, from physical systems, collision detection to file management, network characteristics, as well as professional editing tools and plug-ins, covering almost all important links in the development process. A game engine is a set of codes (instructions) that can be recognized by a machine and designed for a machine running a certain type of game. It is like an engine that controls the operation of the game. A game work can be divided into two parts: game engine and game resources. Game resources include images, sounds, animations, etc., that is, game = engine (program code) + resources (images, sounds, animations, etc.). The game engine calls these resources sequentially according to the requirements of game design. Game engines have undergone changes over the times. Now there are several well-known engine companies in the game industry, such as Unreal Engine, Frostbite Engine, Unity 3D, RageEngine, Source Engine, etc.
[0072] Virtual humans are the representation of geometric and behavioral characteristics of humans in a computer-generated space (virtual environment), which involves computer graphics. To accurately reproduce humans in a three-dimensional virtual space, it is necessary not only to simulate the appearance of the human body, but also to simulate realistic movements, so as to give people a sense of reality and intimacy. In today's game virtual humans, the requirements for realistic hair animation, skin processing, clothing fluttering, movements, etc. are getting higher and higher. These parts need to be specially designed with special animation processing according to their characteristics in order to achieve realistic animation effects and effectively reduce the amount of calculation.
[0073] Therefore, performing elastic cloth animation in games is an important and critical task. In this application, the elastic object mainly refers to a slender soft object that can dance with the movement of the virtual character or the blowing of the wind in the animation, such as the ribbon of clothes, the braid of the character, etc.
[0074] Reference Figure 1 , shows a virtual human image in a game, as shown in Figure 1-1, the virtual human's braid is a typical elastic object mentioned in this application.
[0075] The first embodiment of the present application provides a method for generating an animation. The application subject of the method can be a bottom-level computing application that can be used by a game design subject (game designer) to implement game engine configuration. The bottom-level computing application can be called by the game engine to achieve animation effects of elastic objects.
[0076] Figure 2 This is a flowchart of an animation generation method provided in the first embodiment of the present application. Figure 2 A method for generating an animation provided by this embodiment is described in detail. The embodiments described below are used to explain the principle of the method and are not intended to be limiting in actual use.
[0077] like Figure 2 As shown, an animation generation method provided in this embodiment includes:
[0078] Step S202, obtaining an elastic material simulation component, wherein the elastic material simulation component includes an elastic node list and a collision node list.
[0079] S202-1, the elastic node list includes a plurality of elastic nodes, each of the elastic nodes includes first node information, the elastic nodes are nodes generated according to the bone nodes of the bones bound to the first target object, and the first target object is an elastic object.
[0080] The first target object is an elastic object, including but not limited to clothing, hair, ribbons of virtual objects of human characters, or long hair of virtual objects of animal characters. Typically, in the virtual characters of the game, the virtual people often have long flowing hair, complex and smart headdresses, and long clothes with a fairy-like style. When it moves in the game, such as walking, running, jumping, etc., the movement of the virtual object will transfer a certain amount of movement to the cloth model of the clothing, and the clothing cloth, such as cloaks, hems of clothes, and ribbons on hair should have dynamic effects such as fluttering. In order to increase the authenticity of the cloth animation corresponding to the clothing, the physical grid of the cloth model is not only driven by the skeleton, but also needs to increase the driving simulation of the cloth to realize the physical simulation calculation of the cloth simulation, so that the clothing cloth has a real and credible dynamic movement effect in the animation, and will not follow the movement of the virtual object in a rigid way, nor will the movement amplitude be too large to cause the clothing to penetrate the virtual object.
[0081] The skeleton nodes are points that are set on the virtual human in a hierarchical relationship and arranged in a tree structure when making an animation model. These points form a description of the character skeleton. The so-called skeleton here should be understood in a broad sense, for example, Figure 1 The braid of the virtual person is the first target object of the elastic cloth class, and its extension direction is also described through a series of bone nodes.
[0082] The elastic node is a node generated according to the bone node of the bone bound to the first target object. For the first target bone node of the bone bound to the first target object, a first enclosing volume of the first target bone node is generated, and the first enclosing volume is used as the elastic node. In actual animation generation, multiple elastic nodes are set, and multiple first node information contained in the multiple elastic nodes constitute an elastic node list. Figure 3 The diagram shows the process of generating an elastic node.
[0083] S202-1a, selecting a target bone node on the first target object as the selected first target bone node.
[0084] A predetermined number of bone nodes are selected from the bone nodes when making an animation model. The number of first target bone nodes selected needs to be based on the game designer's requirements for accuracy and the balance between the complexity of calculations. Generally, the number of bone nodes for binding bones is multiple, and the number of first target bone nodes is also multiple.
[0085] S202-1b, based on the first target skeleton node, generate a first bounding volume of the first target skeleton node, use the first bounding volume as the elastic node, and each elastic node contains first node information.
[0086] The bounding volume refers to a closed space that surrounds the skeleton node; this solution encapsulates complex objects in simple bounding volumes. Since simple objects are easier to check for overlap with each other, it is easier to check the overlap between elastic fabric and other objects by using this bounding volume. The bounding volume of a group of objects is also a closed space that contains an object and its surrounding environment. It can be used to represent a non-empty, finite single object. The geometric shape of the bounding volume is relatively simple, and the object is usually composed of polygons or data structures simplified to polygonal approximations, so the inspection of the bounding volume is usually faster than the inspection of the object itself. For example, in collision detection, if two bounding volumes do not intersect, the contained objects will not collide. In actual game animation, the bounding volume does not exist, but only exists as an auxiliary in game design.
[0087] In this embodiment, the first enclosure is usually a sphere; of course, other possible forms are not excluded, for example, a barrel shape along the extension direction of the elastic fabric. The spherical enclosure is a spherical surface that encloses the object. If it is in a two-dimensional figure, it is a circle. The spherical enclosure can be represented by the center and radius. The use of a spherical enclosure can facilitate collision detection. Specifically, for two enclosures that are approaching each other in motion, if the distance between the sphere centers is less than or equal to the sum of the radii of the two, it means that the two have collided with each other, avoiding the abnormal intersection of the two objects in the animation effect, showing a non-realistic collision effect. Refer to Figure 1 In 1-1, the spherical enclosing body on the braid of the virtual character image is the elastic node. The above description is only in principle. In the actual program, the elastic node is specifically described by the first node information, so as to be implemented in the computer program.
[0088] The first node information contained in each elastic node includes: the name of the skeleton node corresponding to the elastic node, the radius of the first bounding volume corresponding to the elastic node, and the offset coordinate value of the first bounding volume relative to the corresponding skeleton node.
[0089] In S202-1, the number of elastic nodes is set to be multiple. In order to distinguish them, a name is set for each elastic node, that is, the name of the bone node corresponding to the elastic node. The set name can be standardized and unified, and the name can include the relative position and sequence number of the corresponding bone node.
[0090] For bone nodes, for example, Figure 1 The names of the nodes of the two strands of hair of the virtual person in the game are set. It is determined that the number of nodes is 6, and the two strands of hair are divided into one left and one right. When setting the name, whether the hair is on the left or right can be added to the name, and the 6 nodes are numbered 1-6 from top to bottom. Then the skeleton node names set can be named according to hair-left / right-numbering. If a hair node name is hair_L_03, it can be quickly deduced that this is the third node of the left strand of hair. For members of the game development team, reaching a unified naming consensus is helpful to improve game development efficiency. In game development, the skeleton nodes of the virtual person exist themselves, and their naming generally has a unified standard. For this embodiment, the names of the skeleton nodes corresponding to the elastic nodes can be directly used without additional naming.
[0091] After obtaining the name of the skeleton node corresponding to the elastic node, the first node information of the elastic node also includes the radius of the first bounding volume corresponding to the elastic node and the offset coordinate value of the first bounding volume relative to the corresponding skeleton node.
[0092] The first enclosing volume radius refers to the spherical radius of the spherical enclosing volume. Game developers can set the size of the spherical radius according to their own needs. The size of the spherical radius setting is related to subsequent collision detection.
[0093] The offset coordinate value of the first bounding volume relative to the corresponding bone node refers to the offset between the center of the designated area and the coordinate position of the corresponding bone node, which is expressed by the offset coordinate.
[0094] When designing a game, the game developer needs to set the first node information contained in each elastic node, that is, set the name of the target bone node corresponding to each elastic node, the radius of the first bounding volume, and the offset coordinate value of the first bounding volume relative to the corresponding bone node.
[0095] For details of the above naming process, please refer to Figure 4 , Figure 4 An example of the first node information of an elastic node is shown. It can be seen that Figure 4 The left graphic part shows a spherical enclosing volume on the braid ribbon, and the right parameter part shows the first node information of the elastic node. Specifically, the name of the elastic node is hair_L_05, which is the name of the bone node corresponding to the elastic node. It has been named when the animation model is made and is directly used when setting the name of the elastic node. The radius of the enclosing volume of the elastic node is 0.08, which means that the entire spherical enclosing volume of the elastic node exists with a radius of 0.08. Of course, in the process of setting the first node information of the elastic node, the radius of the first enclosing volume can be set. The offset coordinate value (Center) of the enclosing volume of the elastic node relative to the corresponding bone node is (0.01, 0, 0). The center of the enclosing volume has a certain coordinate value, and the first target bone node also has a certain coordinate value. The offset coordinate value is the coordinate value of the center of the enclosing volume offset from the coordinate value of the first target bone node coordinate. Because the first target bone node is not necessarily the center of the enclosing volume, that is, the spherical center coordinate of the spherical enclosing volume, there will be an offset between the two.
[0096] After the first node information of the elastic node is set, the first node information of the elastic cloth node can be further stored in the code program. As described below, a code program of the first node information of the first bounding volume of an elastic node is exemplarily shown. The first node information of the elastic node can be quickly known through the code program.
[0097] {
[0098] "name": "hair_L_05",
[0099] "radius": 0.08,
[0100] "center":{
[0101] "x": 0.01,
[0102] "y":0,
[0103] "z": 0
[0104] }
[0105] }
[0106] Through the above code program, it can be concluded that the name of the bone node corresponding to the elastic node is hair_L_05, the radius of the first bounding volume of the elastic node is 0.08, and the offset coordinate value of the first bounding volume relative to the corresponding bone node is (0.01, 0, 0).
[0107] The above steps illustrate the generation process of an elastic node in this embodiment, and the first node information of the elastic node is attached. The first node information can be set in the configuration table, and after being set in the configuration table, it can also be stored in the code program. The first node information of multiple elastic nodes forms an elastic node list, and multiple first node information can also be stored together in the code program.
[0108] S202-2, the collision node list includes multiple collision nodes, each of the collision nodes includes second node information, the collision node is a node generated according to the bone node of the bone bound to the second target object, and the second target object is a rigid object.
[0109] The second target object is a rigid object, which may be a component of a virtual human such as a body limb, for example, a torso of a virtual human, which may be a hand, a forearm, a leg, and the like.
[0110] The collision node is a node generated according to the bone node of the bone bound to the second target object. For the second target bone node of the bone bound to the second target object, a second bounding volume of the second target bone node is generated, and the second bounding volume is used as the collision node. In actual animation generation, multiple collision nodes are set, and multiple second node information is contained in the multiple collision nodes. Figure 5 The generation process of a collision node is shown.
[0111] S202-2a, selecting a target bone node on the second target object as the selected second target bone node.
[0112] In this embodiment, the second target object is described by taking the torso of the virtual person as an example. That is, the bone node at the torso of the virtual person is selected as the second target bone node. The selection method can select one or more bone nodes located at a suitable position on the torso according to the characteristics of the collision node. Generally, all bone nodes will not be the target bone nodes of the collision node, and only some representative bone nodes can be selected.
[0113] In game development, bone nodes are usually set up when making animation models, usually matching the joints of the human body. Figure 1 As a virtual human asset, its bone nodes are already determined as part of the virtual human configuration. For the upper body limbs, the upper arm, forearm, and hand from shoulder to shoulder are generally set; for the lower body limbs, the thigh, calf, and foot are generally set; for the torso, the upper body and lower body are set. If the accuracy requirement for a certain part is higher, you can make more careful and detailed settings; if the accuracy requirement for a certain part is lower, you can combine some of the above-mentioned connected parts. Therefore, for different accuracy requirements, game developers can set them according to their needs. In general, the number of selected bone nodes is multiple.
[0114] In the above virtual human, a bone node located in the middle of the torso can be selected as the target bone node, such as Figure 1-2 shown.
[0115] S202-2b, based on the second target skeleton node, generate a second bounding volume of the second target skeleton node, use the second bounding volume as the collision node, and each collision node contains second node information.
[0116] The collision node is used to represent the shape and position that may collide with the elastic node. Similar to step S202-1, the bounding volume of the second target skeleton node is also used to represent the collision node.
[0117] In this embodiment, the enclosing volume of the second target bone node adopted by the collision node is specifically a capsule. The capsule enclosing volume is an enclosing volume similar to a capsule obtained by combining and improving the spherical enclosing volume and the cylindrical enclosing volume. The capsule enclosing volume is composed of two hemispherical enclosing volumes with the same radius and a cylindrical enclosing volume with the same diameter as the hemisphere. For this embodiment, since the collision node represents the torso of the virtual person, the use of the capsule body can express the extension direction of the torso of the virtual person. In this way, a better expression of the part where the flexible cloth-like object may collide with the virtual person can be obtained by using fewer collision nodes, so as to facilitate subsequent collision calculations.
[0118] A cylindrical bounding volume is a cylinder that contains an object. In most applications, the axis of the cylinder is in the same vertical direction as the scene. A cylinder is a three-dimensional object that can only rotate around its longitudinal axis. Cylinders with two vertical axes intersect only when their projections on the vertical axis (i.e. two line segments) and their projections in the horizontal direction (i.e. two circles) intersect at the same time. A cylindrical bounding volume is usually used as a bounding volume for upright people.
[0119] In two-dimensional graphics, the two ends of the capsule body are two semicircles with the same radius, and the middle part is a rectangle with one side having the same diameter as the hemisphere, so the representation of the capsule object is represented by two centers + radius. Similar to the cylindrical body, the capsule body is also usually used for the body of upright people; compared with the cylindrical body, the capsule body is more in line with the shape of the human body, has higher detection accuracy in collision detection, and the simulated virtual character is more realistic.
[0120] The above description is only in principle. In an actual program, the collision node is specifically described through its second node information so as to be implemented in a computer program.
[0121] Similarly, in S202-2, collision nodes are set, that is, the number of nodes generated according to the bone nodes of the bones bound to the second target object is multiple. In order to distinguish them, a name is set for each second target bone node. The set name can be standardized and unified, and the name can include the relative position and location of the second target bone node.
[0122] For the second target skeletal node, for example, it is necessary to set the name of the node for the upper limbs of the virtual person, and determine that the nodes that need to be set are the upper arm, forearm and hand from the shoulder to the axis shoulder in turn, so the collision node name set can be named according to the limbs-left / right-position. If the name of a certain collision node is body_L_Hand, then it can be quickly deduced that the second target skeletal node of the skeleton bound to the collision node is the left hand. And for members of the game development team, reaching a unified naming consensus helps to improve game development efficiency. In game development, the skeletal node of the virtual person itself exists, and its naming generally also has a unified standard. For the present embodiment, the name of the corresponding second target skeletal node is directly used, and no additional naming is required.
[0123] After obtaining the target bone node name corresponding to the collision node, the second node information of the collision node also includes the radius of the capsule head corresponding to the collision node, the height of the cylinder in the capsule, the offset coordinate value of the capsule center relative to the corresponding bone node, and the reference axis of the extension direction of the cylinder in the capsule.
[0124] The capsule head radius corresponding to the collision node refers to the sphere radius of the two hemispheres in the capsule enclosure. Game developers can set the size of the sphere radius according to their own needs. The size of the sphere radius setting is related to the bottom radius of the cylindrical part of the capsule. These two factors need to be considered when setting the node radius. The size of the sphere radius setting is related to subsequent collision detection.
[0125] The cylinder height in the capsule refers to the region height. This value is invalid when it is less than 2 times the node radius, because it will make the region become spherical; it is effective when it is higher than 2 times the node radius, and the region will become a capsule.
[0126] The coordinate offset value of the capsule body center relative to the corresponding second target bone node refers to the offset between the center of the designated area and the coordinate position of the corresponding second target bone node, which is expressed in coordinates.
[0127] The reference axis of the extension direction of the cylinder in the capsule refers to the direction of the capsule in the local coordinates of the current game object. When the capsule does not exist, that is, the height of the cylinder is less than 2 times the node radius, the area is spherical, and the reference axis of the extension direction of the cylinder is invalid.
[0128] When designing a game, game developers need to set up a second node information record for each collision node, namely, the name of the second target bone node corresponding to the collision node, the radius of the capsule head corresponding to the collision node, the height of the cylinder in the capsule, the offset coordinate value of the capsule center relative to the corresponding bone node, and the reference axis of the extension direction of the cylinder in the capsule.
[0129] For details of the above naming process, please refer to Figure 6 , Figure 6 The second node information of a collision node is shown. It can be seen that Figure 6The left graphic part shows the capsule bounding volume of a collision node, and the right parameter part shows the second node parameter information of the collision node. Specifically, the name of the collision node is Bip001_L_Thigh, which is the name of the bound bone node. It has been named when the animation model is made and is directly used when setting the name of the collision node. From the name of the collision node, it can be seen that the bone node is the left thigh. The radius of the capsule head corresponding to the collision node is 0.2, which means that the hemispheres on both sides of the collision node exist with a radius of 0.2, and the cylinder radius of the cylindrical part of the capsule is also 0.2. The cylinder height (CylinderHeight) in the capsule of the collision node is 0.6. The coordinate offset value (center) of the capsule center relative to the corresponding bone node is (0, 0, 0), that is, the coordinate value of the capsule center coincides with the coordinate value of the second target bone node, and there is no offset. The reference axis (Direction) in the extension direction of the cylinder in the capsule is the X axis, that is, the direction of the cylinder height is along the X axis.
[0130] After setting the second node information of the collision node, we can store the second node information of the collision node in the code program, as described below, which exemplarily shows the code program of the second node information of the bounding volume of a collision node.
[0131] {
[0132] "name":"Bip001_L_Thigh",
[0133] "radius": 0.2,
[0134] "center":{
[0135] "x": 0,
[0136] "y":0,
[0137] "z": 0
[0138] },
[0139] "cylinderHeight": 0.6,
[0140] "direction": "X",
[0141] “part”:LEG
[0142] }
[0143] The above steps show the generation process of a collision node in this embodiment, and the second node information of the collision node is attached. The second node information can be set in the configuration table, and can be stored in the code program after being set in the configuration table. The second node information of multiple collision nodes forms a collision node list, and multiple second node information can also be stored together in the code program.
[0144] Step 202 is used to obtain two simulation components of the elastic material, namely an elastic node list and a collision node list. Through the above steps, multiple elastic node lists and multiple collision node lists are obtained. The number of elastic node lists is not necessarily related to the number of collision node lists and does not have to be equal. Figure 7 A schematic diagram of the virtual human enclosing volume is shown. Among them, the several spherical enclosing volumes on the braid are the first enclosing volumes, and the capsule enclosing volumes on the trunk, arms and hands are the second enclosing volumes. After loading the elastic node list and the collision node list, multiple first enclosing volumes and multiple second enclosing volumes will be added to the virtual human during runtime. The number of first enclosing volumes and the number of second enclosing volumes can be set according to actual needs. There is no necessary connection between the number of second enclosing volumes and the number of second enclosing volumes. Accordingly, there is no necessary connection between the number of elastic nodes and the number of collision nodes.
[0145] After obtaining the elastic material simulation component, establishing association relationships between the plurality of elastic nodes and each mesh of the first target object, and establishing association relationships between the plurality of collision nodes and each mesh of the second target object;
[0146] The first target object and the second target object are virtual objects included in the animation to be displayed.
[0147] Step S204, for each elastic node in the elastic node list, calculating the collision result between the elastic node and each collision node in the collision node list in turn, and determining the position of the elastic node to be displayed in the current animation frame according to the collision result.
[0148] S204-1, in response to the movement of the first target object, adjusting the positions of the elastic nodes corresponding to the respective grids of the first target object to obtain an updated elastic node list.
[0149] In this embodiment, the position of the elastic node is adjusted by the Verlet integration method. The Verlet integration algorithm is one of the most common integration methods in classical mechanics and is widely used in the fields of molecular dynamics simulation, planetary motion, and fabric deformation simulation. The Verlet algorithm is essentially a Taylor expansion of Newton's second law with an accuracy of O(4). It is more accurate and more stable than the Euler method, and its computational complexity is not much higher than that of the explicit Euler method. The advantage of the Verlet integration algorithm is that it does not need to calculate and retain velocity information, and various constraints can be easily added.
[0150] The following is a detailed description of the method for adjusting the position of an elastic node. For a certain elastic node, the force on the node is f(t), and the mass is known. The acceleration of the node can be obtained according to Newton's second law, that is, Taylor's formula is known to be The Taylor expansion formula of the node displacement with respect to the time increment is: From the derivative relationship between displacement, velocity, and acceleration, we can see that the Taylor expansion formula of the node displacement with respect to the time increment is: Will Imported into the Taylor expansion formula of the node displacement with respect to the time increment, we get By replacing Δt with -Δt, we can obtain Among them, the addition of r(t+Δt) and r(t-Δt) has a part that can be offset. Add them together and we get
[0151] Right now, The error is O(Δt 4 ), is of fourth order. Δt is the time increment of webGL frame rendering.
[0152] In this expression, the coordinates of the previous frame r(t-Δt), the previous frame r(t) and the current frame r(t+Δt) are linked, and the current position coordinates can be inferred from the position coordinates of the previous two frames. In other words, using the Verlet integration algorithm, when the position coordinates of two adjacent frames of a certain elastic node are known, the preliminary animation simulation effect of the elastic node can be approximated by recursive calculation. In other words, the position of the elastic node can be adjusted by moving the first target object.
[0153] According to the above analysis, the Verlet integration method can be used to calculate the position of each elastic node of the first target object in the current video frame during the animation simulation process. The steps of adjusting the position of the elastic node are described in detail below. Figure 8 A flow chart for adjusting the position of elastic nodes is shown.
[0154] S204-1a, in response to the movement of the first target object, controlling the elastic node to reset to an initial rotation angle, and obtaining the world coordinates and the world rotation angle of the elastic node.
[0155] When the animation is playing, the rotation angle of the elastic node must be reset to the initial rotation angle in each frame.
[0156] The initialization rotation angle is the rotation angle of the first target bone node bound by the elastic node relative to the root node when the virtual person is in the initial state. In this embodiment, a quaternion can be used to represent the rotation angle. The quaternion can be regarded as the complement of a complex number, and it has three imaginary parts. The form is as follows: q=w+xi+yj+zk, which can be written as q=s+v.
[0157] Then, the elastic node is reset to the initialization rotation angle to obtain the world coordinates and the world rotation angle of the elastic node.
[0158] The world coordinates are based on the current game scene. The center point is located in the current game scene as the coordinate origin. Taking the coordinate origin as a reference, the coordinates of a certain point of a certain game object can be obtained accordingly; the coordinates of the game object can be obtained, which are the world coordinates.
[0159] The world rotation angle is the rotation angle of a game object in the world coordinates relative to the rotation angle of the scene root node.
[0160] The root node refers to the highest level node among the skeletal nodes with a hierarchical relationship and arranged in a tree structure set on the virtual human when making an animation model. There is only one root node when setting the elastic node.
[0161] S204-1b, respectively calculating the rigid force and air resistance of the elastic node through the coordinates of the elastic node in the two animation frames before the current animation frame and the world coordinates.
[0162] The stiffnessForce is a force that maintains the original state, and is the force of the current coordinates relative to the adjacent bone nodes.
[0163] For this embodiment, the direction of the rigid force is the direction axis of the bone node along the braid, see Fig. 9 , showing the direction of the rigid force. The X-axis direction of the bone node is the direction of the rigid force, and the magnitude of this force determines the rigidity of the braid. The greater the force, the stiffer the braid, and the less likely the braid will flutter when the avatar is moving.
[0164] The air resistance (dragForce) is a force opposite to the speed direction; for this embodiment, it is a force that prevents the braid from floating, and can be calculated based on the coordinates of the skeleton node from the previous frame to the current frame.
[0165] S204-1c, synthesizing the rigid force, the air resistance and the gravity received by the elastic node to obtain a resultant force received by the elastic node.
[0166] The resultant force obtained by synthesizing the rigid force, air resistance and gravity on the elastic cloth node is:
[0167] S204-1d, obtaining the adjusted coordinates of the elastic node in the current animation frame according to the resultant force on the elastic node, the coordinates of the elastic node in the two animation frames before the current animation frame, and the time increment between animation frames;
[0168] Bring the resultant force on the current elastic node, the coordinates of the current elastic node in the two animation frames before the current animation frame, and the time increment into The current frame coordinates of the current elastic node after adjustment can be obtained from the Verlet integration formula.
[0169] S204-1e: Adjust the position of the elastic node according to the adjustment coordinates.
[0170] In the above steps, the coordinates of the current frame are obtained, and the positions of the elastic nodes are adjusted according to the adjusted coordinates of the current frame to obtain an updated elastic node list.
[0171] S204-2, in response to the movement of the second target object, adjusting the positions of the collision nodes corresponding to the respective grids of the second target object to obtain an updated collision node list.
[0172] In the above steps, the coordinates of the current frame are obtained, and the positions of the collision nodes are adjusted according to the adjusted coordinates of the current frame to obtain an updated collision node list.
[0173] S204-3, for each elastic node in the updated elastic node list, calculate the collision result between the elastic node and each collision node in the updated collision node list in turn, and determine the position of the elastic node to be displayed in the current animation frame according to the collision result.
[0174] The updated elastic node lists are obtained by S204 - 1 and S204 - 2 , respectively. In this step, the collision result between each updated elastic node and each collision node is calculated.
[0175] If the collision result is a collision, it is determined that the position of the elastic node is adjusted, and the position to be displayed of the elastic node in the current animation frame is calculated; if the collision result is no collision, it is determined not to adjust the position of the elastic node.
[0176] In this embodiment, according to the setting mode of the bounding volume of the elastic node and the collision node, the collision conflict is determined by using the collision detection mode of the sphere and the capsule. Fig.10 , which shows a schematic diagram of a collision between an elastic node and a collision node.
[0177] By determining the shortest distance from the center of the sphere (x0, y0, z0) to the center axis of the capsule and the size of (r1+r2), we can determine whether there is a collision. Fig. 9 As shown, line segment 10-1 represents the central axis of the capsule, and line segment 10-2 represents the shortest distance D from the center of the sphere (x0, y0, z0) to the central axis: if D^2 is less than or equal to (r1+r2)^2, there is a collision and the position of the sphere needs to be changed; if D^2 is greater than (r1+r2)^2, there is no collision.
[0178] When D^2 is less than or equal to (r1+r2)^2, that is, the elastic node collides with the collision node, the position of the elastic node is changed until it is in a position where no collision conflict occurs, and this position is used as the position to be displayed of the current elastic node in the current animation frame.
[0179] S206: Render the current animation frame according to the to-be-displayed position of the elastic node.
[0180] Determining, according to the to-be-displayed position of the elastic node, a target position of a target grid of a first target object corresponding to the elastic node;
[0181] The current animation frame is rendered according to the target position of the target grid of the first target object.
[0182] Thus, the first embodiment of the present application provides a method for generating an animation, which utilizes the Verlet integration method to simulate and implement the fluttering animation of elastic cloth-like objects, making the fluttering process more vivid and lifelike.
[0183] Corresponding to the animation generation method provided in the first embodiment, the second embodiment of the present application provides an animation generation device.
[0184] Reference Fig.11 , which shows a flow chart of an animation generation device provided by the second embodiment of the present application. Since the device embodiment is basically similar to the method embodiment, it is briefly described, and the relevant parts can refer to the corresponding description of the method embodiment.
[0185] Fig.11 The device for generating an animation shown comprises:
[0186] An acquisition unit 1101 is used to acquire an elastic material simulation component, wherein the elastic material simulation component includes an elastic node list 1102 and a collision node list 1103; wherein the elastic node list includes a plurality of elastic nodes, each of which includes first node information, and the elastic node is a node generated according to a bone node of a bone bound to a first target object, and the first target object is an elastic object; the collision node list includes a plurality of collision nodes, each of which includes second node information, and the collision node is a node generated according to a bone node of a bone bound to a second target object, and the second target object is a rigid object;
[0187] The determining unit 1104 is used to calculate, for each elastic node in the elastic node list, a collision result between the elastic node and each collision node in the collision node list in turn, and determine a position of the elastic node to be displayed in the current animation frame according to the collision result;
[0188] The rendering unit 1106 is configured to render the current animation frame according to the to-be-displayed position of the elastic node.
[0189] After obtaining the elastic material simulation component, the method further includes:
[0190] Establishing association relationships between the plurality of elastic nodes and each mesh of the first target object, and establishing association relationships between the plurality of collision nodes and each mesh of the second target object respectively;
[0191] The first target object and the second target object are virtual objects included in the animation to be displayed.
[0192] The step of calculating, for each elastic node in the elastic node list, a collision result between the elastic node and each collision node in the collision node list in sequence, and determining a position of the elastic node to be displayed in the current animation frame according to the collision result includes:
[0193] In response to the movement of the first target object, adjusting the positions of the elastic nodes corresponding to the respective grids of the first target object to obtain an updated elastic node list;
[0194] In response to the movement of the second target object, adjusting the positions of the collision nodes corresponding to the respective grids of the second target object to obtain an updated collision node list;
[0195] For each elastic node in the updated elastic node list, the collision result between the elastic node and each collision node in the updated collision node list is calculated in turn, and the position to be displayed of the elastic node in the current animation frame is determined according to the collision result.
[0196] The rendering of the current animation frame according to the to-be-displayed position of the elastic node includes:
[0197] Determining, according to the to-be-displayed position of the elastic node, a target position of a target grid of a first target object corresponding to the elastic node;
[0198] The current animation frame is rendered according to the target position of the target grid of the first target object.
[0199] The method further comprises:
[0200] For a first target bone node of the skeleton bound to the first target object, generate a first bounding volume of the first target bone node, and use the first bounding volume as the elastic node;
[0201] For the second target bone node of the bone bound to the second target object, a second bounding volume of the second target bone node is generated, and the second bounding volume is used as the collision node.
[0202] The first enclosing volume is a sphere, and the second enclosing volume is a capsule.
[0203] The first node information includes: the name of the skeleton node corresponding to the elastic node, the radius of the first bounding volume corresponding to the elastic node, and the offset coordinate value of the first bounding volume relative to the corresponding skeleton node.
[0204] The second node information includes: the name of the bone node corresponding to the collision node, the radius of the capsule head corresponding to the collision node, the height of the cylinder in the capsule, the offset coordinate value of the center of the capsule relative to the corresponding bone node, and the reference axis of the extension direction of the cylinder in the capsule.
[0205] The step of determining the position of the elastic node to be displayed in the current animation frame according to the collision result includes:
[0206] If the collision result is a collision, determining to adjust the position of the elastic node, and calculating the position to be displayed of the elastic node in the current animation frame;
[0207] If the collision result is that no collision occurs, it is determined that the position of the elastic node is not adjusted.
[0208] In response to the movement of the first target object, the positions of the elastic nodes corresponding to the respective grids of the first target object are adjusted:
[0209] In response to the movement of the first target object, controlling the elastic node to reset to an initial rotation angle, and obtaining the world coordinates and world rotation angle of the elastic node;
[0210] Calculate the rigid force and air resistance of the elastic node respectively through the coordinates of the elastic node in the two animation frames before the current animation frame and the world coordinates;
[0211] The resultant force received by the elastic node is obtained by synthesizing the rigid force, the air resistance and the gravity received by the elastic node;
[0212] Obtaining the adjusted coordinates of the elastic node in the current animation frame according to the resultant force received by the elastic node, the coordinates of the elastic node in the two animation frames before the current animation frame, and the time increment between animation frames;
[0213] The position of the elastic node is adjusted according to the adjustment coordinates.
[0214] The third embodiment of the present application provides a terminal device, including a processor 1201 and a memory 1202. Fig.12 FIG. 2 is a schematic diagram showing the logical structure of a terminal device provided in the third embodiment of the present application. The memory is used to store one or more computer instructions to implement the method described in the first embodiment.
[0215] The fourth embodiment of the present application provides a non-volatile readable storage medium, on which one or more computer instructions are stored; these instructions are executed by a processor to implement the method described in the first embodiment above.
[0216] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0217] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0218] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0219] 2. Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0220] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
Claims
1. A method for generating an animation, characterized in that: include: Obtain an elastic material simulation component, wherein the elastic material simulation component includes an elastic node list and a collision node list; The elastic node list includes a plurality of elastic nodes, each of the elastic nodes includes first node information, the elastic node is a node generated according to a bone node of a bone bound to a first target object, and the first target object is an elastic object; The collision node list includes a plurality of collision nodes, each of the collision nodes includes second node information, the collision node is a node generated according to a bone node of a bone bound to a second target object, and the second target object is a rigid object; For each elastic node in the elastic node list, calculating the collision result between the elastic node and each collision node in the collision node list in turn, and determining the position of the elastic node to be displayed in the current animation frame according to the collision result, wherein the first target object and the second target object are virtual objects included in the animation to be displayed; The current animation frame is rendered according to the to-be-displayed position of the elastic node.
2. The method according to claim 1, characterized in that After obtaining the elastic material simulation component, the method further includes: The association relationships between the plurality of elastic nodes and the respective meshes of the first target object and the association relationships between the plurality of collision nodes and the respective meshes of the second target object are established respectively.
3. The method according to claim 2, characterized in that The step of calculating, for each elastic node in the elastic node list, a collision result between the elastic node and each collision node in the collision node list in sequence, and determining a position of the elastic node to be displayed in the current animation frame according to the collision result includes: In response to the movement of the first target object, adjusting the positions of the elastic nodes corresponding to the respective grids of the first target object to obtain an updated elastic node list; In response to the movement of the second target object, adjusting the positions of the collision nodes corresponding to the respective grids of the second target object to obtain an updated collision node list; For each elastic node in the updated elastic node list, the collision result between the elastic node and each collision node in the updated collision node list is calculated in turn, and the position to be displayed of the elastic node in the current animation frame is determined according to the collision result.
4. The method according to claim 3, characterized in that The rendering of the current animation frame according to the to-be-displayed position of the elastic node includes: Determining, according to the to-be-displayed position of the elastic node, a target position of a target grid of a first target object corresponding to the elastic node; The current animation frame is rendered according to the target position of the target grid of the first target object.
5. The method according to claim 1, characterized in that The method further comprises: For a first target bone node of the skeleton bound to the first target object, generate a first bounding volume of the first target bone node, and use the first bounding volume as the elastic node; For the second target bone node of the bone bound to the second target object, a second bounding volume of the second target bone node is generated, and the second bounding volume is used as the collision node.
6. The method according to claim 5, characterized in that The first enclosing volume is a sphere, and the second enclosing volume is a capsule.
7. The method according to claim 6, characterized in that The first node information includes: the name of the skeleton node corresponding to the elastic node, the radius of the first bounding volume corresponding to the elastic node, and the offset coordinate value of the first bounding volume relative to the corresponding skeleton node.
8. The method according to claim 6, characterized in that The second node information includes: the name of the bone node corresponding to the collision node, the radius of the capsule head corresponding to the collision node, the height of the cylinder in the capsule, the offset coordinate value of the center of the capsule relative to the corresponding bone node, and the reference axis of the extension direction of the cylinder in the capsule.
9. The method according to claim 1, characterized in that: The step of determining the position of the elastic node to be displayed in the current animation frame according to the collision result includes: If the collision result is a collision, determining to adjust the position of the elastic node, and calculating the position to be displayed of the elastic node in the current animation frame; If the collision result is that no collision occurs, it is determined that the position of the elastic node is not adjusted.
10. The method according to claim 3, characterized in that In response to the movement of the first target object, the positions of the elastic nodes corresponding to the respective grids of the first target object are adjusted: In response to the movement of the first target object, controlling the elastic node to reset to an initial rotation angle, and obtaining the world coordinates and world rotation angle of the elastic node; Calculate the rigid force and air resistance of the elastic node respectively through the coordinates of the elastic node in the two animation frames before the current animation frame and the world coordinates; The resultant force received by the elastic node is obtained by synthesizing the rigid force, the air resistance and the gravity received by the elastic node; Obtaining the adjusted coordinates of the elastic node in the current animation frame according to the resultant force received by the elastic node, the coordinates of the elastic node in the two animation frames before the current animation frame, and the time increment between animation frames; The position of the elastic node is adjusted according to the adjustment coordinates.
11. An animation generating device, characterized in that: include: An acquisition unit is used to acquire an elastic material simulation component, wherein the elastic material simulation component includes an elastic node list and a collision node list; wherein the elastic node list includes a plurality of elastic nodes, each of which includes first node information, and the elastic node is a node generated according to a bone node of a bone bound to a first target object, and the first target object is an elastic object; the collision node list includes a plurality of collision nodes, each of which includes second node information, and the collision node is a node generated according to a bone node of a bone bound to a second target object, and the second target object is a rigid object, wherein the first target object and the second target object are virtual objects included in the animation to be displayed; a determination unit, configured to calculate, for each elastic node in the elastic node list, a collision result between the elastic node and each collision node in the collision node list in turn, and determine a position of the elastic node to be displayed in a current animation frame according to the collision result; A rendering unit is used to render the current animation frame according to the to-be-displayed position of the elastic node.
12. A terminal device, characterized in that: comprising a processor and a memory; wherein, The memory is used to store one or more computer instructions; The processor is configured to execute the one or more computer instructions to implement the method according to any one of claims 1-10.
13. A non-volatile storage medium having one or more computer instructions stored thereon, characterized in that: The instruction can be read and executed by a processor to implement the method according to any one of claims 1 to 10.
