Animation generation method and device, equipment, storage medium and program product
By obtaining polylines on the three-dimensional model and calculating the force and velocity changes of the special effect particles, the problem of low animation generation efficiency in the existing technology is solved, and more efficient and real-time animation generation is achieved, which is suitable for a variety of animation scenes.
Patent Information
- Application Number
- CN202310478896.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2024-11-01
AI Technical Summary
The prior art generates high-fidelity three-dimensional hair animations with low analysis efficiency and cannot meet real-time requirements, especially in terms of motion trajectory calculations and collision analysis between multiple hairs.
By obtaining the polyline of the banded three-dimensional model bound to the specified three-dimensional model, determining the force value of the special effect particles based on the movement speed and direction, calculating the velocity change amount, and then generating an animation accompanying the movement of the three-dimensional model, using polyline grouping and parallel analysis To improve efficiency.
It improves the real-time and efficiency of animation generation, and can generate high-quality animations more timely, making the animation generation method of strip three-dimensional models suitable for a wider range of scenes.
Smart Images

Figure CN118887252A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to an animation generation method, apparatus, device, storage medium and program product. Background Art
[0002] Computer graphics technology is a branch of applied computer science and is widely used in the fields of gaming and modeling. In recent years, with the explosion of virtual digital objects in the field of modeling, high-quality virtual digital objects have received more and more attention, among which high-fidelity three-dimensional (3D) hair can significantly enhance the realism of virtual digital objects.
[0003] In the related technology, a simulation method based on a point-line model is usually used to model the hair into multiple line segments of finite length. Each line segment is composed of a certain number of particles and lines connecting adjacent particles. The movement of the hair is calculated by comprehensively analyzing the processing conditions between multiple particles.
[0004] However, the above analysis method usually needs to comprehensively calculate the motion trajectories of a large number of hairs by considering the motion conditions between multiple hairs. It is necessary to consider not only the collision between hairs but also the collision of multiple particles on a hair. The amount of data analyzed is large and the analysis efficiency is low, so it cannot be well applied to animation generation scenarios with high real-time requirements. Summary of the invention
[0005] The embodiments of the present application provide an animation generation method, device, equipment, medium and program product, which can improve the calculation and analysis efficiency while ensuring the accuracy of trajectory calculation, and generate a moving animation accompanying the movement of a specified three-dimensional model in a more real-time and efficient manner. The technical solution is as follows.
[0006] In one aspect, a method for generating an animation is provided, the method comprising:
[0007] Acquire multiple broken lines corresponding to strip-shaped three-dimensional models, wherein the broken lines include multiple special effect particles, and the strip-shaped three-dimensional models are bound to the specified three-dimensional model;
[0008] For a target fold line among the multiple fold lines, in response to the movement of the designated three-dimensional model at the i-th moment, based on the movement speed and movement direction of the designated three-dimensional model, determine the force values corresponding to the multiple special effect particles on the target fold line at the i-th moment, the force values are used to represent the force conditions of the special effect particles on the target fold line when the designated three-dimensional model moves, wherein i is a positive integer;
[0009] Calculate the speed change of the special effect particle between the i-th moment and the i+1-th moment based on the force value, and obtain the speed changes corresponding to the plurality of special effect particles on the target fold line;
[0010] The moving trajectories corresponding to the multiple special effect particles are calculated based on the moving speeds of the special effect particles on the multiple broken lines at the i-th moment and the speed changes of the special effect particles, and an accompanying moving animation of the strip-shaped three-dimensional model accompanying the specified three-dimensional model is generated based on the moving trajectories.
[0011] In another aspect, an animation generation device is provided, the device comprising:
[0012] A broken line acquisition module, used to acquire broken lines corresponding to a plurality of strip-shaped three-dimensional models, wherein the broken lines include a plurality of special effect particles, and the strip-shaped three-dimensional models are bound to a specified three-dimensional model;
[0013] a force determination module, for determining, for a target fold line among the multiple fold lines, force values corresponding to the multiple special effect particles on the target fold line at the i-th moment in response to the movement of the designated three-dimensional model at the i-th moment, based on the movement speed and movement direction of the designated three-dimensional model, wherein the force values are used to represent the force conditions of the special effect particles on the target fold line when the designated three-dimensional model moves, wherein i is a positive integer;
[0014] A speed determination module, used for calculating the speed change of the special effect particle between the i-th moment and the (i+1)-th moment based on the force value, and obtaining the speed changes corresponding to the plurality of special effect particles on the target fold line;
[0015] The trajectory calculation module is used to calculate the movement trajectories corresponding to the multiple special effect particles respectively based on the movement speed of the special effect particles on the multiple broken lines at the i-th moment and the speed change of the special effect particles, and generate an accompanying movement animation of the strip-shaped three-dimensional model accompanying the specified three-dimensional model based on the movement trajectory.
[0016] On the other hand, a computer device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the animation generation method as described in any of the above-mentioned embodiments of the present application.
[0017] On the other hand, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the animation generation method as described in any of the above-mentioned embodiments of the present application.
[0018] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the animation generation method described in any of the above embodiments.
[0019] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0020] Taking the analysis of the target broken line among multiple broken lines as an example, the force values corresponding to the multiple special effect particles on the target broken line are determined based on the moving speed and moving direction of the specified three-dimensional model at the i-th moment, so as to calculate the speed change of the special effect particles, and then calculate the moving trajectories corresponding to the multiple special effect particles based on the moving speed and speed change of the special effect particles. To avoid the problem of poor analysis efficiency caused by directly performing comprehensive analysis on multiple broken lines, the speed change corresponding to the multiple special effect particles on the broken line is determined after analyzing the multiple broken lines separately, and then the multiple broken lines are comprehensively analyzed on the basis of the separate analysis of the multiple broken lines, which can improve the efficiency of calculation and analysis, generate the accompanying moving animation accompanying the movement of the specified three-dimensional model in a more real-time and efficient manner, improve the timeliness of animation generation, and enable the animation generation method of the strip three-dimensional model to be applied to a wider range of scenarios. 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 ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;
[0023] Figure 2 is a flowchart of an animation generation method provided by an exemplary embodiment of the present application;
[0024] Figure 3 is a flowchart of an animation generation method provided by another exemplary embodiment of the present application;
[0025] Figure 4 is a schematic diagram of a broken line corresponding to a strip-shaped three-dimensional model provided by an exemplary embodiment of the present application;
[0026] Figure 5 is a schematic diagram of calculating the force value of special effect particles provided by an exemplary embodiment of the present application;
[0027] Figure 6 is a schematic diagram of directly grouping special effect particles provided by an exemplary embodiment of the present application;
[0028] Figure 7 is a schematic diagram of grouping special effect particles in an overlapping grouping manner provided by an exemplary embodiment of the present application;
[0029] Figure 8 is a flowchart of an animation generation method provided by another exemplary embodiment of the present application;
[0030] Fig. 9 is a schematic diagram of the step length comparison of time steps provided by an exemplary embodiment of the present application;
[0031] Fig.10 is a schematic diagram of a designated three-dimensional model moving along a trajectory route provided by an exemplary embodiment of the present application;
[0032] Fig.11 is a flowchart of an animation generation method provided by another exemplary embodiment of the present application;
[0033] Fig.12 is a flowchart of configuring a game engine provided by an exemplary embodiment of the present application;
[0034] Fig.13 is a diagram of a setting interface of virtual hair parameters provided by an exemplary embodiment of the present application;
[0035] Fig.14 is a schematic diagram of an interface for previewing a movement animation of virtual hair accompanying movement of a virtual head provided by an exemplary embodiment of the present application;
[0036] Fig.15 is a structural block diagram of an animation generating device provided by an exemplary embodiment of the present application;
[0037] Fig.16 It is a structural block diagram of a server provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0039] First, a brief introduction is given to the terms involved in the embodiments of the present application.
[0040] Graphics Processing Unit (GPU): Also known as display core, video processor, display chip or graphics chip, it is a microprocessor that specializes in performing graphics operations on personal computers, workstations, game consoles and some mobile devices (such as tablets, smartphones, etc.). GPUs have hundreds or thousands of cores and are optimized to run a large number of calculations in parallel. GPUs are well known for 3D rendering in games, and are also particularly useful for running analytics, deep learning and machine learning algorithms. Some calculations allowed in GPUs are 10 to 100 times faster than running the same calculations on traditional central processing units (CPUs).
[0041] In the related art, a simulation method based on a point-line model is usually used to model the hair into multiple line segments of finite length, each line segment is composed of a certain number of particles and lines connecting adjacent particles, and the movement of the hair is calculated by comprehensively analyzing the processing conditions between multiple particles. However, the above analysis method usually needs to comprehensively calculate the movement trajectories of a large number of hairs by combining the movement conditions between multiple hairs. It not only needs to consider the collision between hairs, but also the collision of multiple particles on a hair. The amount of data analyzed is large and the analysis efficiency is low, which cannot be well applied to animation generation scenarios with high real-time requirements.
[0042] In an embodiment of the present application, a broken line corresponding to a plurality of strip-shaped three-dimensional models bound to a specified three-dimensional model is obtained, and the broken line includes a plurality of special effect particles; for a target broken line among the plurality of broken lines, in response to the movement of the specified three-dimensional model at the i-th moment, based on the moving speed and moving direction of the specified three-dimensional model, force values corresponding to the plurality of special effect particles on the target broken line at the i-th moment are determined; based on the force value, a speed change of the special effect particles between the i-th moment and the i+1-th moment is calculated to obtain speed changes corresponding to the plurality of special effect particles on the target broken line; using the moving speed of the special effect particles on the plurality of broken lines at the i-th moment and the speed change of the special effect particles, movement trajectories corresponding to the plurality of special effect particles are calculated to obtain, and based on the movement trajectories, an accompanying movement animation of the strip-shaped three-dimensional model accompanying the movement of the specified three-dimensional model is generated. Based on the process of analyzing multiple broken lines separately, the problem of poor analysis efficiency caused by directly performing comprehensive analysis on multiple broken lines can be avoided. By analyzing multiple broken lines separately and determining the speed changes corresponding to multiple special effect particles on the broken lines, and then performing comprehensive analysis on multiple broken lines based on the separate analysis of multiple broken lines, the calculation and analysis efficiency can be improved, and an accompanying movement animation that accompanies the movement of a specified three-dimensional model can be generated more real-time and efficiently, thereby improving the timeliness of animation generation.
[0043] Based on the above animation generation method, it is possible to generate an accompanying moving animation of a strip-shaped three-dimensional model accompanying the movement of a specified three-dimensional model, and therefore it can be applied to various animation generation fields such as the field of game screen generation and the field of scene construction. For example: generating an accompanying moving animation of the hair of a virtual object accompanying the movement of a virtual head, generating an accompanying moving animation of the grass and trees in a virtual environment shaking with the ground, generating an accompanying moving animation of the hair of a virtual animal accompanying the movement of the virtual animal, etc. It is worth noting that the above animation generation fields and animation generation scenes are only illustrative examples, and this application does not limit them.
[0044] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards in the relevant regions. For example, the data content such as the multiple strip 3D models and force values involved in this application are all obtained with full authorization.
[0045] Secondly, the implementation environment involved in the embodiments of the present application is described. The task execution method provided in the embodiments of the present application can be implemented by a terminal alone, or by a server, or by a terminal and a server through data interaction, which is not limited in the embodiments of the present application. Optionally, the task execution method interactively executed by a terminal and a server is used as an example for description.
[0046] For illustration, please refer to Figure 1 The implementation environment involves a terminal 110 and a server 120 , and the terminal 110 and the server 120 are connected via a communication network 130 .
[0047] In some embodiments, the terminal 110 has a virtual object control function, and the virtual object control function is used to control the movement of virtual objects in a virtual environment. Schematically, the terminal 110 is installed with a game application, and a player operating the terminal 110 can control the movement of virtual objects in the game in a virtual scene by operating the game application. For example, the player controls the virtual object to run, jump, turn its head, etc. in the virtual environment.
[0048] Optionally, when the player controls the movement of the virtual object, the head of the virtual object moves relative to the virtual environment, and the virtual hair bound to the virtual head also moves accordingly, wherein the virtual head is a specified three-dimensional model, and the virtual hair is a strip-shaped three-dimensional model bound to the specified three-dimensional model.
[0049] In some embodiments, the terminal 110 sends the plurality of strip-shaped three-dimensional models to the server 120 via the communication network 130, so that the server 120 obtains the plurality of strip-shaped three-dimensional models and determines the polylines corresponding to the plurality of strip-shaped three-dimensional models, that is, the server 120 obtains the polylines corresponding to the plurality of virtual hairs. The polylines include a plurality of special effect particles, and schematically, the plurality of special effect particles corresponding to each polyline are particles divided for the convenience of analyzing the virtual hair.
[0050] In some embodiments, the terminal 110 also sends control data generated by the player's control operation on the virtual object to the server 120 through the communication network 130, and the control data includes movement data such as the movement speed and movement direction of the virtual head.
[0051] Schematically, for any target fold line among the multiple fold lines, if the control data received by the server 120 indicates that the specified three-dimensional model moves at the i-th moment, the force values corresponding to the multiple special effect particles on the target fold line at the i-th moment are determined based on the moving speed and moving direction of the specified three-dimensional model. That is, the server 120 determines the force values corresponding to the multiple special effect particles on the target virtual hair at the i-th moment based on the moving speed and moving direction of the virtual head. The force value is used to represent the force condition of the special effect particles on the target fold line when the specified three-dimensional model moves, and i is a positive integer.
[0052] Optionally, after determining the force values corresponding to the special effect particles on the target fold line, the server 120 calculates the speed change of the special effect particles between the i-th moment and the i+1-th moment based on the force values, and then obtains the speed change corresponding to multiple special effect particles on the target fold line.
[0053] Optionally, the server 120 calculates the movement trajectories corresponding to the plurality of special effect particles based on the movement speeds of the special effect particles on the plurality of fold lines at the i-th moment and the speed changes of the special effect particles. Schematically, the server 120 uses the plurality of fold lines as target fold lines according to the method of analyzing the target fold line, thereby determining the speed changes corresponding to the plurality of special effect particles on the plurality of fold lines, and then comprehensively calculates the movement speeds of the special effect particles on the plurality of fold lines at the i-th moment and the speed changes of the special effect particles, and after analyzing the fold lines individually and as a whole, more efficiently and accurately calculates the movement trajectories corresponding to the plurality of special effect particles.
[0054] In some embodiments, the server 120 generates an accompanying movement animation of the strip three-dimensional model accompanying the movement of the specified three-dimensional model based on the calculated movement trajectories corresponding to the multiple special effect particles, and sends the accompanying movement animation to the terminal 110 through the communication network 130. The terminal 110 renders and displays the accompanying movement animation of the strip three-dimensional model accompanying the movement of the specified three-dimensional model on the screen, thereby realizing a more timely display of the animation of the strip three-dimensional model moving with the specified three-dimensional model.
[0055] It is worth noting that the above-mentioned terminals include but are not limited to mobile terminals such as mobile phones, tablet computers, portable laptops, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, and can also be implemented as desktop computers, etc.; the above-mentioned servers can be independent physical servers, or they can be server clusters or distributed systems composed of multiple physical servers, or they can be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.
[0056] Among them, cloud technology refers to a hosting technology that unifies hardware, application programs, networks and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool that can be used on demand and is flexible and convenient.
[0057] In some embodiments, the above server can also be implemented as a node in a blockchain system.
[0058] Combined with the above-mentioned noun introduction and application scenarios, the animation generation method provided by the present application is described, and the method is applied to the server as an example. Figure 2 As shown, the method includes the following steps 210 to 240.
[0059] Step 210, obtaining multiple broken lines corresponding to the strip-shaped three-dimensional models.
[0060] Schematically, the strip-shaped three-dimensional model is used to indicate a three-dimensional model that presents a strip shape, and the strip-shaped three-dimensional model is implemented as virtual hair, virtual flowers and plants, virtual fur, etc.
[0061] Optionally, based on factors such as the length and thickness of the strip-shaped three-dimensional model, broken lines respectively corresponding to the plurality of strip-shaped three-dimensional models are obtained.
[0062] In some embodiments, the player operates the virtual object on the terminal to make the virtual hair on the virtual object move accordingly, and the virtual hair is realized as the above-mentioned strip-shaped three-dimensional model; or, the virtual scene developer simulates the virtual grass and trees in the virtual environment and uses the virtual grass and trees as the above-mentioned strip-shaped three-dimensional model, etc.
[0063] Schematically, the terminal sends multiple strip three-dimensional models to the server, and the server obtains the broken lines corresponding to the multiple strip three-dimensional models; or, the server automatically generates multiple strip three-dimensional models based on model development, and automatically determines the broken lines corresponding to the multiple strip three-dimensional models when analyzing the strip three-dimensional models.
[0064] Each polyline includes a plurality of special effect particles.
[0065] Schematically, multiple special effect particles on a broken line are connected through particle connecting edges. When there are n special effect particles, there are n-1 particle connecting edges connecting the n special effect particles.
[0066] Optionally, the special effect particles are particles located on the fold line and used to adjust the presentation form of the fold line. For example, the special effect particles can adjust the curvature of the fold line, such as adjusting the curvature angle of two sides connecting the special effect particles; or the special effect particles can adjust the distortion of the fold line, such as adjusting the distortion of two sides connecting the special effect particles in space.
[0067] The strip 3D model is bound to the specified 3D model.
[0068] Schematically, the strip-shaped 3D model is a model bound to a specified 3D model. Optionally, when the strip-shaped 3D model is implemented as virtual hair, the specified 3D model is implemented as a virtual head bound to the virtual hair; or, when the strip-shaped 3D model is implemented as virtual grass, the specified 3D model is implemented as a virtual ground bound to the virtual grass; or, when the strip-shaped 3D model is implemented as virtual hair, the specified 3D model is implemented as a virtual animal bound to virtual hair (e.g., virtual dog hair bound to a virtual dog), etc.
[0069] Step 220, for a target broken line among the multiple broken lines, in response to the movement of the designated three-dimensional model at the i-th moment, based on the movement speed and movement direction of the designated three-dimensional model, determine the force values corresponding to the multiple special effect particles on the target broken line at the i-th moment.
[0070] Schematically, the target broken line is any broken line among the multiple broken lines. When analyzing the multiple broken lines, the multiple broken lines are analyzed separately. The following description is given by taking the analysis of the target broken line among the multiple broken lines as an example.
[0071] The i-th moment is any moment. For example, the i-th moment is a moment in the game process, or the i-th moment is a moment in the scene construction process, etc.
[0072] Optionally, the movement of the specified three-dimensional model is detected in real time or periodically, and when the specified three-dimensional model is detected to move at the i-th moment, multiple special effect particles on the target fold line are analyzed. For example, the virtual head is the above-mentioned specified three-dimensional model, and the movement of the virtual head corresponding to the virtual object is detected in real time during the game. When the virtual head is detected to move in the virtual scene at the i-th moment, multiple special effect particles on the selected target virtual hair are analyzed.
[0073] In some embodiments, based on the moving speed and moving direction of the specified three-dimensional model, the force values corresponding to the plurality of special effect particles on the target fold line at the i-th moment are determined.
[0074] Schematically, when a designated three-dimensional model bound to multiple strip-shaped three-dimensional models moves, the multiple strip-shaped three-dimensional models will also move, and the movement process is associated with the movement of the designated three-dimensional model.
[0075] On the basis of the movement of the designated three-dimensional model, the movement speed and the movement direction of the designated three-dimensional model are determined, thereby determining the force values corresponding to the plurality of special effect particles on the target fold line corresponding to the selected strip-shaped three-dimensional model.
[0076] The force value is used to represent the force condition of the special effect particles on the target polyline when they move with the specified three-dimensional model, where i is a positive integer.
[0077] Indicatively, when the movement speed of the specified three-dimensional model is faster, the force value between multiple special effect particles on the target fold line is larger; when the movement direction of the specified three-dimensional model changes faster, the force value between multiple special effect particles on the target fold line is larger, and so on.
[0078] In some embodiments, the force value is realized as at least one of a tensile force, a bending force, and a torsional force.
[0079] The stretching force is defined on the particle connection edge connecting the special effect particles, and is used to indicate the stretching between the two special effect particles connected on the particle connection edge. For example, special effect particles A and special effect particles B are connected through particle connection edge 1. When the specified 3D model moves faster, the special effect particle A close to the specified 3D model moves faster, and the special effect particle B far away from the specified 3D model moves slower, thus generating a stretching force.
[0080] The bending force is defined on the special effect particles to indicate the bending caused by the angle change between the particle connection edges on both sides of the special effect particles. For example: Special effect particle A is connected by particle connection edge 1 and particle connection edge 2. When the 3D model is specified to turn, the bending force is determined based on the angle change between particle connection edge 1 and particle connection edge 2.
[0081] The distortion force is defined on the special effect particles and is used to indicate the distortion caused by the distortion of the particle connection edges on both sides of the special effect particles in space. For example: special effect particle A is connected by particle connection edge 1 and particle connection edge 2. When the 3D model is specified to turn, the distortion force is determined based on the distortion between particle connection edge 1 and particle connection edge 2 in space.
[0082] In some embodiments, the combined force of the stretching force, the bending force, and the twisting force is used as the force value corresponding to the special effect particle, so as to determine the force values corresponding to the plurality of special effect particles on the target fold line.
[0083] Step 230, calculating the speed change of the special effect particle between the i-th moment and the i+1-th moment based on the force value, and obtaining the speed changes corresponding to the plurality of special effect particles on the target broken line.
[0084] In an illustrative manner, after the force values corresponding to the plurality of special effect particles are obtained, the particle masses corresponding to the plurality of special effect particles are determined.
[0085] Optionally, the particle mass is a pre-set particle parameter, for example: setting a plurality of special effect particles to have the same particle mass; or setting some special effect particles to have one particle mass and setting another part of special effect particles to have another particle mass.
[0086] In some embodiments, based on the force value of the special effect particle and the particle mass corresponding to the special effect particle, the acceleration corresponding to the special effect particle is determined according to Newton's second law.
[0087] Optionally, the initial velocity of the special effect particle at the i-th moment is recorded, the time difference is determined based on the i-th moment to the (i+1)-th moment, and then the velocity change corresponding to the special effect particle is determined based on the initial velocity, the time difference and the acceleration.
[0088] In some embodiments, based on the above process, multiple special effect particles on the target fold line are analyzed respectively, so as to determine the speed changes corresponding to the multiple special effect particles respectively.
[0089] Step 240, using the moving speed of the special effect particles on the multiple broken lines at the i-th moment and the speed change of the special effect particles, calculate the movement trajectories corresponding to the multiple special effect particles respectively, and generate an accompanying movement animation of the strip-shaped three-dimensional model accompanying the movement of the specified three-dimensional model based on the movement trajectory.
[0090] Optionally, in addition to determining the speed changes corresponding to the plurality of special effect particles on the target fold line, the speed changes of the special effect particles on other fold lines among the plurality of fold lines are determined according to the above process.
[0091] In some embodiments, the moving speed of the special effect particles on multiple broken lines at the i-th moment is determined, and the moving speed is used to represent the initial speed of the special effect particles at the i-th moment; in addition, based on the process of analyzing each broken line separately, the speed change of the special effect particles associated with the broken line is obtained.
[0092] Optionally, for each special effect particle, after determining the moving speed and speed change corresponding to the special effect particle, the sum of the moving speed and the speed change is calculated to obtain the adjustment speed corresponding to each special effect particle, that is, obtain the first adjustment speeds of multiple special effect particles corresponding to multiple broken lines.
[0093] In some embodiments, the movement tracks respectively corresponding to the plurality of special effect particles are determined based on the first adjustment speed.
[0094] Schematically, the speed change of the special effect particles is a value determined based on the movement of the corresponding broken line, so that the first adjustment speed obtained based on the speed change and the moving speed can more directly show the movement trajectory of the strip three-dimensional model corresponding to the broken line following the movement of the specified three-dimensional model.
[0095] Optionally, after obtaining the first adjustment speed, a comprehensive analysis is performed on multiple special effect particles corresponding to the multiple broken lines, collision conditions between the multiple special effect particles are calculated, and the first adjustment speeds corresponding to the multiple special effect particles are adjusted based on the collision conditions to obtain a second adjustment speed.
[0096] In some embodiments, the movement tracks respectively corresponding to the plurality of special effect particles are determined based on the second adjustment speed.
[0097] In schematic form, after obtaining the first adjustment speed based on the speed change and the moving speed, taking into account that there may be collisions between multiple broken lines, resulting in collisions between multiple special effect particles on the multiple broken lines, collision detection is performed on multiple special effect particles corresponding to the multiple broken lines, thereby adjusting the first adjustment speed determined based on the broken lines, so that the second adjustment speed obtained after the adjustment can not only show the force relationship between multiple special effect particles on the same broken line, but also show the random collision relationship between multiple special effect particles on multiple broken lines. The systematic nature of the special effect particle analysis process is improved through the sequential analysis process, thereby obtaining the movement trajectory of the strip three-dimensional model corresponding to the broken line following the movement of the specified three-dimensional model.
[0098] In an optional embodiment, based on the movement tracks respectively corresponding to the plurality of special effect particles, the movement area of the broken line including the special effect particles is adjusted.
[0099] Schematically, the plurality of special effect particles include special effect particles A, special effect particles B, special effect particles C and special effect particles D. Special effect particles A and special effect particles B are special effect particles corresponding to fold line 1, and special effect particles C and special effect particles D are special effect particles corresponding to fold line 2. Based on the movement tracks corresponding to special effect particles A and special effect particles B, the movement area of fold line 1 including special effect particles A and special effect particles B is adjusted; similarly, based on the movement tracks corresponding to special effect particles C and special effect particles D, the movement area of fold line 2 including special effect particles C and special effect particles D is adjusted, and so on.
[0100] Illustratively, based on the movement areas respectively corresponding to the multiple broken lines, an accompanying movement animation is generated in which the strip-shaped three-dimensional model moves along with the designated three-dimensional model.
[0101] For example: a 3D model is specified to be implemented as a virtual head, and a strip-shaped 3D model is implemented as virtual hair. Based on the movement trajectories of the multiple special effect particles on the fold lines corresponding to the virtual hair, the movement areas of the multiple fold lines from the i-th moment to the i+1-th moment are determined, and the movement areas are used to indicate the areas through which the fold lines pass. The movement of the multiple fold lines is determined according to the areas, so as to generate an accompanying movement animation, which shows the animation of the virtual hair following the movement of the virtual head.
[0102] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0103] In summary, taking the analysis of the target broken line among multiple broken lines as an example, the force values corresponding to the multiple special effect particles on the target broken line are determined based on the moving speed and moving direction of the specified three-dimensional model at the i-th moment, so as to calculate the speed change of the special effect particles, and then determine the moving trajectories corresponding to the multiple special effect particles based on the moving speed and speed change of the special effect particles. Avoiding the problem of poor analysis efficiency caused by directly performing comprehensive analysis on multiple broken lines, by analyzing multiple broken lines separately and then determining the speed change corresponding to the multiple special effect particles on the broken lines, and then performing comprehensive analysis on multiple broken lines based on the separate analysis of multiple broken lines, the calculation and analysis efficiency can be improved, and the accompanying movement animation accompanying the movement of the specified three-dimensional model can be generated more real-time and efficiently, and the timeliness of animation generation can be improved, so as to facilitate the rendering and display of the generated accompanying movement animation, so that the animation generation method of the strip three-dimensional model can be applied to a wider range of scenes.
[0104] In an optional embodiment, when calculating the movement trajectories corresponding to multiple special effect particles, multiple broken lines are first analyzed separately as target broken lines, so as to obtain the force values corresponding to multiple special effect particles on the target broken lines based on the separate analysis process, and the speed change determined based on the force value is related to the target broken line, and the analysis efficiency can be improved by performing parallel analysis on the special effect particles on multiple broken lines. Schematically, as shown in FIG. Figure 3 As shown above Figure 2 The illustrated embodiment may also be implemented as the following steps 310 to 350 .
[0105] Step 310, obtaining multiple broken lines corresponding to the strip-shaped three-dimensional models.
[0106] Schematically, the strip-shaped 3D model is used to indicate a strip-shaped 3D model, which is implemented as virtual hair, virtual flowers and plants, virtual fur, etc. In order to facilitate the analysis of the strip-shaped 3D model, each strip-shaped 3D model is regarded as a polyline, so as to obtain polylines corresponding to multiple strip-shaped 3D models.
[0107] In addition, in order to facilitate the analysis of the movement of the strip-shaped 3D model, the fold lines corresponding to the strip-shaped 3D model are divided by special effect particles, that is, each fold line includes multiple special effect particles. Among them, the special effect particles are used to indicate the strength of the fold line division. The more special effect particles a fold line includes, the finer the strength of the fold line division.
[0108] In an optional embodiment, isotropic poly-line rods are used as the polyline representation corresponding to the strip-shaped three-dimensional model. That is, the polyline has an isotropic property, which is used to indicate that the physical, chemical and other properties corresponding to the polyline will not change with different directions, also known as homogeneity.
[0109] Indicative, such as Figure 4 As shown, this is a schematic diagram of a broken line corresponding to a strip-shaped three-dimensional model.
[0110] The polyline includes N special effect particles, which are represented by circles. The figure shows 4 special effect particles, namely special effect particles 410x 0 , Special Effect Particles 420x 1 , Special Effect Particles 430x 2 And special effect particles x 3 ; In addition, each polyline also includes N-1 particle connection edges that connect the special effect particles.
[0111] Optionally, each special effect particle has 3 degrees of freedom, which are used to represent the position of the special effect particle in the three-dimensional coordinate system; each edge has 1 degree of freedom, which is used to represent the rotation angle. Therefore, each polyline includes 4N-1 degrees of freedom, that is, 4N-1=3N+N-1.
[0112] The strip 3D model is bound to the specified 3D model.
[0113] Schematically, the strip-shaped three-dimensional model is a model bound to a specified three-dimensional model. Optionally, when the strip-shaped three-dimensional model is implemented as virtual hair, the specified three-dimensional model is implemented as a virtual head bound to the virtual hair.
[0114] Optionally, taking the implementation of the strip-shaped 3D model as virtual hair and the specified 3D model as a virtual head as an example, in a 3D scene including the specified 3D model and the strip-shaped 3D model bound thereto, an initialization operation is performed on the 3D scene.
[0115] In an illustrative manner, the person setting up the three-dimensional scene imports the strip-shaped three-dimensional model corresponding to the virtual hair into the three-dimensional scene from the outside; alternatively, the person setting up the three-dimensional scene defines the virtual hair in the three-dimensional scene to implement the import process. In addition, after obtaining the virtual hair, the physical parameters related to the virtual hair are set. For example: setting the length of the virtual hair, the thickness of the virtual hair, the density of the virtual hair, etc. In addition, for the broken line used to describe the virtual hair, the number of special effect particles on the broken line, the mass of the special effect particles, the initial bending force corresponding to the special effect particles, the initial twisting force corresponding to the special effect particles, the initial tensile force of the particle connection edge corresponding to the special effect particles, etc. are also set.
[0116] It is worth noting that the above physical parameters are only illustrative examples and are not limited to the embodiments of the present application.
[0117] In addition to setting the virtual hair, the person setting up the three-dimensional scene also needs to select a virtual head for binding the virtual hair, for example: binding virtual hair A to the virtual head corresponding to virtual object 1.
[0118] Among them, the virtual head is implemented as a signed distance field (SDF). SDF is a discrete representation of an implicit surface. It is essentially a 3D cartesian grid. Each voxel of the grid stores the shortest distance to the surface. It is used to determine whether the voxel point is inside the surface. It is usually used in collision processing to represent complex geometric bodies, such as the virtual head.
[0119] That is, the person setting up the 3D scene selects an SDF as the head and binds the virtual hair to the SDF, so that in subsequent simulations, the movement of the SDF will drive the movement of the virtual hair.
[0120] Step 320, for a target broken line among the multiple broken lines, in response to the movement of the designated three-dimensional model at the i-th moment, based on the movement speed and movement direction of the designated three-dimensional model, determine the force values corresponding to the multiple special effect particles on the target broken line at the i-th moment.
[0121] At least one energy is defined on each polyline, and the at least one energy changes based on the movement of the specified three-dimensional model; the force value on each special effect particle is obtained based on the energy calculation.
[0122] Optionally, three types of energy are defined on the polyline, including stretching energy (Stretching), bending energy (Bending) and twisting energy (Twisting).
[0123] Among them, stretching energy is defined on the particle connection edge connecting the special effect particles, and is used to indicate the stretching situation between two special effect particles connected on the particle connection edge; bending energy is defined on the special effect particles, and is used to indicate the bending situation caused by the angle change between the particle connection edges on both sides of the special effect particles; distortion energy is defined on the special effect particles, and is used to indicate the distortion situation caused by the distortion change in space of the particle connection edges on both sides of the special effect particles.
[0124] In some embodiments, taking the analysis of the force process of any special effect particle on the target fold line as an example, there are two special effect particles adjacent to the special effect particle on the target fold line. Figure 4 As shown, two special effect particles adjacent to the special effect particle 420 are the special effect particle 410 and the special effect particle 430. The special effect particle is represented by Vertex or particle.
[0125] When calculating the force value of a special effect particle, the properties of the special effect particles adjacent to the special effect particle are determined. The force value of a particle consists of stretching force, bending force, and twisting force.
[0126] In an optional embodiment, in response to the movement of the designated three-dimensional model at the i-th moment, the stretching forces corresponding to the plurality of special effect particles at the i-th moment are determined based on the movement speed and movement direction of the designated three-dimensional model.
[0127] The stretching force is used to indicate the stretching condition of the special effect particle by two adjacent special effect particles.
[0128] In an optional embodiment, the bending forces corresponding to the plurality of special effect particles at the i-th moment are determined based on the moving speed and moving direction of the specified three-dimensional model.
[0129] The bending force is used to indicate the influence of two adjacent special effect particles on the plane angle of the special effect particle.
[0130] In an optional embodiment, the distortion forces respectively corresponding to the plurality of special effect particles at the i-th moment are determined based on the moving speed and moving direction of the specified three-dimensional model.
[0131] The distortion force is used to indicate the spatial angle influence of two adjacent special effect particles on the special effect particle.
[0132] In some embodiments, Figure 5 The figure shows a schematic diagram of the special effect particles that need to be accessed when calculating the force value of a special effect particle.
[0133] Optionally, the force exerted on a special effect particle is determined by the energy of the special effect particle and two adjacent special effect particles, and the energy of each special effect particle is determined by the positions of the special effect particle and two adjacent special effect particles.
[0134] In schematic form, the stretching force corresponding to the special effect particles is determined by the stretching energy corresponding to the special effect particles; the twisting force corresponding to the special effect particles is determined by the twisting energy corresponding to the special effect particles; and the bending force corresponding to the special effect particles is determined by the bending energy corresponding to the special effect particles.
[0135] Targeted special effect particles 510x i , determine the target special effect particles 510x i Adjacent first special effect particle 511x i-1 And the second special effect particle 512x i+1 .
[0136] Get the first special effect particle 511x i-1The corresponding first energy value and the second special effect particle 512x i+1 Corresponding second energy value; obtaining target special effect particles 510x based on the first energy value and the second energy value i The force value.
[0137] Indicatively, when determining the first special effect particle 511x i-1 When the first energy value corresponding to the first special effect particle 511x is determined i-1 Adjacent third special effect particle 513x i-2 and target special effect particles 510x i ; Afterwards, based on the first special effect particle 511x i-1 , the third special effect particle 513x i-2 And target special effect particles 510x i The relative position between the first and second special effect particles 511x is obtained. i-1 Based on it and the third special effect particle 513x i-2 The connected particle connects the edge 521 and connects it to the target effect particle 510x i The energy value is determined by the bending condition between the connecting edges 522 of the connected particles.
[0138] Similarly, when determining the second special effect particle 512x i+1 When the corresponding second energy value is reached, a fourth special effect particle 514x adjacent to the second special effect particle is determined. i+2 and target special effect particles 510x i ; Afterwards, based on the second special effect particle 512x i+1 , the fourth special effect particle 514x i+2 And target special effect particles 510x i The relative position between the first and second energy values is obtained. The first energy value is used to represent the second special effect particle 512x i+1 Based on it and the fourth special effect particle 514x i+2 Connect the particle connection edge 523 and connect it to the target special effect particle 510x i The energy value is determined by the bending condition between the connecting edges 524 of the connected particles.
[0139] The energy value includes at least one of a bending energy value, a twisting energy value and a stretching energy value. That is, the first energy value includes at least one of a first bending energy value, a first twisting energy value and a first stretching energy value; the second energy value includes at least one of a second bending energy value, a second twisting energy value and a second stretching energy value.
[0140] Optionally, the following description is given by taking determining the bending force corresponding to special effect particles as an example.
[0141] For a target special effect particle, a first special effect particle and a second special effect particle adjacent to the target special effect particle are determined; based on a moving speed and a moving direction of a specified three-dimensional model, a first bending energy value corresponding to the first special effect particle and a second bending energy value corresponding to the second special effect particle are obtained, and the bending energy value is used to represent an angle change of a particle connection edge connecting two adjacent special effect particles.
[0142] The force value of the target special effect particle is obtained based on the first bending energy value and the second bending energy value.
[0143] Illustratively, determine a third special effect particle and a target special effect particle adjacent to the first special effect particle; determine a fourth special effect particle and a target special effect particle adjacent to the second special effect particle; obtain a first bending energy value based on the relative positions among the first special effect particle, the third special effect particle, and the target special effect particle; obtain a second bending energy value based on the relative positions among the second special effect particle, the fourth special effect particle, and the target special effect particle.
[0144] It is worth noting that the above-mentioned method for determining the bending force is only an illustrative example, and the twisting force and the tensile force are determined according to the above-mentioned method, which is not limited in the embodiments of the present application.
[0145] In some embodiments, based on the above method of determining the bending force corresponding to the special effect particle, the twisting force corresponding to the special effect particle is determined by the twisting energy, and the stretching force corresponding to the special effect particle is determined by the stretching energy.
[0146] In an optional embodiment, based on at least one of a tensile force, a bending force and a twisting force, force values corresponding to the plurality of special effect particles are determined.
[0147] The force value is used to represent the force condition of the special effect particles on the target polyline when they move with the specified three-dimensional model.
[0148] In some embodiments, the combined force of the bending force, the twisting force, and the stretching force is used as the force value corresponding to the special effect particle.
[0149] In an illustrative manner, for any target special effect particle among a plurality of special effect particles, the target tensile force, target bending force and target twisting force corresponding to the target special effect particle are determined; the resultant force of the target tensile force, target bending force and target twisting force is taken as the force value corresponding to the target special effect particle, and the force values corresponding to the plurality of special effect particles are obtained respectively.
[0150] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0151] Step 330, calculating the speed change of the special effect particle between the i-th moment and the i+1-th moment based on the force value, and obtaining the speed changes corresponding to the plurality of special effect particles on the target broken line.
[0152] Indicatively, after determining the force value corresponding to each special effect particle on the target fold line, each special effect particle is taken as an analysis object, and the speed change of the special effect particle between the i-th moment and the i+1-th moment is calculated according to the force value.
[0153] In some embodiments, a first velocity value of the special effect particle corresponding to the force value at the i-th moment is determined.
[0154] Indicatively, after the strip 3D model is imported, the speed values of the special effect particles on the corresponding broken line of the strip 3D model are recorded in real time; or, after the strip 3D model is imported, the speed values of the special effect particles on the corresponding broken line of the strip 3D model are recorded periodically.
[0155] Optionally, at the i-th moment, the velocity value of the special effect particle that needs to be analyzed based on the force value is determined, and the velocity value is used as the first velocity value. For example, the first velocity value of the special effect particle at the i-th moment is 1. Optionally, the i-th moment is the current moment.
[0156] In some embodiments, the acceleration value of the special effect particle at the i-th moment is determined based on the force value.
[0157] Optionally, obtain the special effect particle mass of the special effect particle.
[0158] Indicatively, the quality of special effect particles is a value set by the setter of the three-dimensional scene. For example, the quality of special effect particle A is set to 1; the quality of special effect particle B is set to 1.2, etc.; or, the target fold line includes special effect particles A, special effect particles B and special effect particles C, and the quality of the target fold line is set to 2.7. Based on the fact that the target fold line includes three special effect particles, the quality of the target fold line is evenly divided, so that the quality of special effect particles A, special effect particles B and special effect particles C are all 0.9; or, the target fold line includes special effect particles A, special effect particles B and special effect particles C, and the quality of the target fold line is set to 2.7. Special effect particle A is a particle close to the specified three-dimensional model, special effect particle B is a particle in the middle, and special effect particle C is a particle far from the specified three-dimensional model. Based on the preset quality distribution relationship (such as: determining the weight according to the distance from the specified three-dimensional model), the quality of special effect particle A is 1.3, the quality of special effect particle B is 0.9, and the quality of special effect particle C is 0.5, etc.
[0159] Optionally, the acceleration value of the special effect particle at the i-th moment is obtained based on the force value and the mass of the special effect particle.
[0160] Illustratively, after determining the force value of the special effect particle and the special effect particle mass corresponding to the special effect particle, the acceleration value of the special effect particle at the i-th moment is determined based on Newton's second law.
[0161] In some embodiments, based on the first velocity value at the i-th moment and the acceleration value at the i-th moment, the second velocity value of the special effect particle at the i+1-th moment is calculated.
[0162] Illustratively, after obtaining the recorded first velocity value of the special effect particle at the i-th moment and the acceleration value of the special effect particle at the i-th moment, the second velocity value of the special effect particle at the i+1th moment is calculated based on the duration between the i+1th moment and the i-th moment.
[0163] Optionally, the duration between the i-th moment and the i+1-th moment is a preset analysis duration. For example, the duration between the i-th moment and the i+1-th moment is 0.3 microseconds; or, the duration between the i-th moment and the i+1-th moment is 0.01 microseconds; or, the duration between the i-th moment and the i+1-th moment is the duration corresponding to one frame, etc. It is worth noting that the above durations are only illustrative examples and can be flexibly adjusted in the application, and the embodiments of the present application do not limit this.
[0164] In some embodiments, the difference between the second speed value and the first speed value is used as the speed change of the special effect particle between the i-th moment and the (i+1)-th moment to obtain the speed changes corresponding to the plurality of special effect particles on the target fold line.
[0165] Illustratively, after the second speed value is calculated and the first speed value is recorded, the difference between the second speed value and the first speed value is determined, and the difference is used as the speed change of the special effect particle between the i-th moment and the i+1-th moment.
[0166] Optionally, based on the method of determining the speed change corresponding to the special effect particle, the acceleration value of the corresponding special effect particle is determined by the special effect particle mass of other special effect particles on the target fold line, and then the second speed values corresponding to the other special effect particles are obtained, and the process of obtaining the speed changes corresponding to the other special effect particles on the target fold line is realized.
[0167] Step 340, based on the parallel analysis of the multiple broken lines, obtain the speed changes corresponding to the multiple special effect particles on the multiple broken lines.
[0168] In some embodiments, based on the above method of determining the speed change corresponding to the special effect particles, the speed changes corresponding to multiple special effect particles on other broken lines are determined, that is: the speed change determined based on the above method is related to the interaction between the multiple special effect particles on the corresponding broken line, and there is a corresponding relationship between the speed change and the special effect particle and the broken line where the special effect particle is located.
[0169] Optionally, in the process of analyzing the speed changes of multiple special effect particles on multiple broken lines respectively, the multiple broken lines are analyzed in parallel.
[0170] Schematically, taking broken line 1, broken line 2 and broken line 3 among the multiple broken lines as an example, broken line 1, broken line 2 and broken line 3 respectively have 50 special effect particles. In the process of analyzing the speed changes of multiple special effect particles on the multiple broken lines, while analyzing the 50 special effect particles corresponding to broken line 1, the 50 special effect particles corresponding to broken line 2 are analyzed in parallel. In addition, the 50 special effect particles corresponding to broken line 3 are also analyzed in parallel, etc.
[0171] Among them, the speed change based on the special effect particles is a value obtained based on the correlation between multiple special effect particles on the broken line. Therefore, the above-mentioned process of parallel analysis of multiple broken lines can realize the analysis process inside the broken line, thereby improving the calculation efficiency with the help of parallel analysis of multiple broken lines.
[0172] Optionally, on the basis of performing parallel analysis on multiple broken lines, multiple special effect particles on the broken lines may also be analyzed in parallel. For example, when analyzing 50 special effect particles corresponding to broken line 1, the 50 special effect particles corresponding to broken line 1 may be analyzed in parallel.
[0173] In an optional embodiment, the GPU computing process is performed through the Compute Unified Device Architecture (CUDA), which is a parallel computing platform and programming model dedicated to general computing development on GPUs and provides a simple interface for GPU programming. That is, the above-mentioned animation generation method is performed on CUDA.
[0174] Optionally, each special effect particle on the polyline is processed by a GPU thread in CUDA, so that a large number of computing tasks can be processed in parallel; in addition, the following optimization scheme can be used to further improve the processing efficiency of the parallel process.
[0175] (1) The processing method used when accessing adjacent special effect particles
[0176] In some embodiments, shuffle intrinsics are used to access adjacent special effect particles (also called neighbor particles). Shuffle intrinsics are internal functions set in the GPU and used to perform random operations.
[0177] Indicative, such as Figure 5 As shown, when determining the force value corresponding to a special effect particle, for the target special effect particle 510xi For example, the special effect particles with a distance of at most 2 will be visited, that is, the farthest distance from the target special effect particle is 510x i The third special effect particle with an interval of 1 513x i-2 And the fourth special effect particle 513x i+2 will be accessed.
[0178] Based on the above access characteristics, the process of accessing adjacent special effect particles can be realized by using the shuffle intrinscis of the GPU. This method is much faster than using shared memory.
[0179] Due to the storage characteristics of the shared memory method, when analyzing adjacent special effect particles, the properties of the adjacent special effect particles need to be written into the shared memory first, and then read out from the shared memory. The inherent characteristics of the write-read method make it impossible to efficiently analyze adjacent special effect particles.
[0180] In addition, since the shuffle intrinscis set in the GPU accesses the GPU registers, the reading and writing speed of the shuffleintrinscis method itself is faster than shared memory, thereby using the shuffle intrinscis to improve the processing speed of adjacent special effect particles.
[0181] (2) GPU thread adjustment
[0182] Illustratively, while the calculation of each special effect particle is processed by one GPU thread, it can be determined that each polyline is processed by the same GPU thread block.
[0183] Among them, the CUDA software architecture consists of grids, thread blocks and threads, which is equivalent to dividing the computing units on the GPU into several (such as 2 to 3) grids, each grid contains several (such as 65535) thread blocks, and each thread block contains several (such as 512) threads.
[0184] Generally speaking, a CUDA parallel program is executed by multiple threads; several threads form a thread block, and multiple threads in the same thread block can be synchronized or communicate through shared memory. In addition, 32 consecutive threads form a thread warp, and in a thread warp, all threads execute the same instructions.
[0185] In some embodiments, in order to improve GPU occupancy and adapt to implementation scenarios, the number of broken lines that need to be analyzed can be appropriately reduced, and the positions of other broken lines can be determined using an interpolation method.
[0186] Optionally, a first number of broken lines are obtained from a plurality of broken lines; and speed changes corresponding to a plurality of special effect particles on the first number of broken lines are obtained.
[0187] Schematically, the broken lines corresponding to the multiple strip-shaped three-dimensional models are determined, and a part of the broken lines (a first number of broken lines) are selected for more accurate analysis (the above-mentioned force value analysis, velocity change analysis, etc.) and the broken line positions (moving areas) are determined.
[0188] Optionally, a second number of foldlines other than the first number of foldlines among the plurality of foldlines is obtained.
[0189] Illustratively, in addition to obtaining a first number of fold lines from a plurality of fold lines, the fold lines other than the first number of fold lines from the plurality of fold lines are determined as a second number of fold lines, that is, the remaining fold lines are determined as the second number of fold lines.
[0190] Optionally, interpolation operation is performed on the speed changes corresponding to the plurality of special effect particles on the first number of broken lines to obtain interpolated speed changes corresponding to the second number of broken lines.
[0191] Schematically, the positions of the remaining polylines are determined by assisting a part of the polylines that are precisely analyzed. For example, there are 10,000 strip-shaped three-dimensional models, corresponding to 10,000 polylines, from which 500 to 2,000 polylines are selected as polylines for precise analysis. The polylines for precise analysis can be called simulated polylines (e.g., when the strip-shaped three-dimensional model corresponding to the polyline is virtual hair, the simulated polyline can be called simulated hair); in addition, the polylines that are not precisely analyzed are called interpolated polylines (e.g., when the strip-shaped three-dimensional model corresponding to the polyline is virtual hair, the interpolated polyline can be called interpolated hair). That is, the interpolated polyline is obtained by interpolating the simulated polyline based on the precise analysis.
[0192] Optionally, movement trajectories corresponding to a plurality of special effect particles are calculated based on the speed variation and the interpolated speed variation.
[0193] Schematically, the moving areas of the first number of broken lines (model broken lines) are determined based on the speed change; in addition, the moving areas of the second number of broken lines (interpolation broken lines) are determined based on the interpolation speed change, thereby obtaining the moving trajectories corresponding to the multiple special effect particles.
[0194] In the above process, based on selecting some polylines as simulated polylines for precise analysis, the number of GPU threads for processing special effect particles on the simulated polylines is reduced, so the utilization rate of the GPU will not be too high, which greatly avoids the problem of excessive consumption of the number of GPUs.
[0195] In some embodiments, the special effect particles on each polyline can also be divided into multiple groups (multiple thread bundles). Based on the properties of the thread bundles, each group contains 32 continuous special effect particles, and each group is handed over to a different GPU thread block for processing. For example, for a polyline including 50 special effect particles, 2 thread blocks are required for processing. Therefore, when the number of special effect particles included in the polyline is large, the utilization rate of the GPU can also be improved by processing in different thread blocks.
[0196] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0197] (3) Grouping adjustment of special effect particles
[0198] Schematically, in the process of processing special effect particles based on threads in the GPU, thread divergence may occur. Thread divergence is used to indicate the divergence caused by inconsistent execution instructions of the same GPU thread warp.
[0199] Optionally, if the special effect particles on each broken line are divided into multiple thread bundles containing 32 consecutive special effect particles for processing, and each thread bundle is called a group, then the special effect particles at both ends cannot directly access their adjacent special effect particles (neighboring particles), and additional read and write operations are usually required to implement the acquisition process.
[0200] Indicative, such as Figure 6 , which is the grouping result after directly grouping the special effect particles. j-1 The second group 620 is represented by Group j The third group 630 is represented by Group j+1 ,based on Figure 5The force value determination method shown in the figure determines the force values corresponding to different special effect particles respectively with the help of adjacent special effect particles. Taking the special effect particle i in the second group 620 as an example, if the force value of the special effect particle i is determined, it is necessary to use the energy of the special effect particle i-1 in the first group 610 that does not belong to the second group 620 to determine the force value; similarly, taking the special effect particle i-1 in the first group 610 as an example, if the force value of the special effect particle i-1 is determined, it is necessary to use the energy of the special effect particle i in the second group 620 that does not belong to the first group 610 to determine the force value. Since different thread bundles need to use additional read and write operations to realize the process of obtaining the force value determination, the direct grouping method has the problem of low efficiency.
[0201] In some embodiments, based on the above process, the impact of the above problems is alleviated by designing overlapping grouping.
[0202] Indicative, such as Figure 7 , which is the grouping result after the special effect particles are grouped by overlapping grouping. j The second group 720 is represented by Group j+1 In overlapping grouping, the two special effect particles on the boundary of each group will be processed by two different thread blocks. Although both thread blocks can only calculate part of the result, the results of the two thread blocks are complementary and the correct result can be obtained by adding them together.
[0203] For example, the special effect particles i+30 and i+31 in the first group 710 will also overlap in the second group 720. Taking the analysis of the special effect particle i+31 as an example, based on Figure 5 In the force value determination method shown, when the special effect particle i+31 is processed by the first group 710, the special effect particle i+31 can only get the contribution (energy contribution) from the special effect particle i+30, and the contributions from the special effect particles i+31 and i+32 will be directly set to 0; and when the special effect particle i+31 is processed by the second group 720, the special effect particle i+31 can get the contributions from the special effect particles i+31 and i+32, and the contribution from the special effect particle i+30 will be set to 0. The results of the first group 710 and the second group 720 are added (using the atomic addition method), so that the contributions from itself and the two adjacent special effect particles can be correctly obtained, and the correct result can be obtained. Among them, although atomic operations are used, the frequency is low, so it will not have a great impact on the processing efficiency.
[0204] (4) Merge write process
[0205] Schematically, when solving the velocity change, the process of calculating the second velocity value and determining the velocity change is realized by using the semi-implicit integral discrete elastic rods (DER). Among them, the main task of the semi-implicit integral DER is simply summarized as: calculating the current force value of each special effect particle, and then calculating the acceleration of each special effect particle at the current moment, and then calculating the second velocity value of each special effect particle at the next moment, and thus obtaining the velocity change Δu within this time step (from moment i to moment i+1).
[0206] Optionally, the above process of solving the semi-implicit integral DER is summarized as the solution of the following formula:
[0207] Formula 1:
[0208] (M+h 2 H)u=Mu 0 +hf
[0209] Wherein, M is used to represent the special effect particle mass matrix of multiple special effect particles on the broken line where the special effect particle to be solved is located; h is used to represent the time step length (the duration from time i to time i+1); H represents the derivative of f; u represents the second velocity value to be solved; u 0 It represents the first velocity value of the special effect particle being solved at the current moment; f represents the force value of the special effect particle being solved.
[0210] Optionally, for the convenience of subsequent description, the left side of the above formula (M+h 2 H) is called the left-hand side (LHS); Mu on the right side of the above formula 0 +hf is called the right hand side (RHS), and the second speed value u is solved by LHS and RHS to obtain the speed change Δu.
[0211] Among them, the LHS of each broken line is a (4n-1)*(4n-1) matrix, n is used to represent the number of special effect particles on this broken line, and the calculation result of each special effect particle is a part of this matrix.
[0212] Schematically, the calculation result of the i-th special effect particle is the submatrix {{4i–1,4i–1},{4i+3,4i+3}}. When stored in the global memory, based on the requirement of the global memory to store the special effect particles in order, if the memory of each special effect particle is more than 100 bytes, the interval between the data of each special effect particle at the same position will be more than 100 bytes, which will result in the calculation result of a special effect particle being written into the global memory, which is not in line with the coalesced access requirement of the GPU and will make the writing process very slow.
[0213] In some embodiments, a shared memory is used as an intermediate layer, and the calculation results of adjacent special effect particles (such as the energy of adjacent special effect particles) are stored in the shared memory until the calculation results of all special effect particles are calculated together, and then all calculation results are written to the global memory. When writing to the global memory uniformly, there is no need to pay special attention to the order of writing to the global memory. The adjacent data in the global memory can be processed by adjacent threads, and there is no need to strictly analyze the calculation results corresponding to the special effect particles according to the order of adjacent special effect particles, thereby greatly accelerating the writing process.
[0214] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0215] In an optional embodiment, the above formula 1 is solved using an LDL decomposition method.
[0216] LDL decomposition is a variant of Cholesky decomposition, which decomposes a symmetric positive definite matrix into the product of a lower triangular matrix L, a diagonal matrix D, and the transposed matrix of L. For the implementation of LDL decomposition on GPU, the following optimization scheme can be adopted.
[0217] Since the LHS of the above formula is a banded matrix with a bandwidth of 10, the decomposed lower triangular matrix is also a banded matrix with a bandwidth of 10, so 10 threads can be used to process one polyline; since a GPU thread bundle has 32 threads, a GPU thread bundle can be used to process three polylines at the same time; in this case, shuffleintrinsics is also used to obtain the data of the adjacent threads of the thread. The matrix L is saved in column major order so that it can be merged when writing the calculation results. However, the side effect of this process is that the matrix cannot be merged after reading it in.
[0218] Optionally, shared memory is used to save the most recent 10 columns of data, which are the data used by the current thread, to avoid repeated non-merged reading.
[0219] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0220] In some embodiments, after solving Formula 1 based on the above process, the second speed value u is obtained, and then the speed change Δu is solved.
[0221] Step 350, using the moving speed of the special effect particles on the multiple broken lines at the i-th moment and the speed change of the special effect particles, calculate the moving trajectories corresponding to the multiple special effect particles respectively, and generate an accompanying moving animation of the strip-shaped three-dimensional model accompanying the movement of the specified three-dimensional model based on the moving trajectories.
[0222] In an illustrative manner, based on the above formula 1, the speed changes corresponding to the plurality of special effect particles on the same broken line are determined by the masses of the plurality of special effect particles on the same broken line and the force values corresponding to the special effect particles.
[0223] In addition, based on the above formula 1, multiple broken lines are analyzed separately in a parallel manner, and with the help of the masses of multiple special effect particles on the same broken line and the force values corresponding to the special effect particles, the speed changes corresponding to the multiple special effect particles on the broken line are determined, thereby obtaining the moving speeds of the special effect particles on the multiple broken lines and the speed changes of the special effect particles.
[0224] Illustratively, for each special effect particle, after determining the moving speed and speed change corresponding to the special effect particle, the sum of the moving speed and the speed change is calculated to obtain the adjustment speed corresponding to each special effect particle, that is, to obtain the first adjustment speeds of multiple special effect particles corresponding to multiple broken lines.
[0225] In some embodiments, the movement tracks respectively corresponding to the plurality of special effect particles are determined based on the first adjustment speed.
[0226] In an illustrative manner, the first adjustment speeds corresponding to the multiple moments in the preset time period are determined based on the above method, and then the movement trajectories corresponding to the multiple special effect particles are obtained based on the first adjustment speeds corresponding to the multiple special effect particles at the multiple moments. For example, based on the first adjustment speed a1 of the special effect particle A at moment 1, the first adjustment speed a2 of the special effect particle A at moment 2, and the first adjustment speed a3 of the special effect particle A at moment 3, the movement trajectories of the special effect particle A from moment 1 to moment 3 are obtained.
[0227] In some embodiments, after obtaining the first adjustment speed, a comprehensive analysis is performed on multiple special effect particles corresponding to multiple broken lines to determine the collision conditions between the multiple special effect particles, and based on the collision conditions, the first adjustment speeds corresponding to the multiple special effect particles are adjusted to obtain the second adjustment speed, and based on the second adjustment speed, the movement trajectories corresponding to the multiple special effect particles are determined.
[0228] Illustratively, based on the above method, the second adjustment speeds corresponding to multiple moments in the preset time period are determined, and then based on the second adjustment speeds corresponding to multiple special effect particles at multiple moments, the movement trajectories corresponding to the multiple special effect particles are obtained.
[0229] In an optional embodiment, a plurality of movement trajectory animation frames are generated by movement trajectories corresponding to a plurality of special effect particles.
[0230] In an illustrative manner, after obtaining the movement trajectories corresponding to a plurality of special effect particles, the movement range corresponding to the same fold line is determined based on the movement trajectories of the special effect particles on the same fold line, and the movement ranges corresponding to a plurality of fold lines are determined based on this method.
[0231] Optionally, if the multiple broken lines include a first number of broken lines for precise analysis and a second number of broken lines for interpolation analysis, the moving ranges corresponding to the first number of broken lines are determined according to the moving trajectories of the special effect particles on the first number of broken lines, and the interpolation moving ranges corresponding to the first number of broken lines are determined according to the interpolation moving trajectories of the special effect particles on the second number of broken lines, and the moving ranges and the interpolation moving ranges are combined to generate multiple moving trajectory animation frames, which show the animation process of the multiple broken lines moving along the specified three-dimensional model.
[0232] Optionally, a plurality of movement trajectory animation frames are generated to obtain a follow-up movement animation.
[0233] Schematically, after generating multiple movement trajectory animation frames indicating that the strip-shaped three-dimensional model follows the movement of the specified three-dimensional model, the multiple movement trajectory animation frames are combined into a follow-up movement animation according to a time series, and the follow-up movement animation shows the movement of the strip-shaped three-dimensional model following the movement of the specified three-dimensional model.
[0234] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0235] To sum up, in order to avoid the problem of poor analysis efficiency caused by directly performing comprehensive analysis on multiple broken lines, the speed changes corresponding to multiple special effect particles on the broken lines are determined by analyzing the multiple broken lines separately, and then the multiple broken lines are comprehensively analyzed on the basis of analyzing the multiple broken lines separately. This can improve the efficiency of calculation and analysis, and generate the accompanying movement animation that accompanies the movement of the specified three-dimensional model in a more real-time and efficient manner, improve the timeliness of animation generation, and enable the animation generation method of the strip three-dimensional model to be applied to a wider range of scenarios.
[0236] In the embodiment of the present application, the content of parallel analysis of multiple broken lines is introduced. First, the special effect particles on the multiple broken lines are analyzed separately, and then the force values corresponding to the multiple special effect particles are obtained based on the separate analysis. The speed change determined based on the force value is related to the broken line corresponding to the special effect particle, and the analysis efficiency can be improved by performing parallel analysis on multiple broken lines, which greatly avoids the inefficiency of uniformly analyzing multiple special effect particles corresponding to multiple broken lines.
[0237] In an optional embodiment, when calculating the moving trajectory based on the moving speed of the special effect particles on multiple broken lines and the speed change of the special effect particles, the moving trajectory corresponding to the special effect particles is obtained by using the mapping conversion relationship between the special effect grid space and the special effect particles. Figure 8 As shown above Figure 2 The illustrated step 240 may also be implemented as the following steps 810 to 830 .
[0238] Step 810 , for the target special effect particle, the speed change of the target special effect particle at the i-th moment is combined with the moving speed of the target special effect particle at the i-th moment to obtain a first adjusted speed of the target special effect particle.
[0239] Schematically, the target special effect particle is used to indicate any one of the multiple special effect particles on multiple fold lines. For example, based on a strip-shaped three-dimensional model, a fold line is obtained, each fold line includes b special effect particles, then there are a*b special effect particles in total, and the target special effect particle is any one of the a*b special effect particles.
[0240] Based on the above calculation process of speed variation, the special effect particles on each broken line are analyzed respectively to obtain the speed variation reflecting the interaction between the special effect particles on each broken line, such as: 1 The speed changes corresponding to b special effect particles reflect the broken line a 1 The interaction between the above b special effect particles, etc.
[0241] Optionally, after calculating the speed change of any target special effect particle among multiple special effect particles at the i-th moment, and recording the moving speed (first speed value) corresponding to the target special effect particle at the i-th moment, the speed change of the target special effect particle and the moving speed of the target special effect particle are summed to obtain the first adjusted speed of the target special effect particle.
[0242] The first adjustment speed is used to characterize the movement of the target special effect particle in the sub-moments between the i-th moment and the i+1-th moment.
[0243] Optionally, after calculating the speed change of the target special effect particle at the i-th moment and recording the moving speed corresponding to the target special effect particle at the i-th moment, set the speed change step size N, that is: divide the speed change equally with the equal step size N, such as: divide the speed change Δu into N parts to obtain N sub-changes Δu / N, and when the speed change of the target special effect particle is merged with the moving speed of the target special effect particle at the i-th moment, merge Δu / N with the moving speed of the target special effect particle at the i-th moment, thereby obtaining the first adjustment speed of the target special effect particle.
[0244] In schematic form, the period from the i-th moment to the i+1-th moment is called a Δt, and Δt is divided according to the equal step length N to obtain N sub-periods Δt / N. When analyzing the period from the i-th moment to the i+Δt / N moment (the first Δt / N period), Δu / N is combined with the moving speed of the target special effect particle at the i-th moment to obtain the first adjustment speed of the target special effect particle from the i-th moment to the i+Δt / N moment; similarly, when analyzing the period from the i+Δt / N moment to the i+2*Δt / N moment (the second Δt / N period), Δu / N is combined with the moving speed of the target special effect particle at the i-th moment to obtain the first adjustment speed of the target special effect particle from the i+Δt / N moment to the i+2*Δt / N moment. That is, the first adjustment speed of the target special effect particle is the speed obtained by adding Δu / N to the moving speed of the target special effect particle at the i-th moment.
[0245] Step 820, obtaining first adjustment speeds corresponding to a plurality of special effect particles on a plurality of broken lines.
[0246] Illustratively, according to the method for obtaining the first adjustment speed of the target special effect particle, multiple special effect particles on multiple broken lines are calculated respectively, that is: multiple special effect particles are respectively used as target special effect particles, thereby obtaining the first adjustment speeds corresponding to the multiple special effect particles on the multiple broken lines.
[0247] Step 830: Determine the movement trajectory corresponding to the target special effect particle based on a plurality of first adjustment speeds within a preset time period.
[0248] Illustratively, after obtaining the first adjustment speeds respectively corresponding to a plurality of special effect particles on a plurality of broken lines, collision detection is performed on the plurality of special effect particles in combination.
[0249] For example: based on the fact that the multiple special effect particles on the multiple broken lines are a*b special effect particles, the first adjustment speeds respectively corresponding to the a*b special effect particles are obtained, and then, collision detection is performed on the a*b special effect particles, so as to adjust the first adjustment speeds.
[0250] In an optional embodiment, collision detection is a process implemented by the Material Point Method (MPM), which is a classic physical simulation method from a hybrid Euler-Lagrangian perspective. The basic idea of the MPM method is to combine material points (implemented as special effect particles in the embodiment of the present application) and grids (represented as special effect grid spaces below), by sticking special effect particles to the nodes of the special effect grid space so that they can move along the special effect grid space, and at the same time, by using an interpolation method to transfer the state quantity of the special effect particles to the special effect grid space, thereby realizing the combination of the Euler grid method and the Lagrangian gridless method.
[0251] Therefore, the plurality of broken lines are in the special effect grid space, and the special effect particles corresponding to the plurality of broken lines are respectively located in the special effect grid space.
[0252] The special effect grid space is the analysis space projected when analyzing special effect particles. Figure 4 As shown, the large rectangular area 440 is a schematic representation of the special effect grid space; the plurality of small rectangular areas (such as the small rectangular area 441) are areas formed based on the division granularity of the special effect grid space.
[0253] In an optional embodiment, the first adjustment speeds respectively corresponding to the plurality of special effect particles are bound to the corresponding special effect particles to obtain a plurality of binding results.
[0254] Among them, the mth special effect particle is bound to the corresponding mth first adjustment speed, and m is a positive integer.
[0255] Illustratively, by performing a binding process between the first adjustment speed and the corresponding special effect particles, an association relationship between the first adjustment speed and the corresponding special effect particles is established, and a plurality of binding results are obtained.
[0256] In an optional embodiment, multiple binding results are mapped to the special effect grid space to perform particle collision detection, and a movement trajectory corresponding to the target special effect particle within a preset time period is obtained.
[0257] The preset time period includes multiple moments including the i-th moment.
[0258] In some embodiments, the plurality of binding results are mapped to the effects grid space.
[0259] In some embodiments, multiple binding results are processed through the special effect grid space to obtain second adjustment speeds corresponding to the multiple special effect particles respectively.
[0260] Schematically, in the special effect grid space, multiple binding results are processed by a grid-solve method. For example, grid-solve includes velocity projection, divergence projection, etc., and the correlation between special effect particles is strengthened through grid operations.
[0261] In some embodiments, a second adjustment speed corresponding to a target special effect particle among a plurality of second adjustment speeds is mapped to the target special effect particle to obtain a movement track corresponding to the target special effect particle within a preset time period.
[0262] Illustratively, by adjusting the first adjustment speed determined based on the broken line, the second adjustment speed obtained after the adjustment can not only show the force relationship between multiple special effect particles on the same broken line, but also show the random collision relationship between multiple special effect particles on multiple broken lines. The systematicness of the special effect particle analysis process is improved through the sequential analysis process. After mapping the second adjustment speed corresponding to the target special effect particle among the multiple second adjustment speeds to the target special effect particle, the moving trajectory corresponding to the target special effect particle is obtained, and then the moving trajectory of the strip-shaped three-dimensional model corresponding to the broken line following the movement of the specified three-dimensional model is obtained.
[0263] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0264] In an optional embodiment, after the DER method is used to calculate the speed change between the i-th moment and the i+1-th moment, the MPM method is used to implement collision detection analysis.
[0265] Optionally, the DER method uses implicit integration, while the MPM method uses explicit integration. Therefore, the time step of the DER method can be longer than that of the MPM method. Therefore, after calculating the velocity change between the i-th moment and the i+1-th moment by the DER method, it is necessary to calculate the multi-step MPM method, which can improve the calculation efficiency at the same time.
[0266] Schematically, in order to synchronize the single-step DER and the multi-step MPM, the speed change Δu calculated by the DER method is divided into N equal parts, where N is the number of steps of the MPM. Before each calculation of the MPM, the speed change Δu is applied to the first speed value u of the special effect particle, and then the MPM calculation is performed. For example: the MPM calculation is performed on the sum of the speed change Δu corresponding to the special effect particle A and the first speed value u of the special effect particle A.
[0267] like Fig. 9 As shown, it is a schematic diagram of the step length comparison of the time step, wherein the step length corresponding to the MPM method 910 is Δt; accordingly, if the number of steps of the MPM method is N, the time step of the DER method 920 is NΔt.
[0268] Similarly, special attention should be paid to specifying the motion of the three-dimensional model (e.g., determined by the SDF method). When calculating DER, the state of the SDF should be the state at t+NΔt, and when calculating the i-th step MPM, the state of the SDF should be the state at t+iΔt, where t is any moment, such as the i-th moment mentioned above.
[0269] In an optional embodiment, in order to simulate the fluffy feeling of hair, a physical model of water or sand can be used as a ribbon-shaped three-dimensional model in the MPM stage.
[0270] The physical model of water or sand will protect the special effect particles corresponding to the broken lines of the strip-shaped 3D model; on the other hand, the physical model of sand can also simulate friction, so it can be applied to not very smooth strip-shaped 3D models, such as virtual hair.
[0271] In an optional embodiment, in the original MPM method, a character model with a complex mesh can be used as a collision body to interact with special effect particles.
[0272] Optionally, in order to improve real-time efficiency, in the algorithm framework of the embodiment of the present application, an analytic collision body (Analytic SDF) can be selected as a specified three-dimensional model, such as a sphere, a cuboid, a cylinder, and a capsule. The animation of these analytic collision bodies is updated quickly, which improves the simulation efficiency.
[0273] In an optional embodiment, in real-time scenarios such as games, simulation stability is very important. Methods such as DER and MPM sometimes only consider the mathematical expression of the problem under ideal conditions, but do not consider the problems that may be encountered in engineering practice.
[0274] Schematically, a concept called curvature binormal is introduced in the DER method, and the definition formula of curvature binormal is shown in the following formula 2.
[0275] Formula 2:
[0276]
[0277] Among them, t is the tangent, i-1 and i are the subscripts of the edge. It can be noticed that when the angle between the edges connecting two adjacent particles is close to 180°, the binormal of curvature will be infinite, which will cause the simulation to explode.
[0278] Optionally, the minimum denominator of the curvature binormal formula in the above formula 2 is limited to a non-zero value (such as 0.01) to avoid obtaining a huge curvature binormal, and this process will not have much impact on the visual effect of the simulation. That is, the above process finds all particle connection edges that may cause simulation explosions as bad cases, and performs targeted processing as shown in the above formula 2 to avoid affecting the stability of the simulation.
[0279] In an optional embodiment, the trajectory route is randomly generated.
[0280] The trajectory route is used to indicate that the specified 3D model moves along the trajectory route. Fig.10 As shown, an irregular trajectory route 1010 is randomly generated, and the trajectory route starts from any point, generates the trajectory route through random turning transformation (such as: at least one turn) and reaches the end point.
[0281] Optionally, the designated three-dimensional model is controlled to move along a trajectory route.
[0282] Indicative, such as Fig.10 As shown, after the trajectory route is obtained, the specified three-dimensional model 1020 (such as a virtual head) is controlled to move along the trajectory route. During the movement, the strip three-dimensional model (such as virtual hair) bound to the specified three-dimensional model 1020 moves along with the movement of the specified three-dimensional model, and the movement trajectory of the strip three-dimensional model is determined through the above process, thereby performing a stability test process on the movement process of the specified three-dimensional model through the randomly generated trajectory route.
[0283] That is, during the stability test, the 3D strip is controlled to move rapidly along a randomly generated trajectory, and the rotation of the specified 3D model is constantly and randomly changed. This is run continuously for hundreds of hours to ensure that the simulation does not explode.
[0284] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0285] To sum up, in order to avoid the problem of poor analysis efficiency caused by directly performing comprehensive analysis on multiple broken lines, the speed changes corresponding to multiple special effect particles on the broken lines are determined by analyzing the multiple broken lines separately, and then the multiple broken lines are comprehensively analyzed on the basis of analyzing the multiple broken lines separately. This can improve the efficiency of calculation and analysis, generate the accompanying movement animation that accompanies the movement of the specified three-dimensional model in a more real-time and efficient manner, improve the timeliness of animation generation, and enable the animation generation method of the strip three-dimensional model to be applied to a wider range of scenarios.
[0286] In the embodiment of the present application, a process of obtaining the corresponding moving trajectory of special effect particles by means of the mapping conversion relationship between the special effect grid space and the special effect particles is introduced. After obtaining the first adjustment speed corresponding to multiple special effect particles related to the broken line, the first adjustment speed is adjusted by analyzing the collision relationship between the multiple special effect particles. The two adjustments make the analysis process of the special effect particles more organized, while ensuring the stability of the moving trajectory generation, the generation efficiency of the moving trajectory is improved.
[0287] In an optional embodiment, the above animation generation method is applied to the trajectory generation process of virtual hair, the specified three-dimensional model is implemented as a virtual head, and the strip-shaped three-dimensional model is implemented as virtual hair bound to the virtual head. The above animation generation method is called "a framework for efficient and stable calculation of hair animation", that is: a trajectory generation algorithm framework for simulating virtual hair movement is constructed based on the animation generation method. Schematically, as shown in FIG. Fig.11 As shown, the above animation generation method can also be implemented as the following steps 1110 to 1130.
[0288] Step 1110, update boundary conditions.
[0289] Update boundary condition is used to indicate the boundary condition of updating the current time step, that is, to update the state of the virtual environment including the specified 3D model and the strip 3D model at the current time step. For example, the virtual head is the head of the virtual object A, and the update boundary condition is used to indicate the condition of updating the virtual environment where the virtual object A is located.
[0290] Among them, the boundary conditions include the state of the current physical world (such as gravity, custom force fields, etc.), the motion state (such as position and rotation) of rigid bodies in the physical world (such as virtual bodies, virtual objects in virtual environments, etc.), and the motion state (position and rotation) of the virtual head bound to the virtual hair.
[0291] Optionally, movement of virtual hair roots (the roots of virtual hair) based on the movement of the virtual head may also be performed here.
[0292] Step 1120, semi-implicit integration.
[0293] Schematically, the implicit integrator DER is used to calculate the velocity change Δu of the special effect particles on each virtual hair within this time step Δt (from the i-th moment to the i+1-th moment), while considering the interaction between multiple special effect particles on the virtual hair and ignoring the special effect particle collision of the virtual hair itself and the special effect particle collision between virtual hairs.
[0294] The above process will solve the collision between the virtual hair and other rigid bodies in the virtual environment. For the content of the semi-implicit integral DER, please refer to the above step 340, which will not be repeated here.
[0295] Step 1130, explicit integration.
[0296] After determining the velocity changes corresponding to multiple special effect particles on the virtual hair based on the semi-implicit integration DER, the explicit integration MPM method is adopted to ignore the particle connection edges between multiple special effect particles on the virtual hair, and treat the special effect particles on the virtual hair as discrete special effect particles. In one DER time step, the special effect particles are simulated N times by MPM, so as to determine the movement trajectory based on the collision between multiple special effect particles on multiple broken lines.
[0297] Optionally, after determining the speed change, when performing any one of the N MPM simulations, 1 / N of the speed change obtained in the previous stage is applied to perform the current MPM simulation, and determine the movement trajectory of the special effect particles.
[0298] The explicit integration includes a process of mapping special effect particles to special effect grid space (Particle to Grid, P2G), a grid processing process, and a process of mapping special effect grid space to special effect particles (Grid to Particle, G2P).
[0299] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0300] In an optional embodiment, the DER method and the MPM method are combined to obtain an algorithm framework, and the algorithm logic of the algorithm framework is implemented as the above-mentioned logic of determining the moving trajectory corresponding to the special effect particles.
[0301] Schematically, the initial state of the virtual hair, the state of the virtual environment in which the virtual hair is located, the state of the boundary conditions, additional specified constraints, etc. are taken as input, and a frame sequence of the virtual hair movement is calculated as output. The above algorithm framework is connected to a scene selected by the user through a code interface adapted to the above algorithm framework, so as to obtain the accompanying movement animation of the virtual hair.
[0302] Optionally, several application scenarios to which the above algorithm framework can be applied are schematically introduced.
[0303] (1) Customize the parameters of virtual hair and the movement of the virtual head in a pre-set virtual scene. In principle, the movement trajectory of the virtual head over a period of time is pre-specified, and after everything is ready, the program corresponding to the virtual scene is run to obtain the accompanying movement animation of the virtual hair during the period of time, and then the accompanying movement animation is imported into other 3D scene processing software for subsequent processing.
[0304] (2) In a game engine or other similar 3D processing software, the algorithm framework is imported into the game engine through a code interface, and is further encapsulated and exposed to users of the game engine.
[0305] (3) The algorithm framework is directly used in the game engine. When the engine is updated, the algorithm framework is used to calculate the movement trajectory of the virtual hair in the game scene, and the accompanying movement animation is updated in real time. Due to the high efficiency of the algorithm framework, it is not difficult to apply it in similar real-time scenarios.
[0306] Optionally, the above algorithm framework is encapsulated in the game engine (Unreal Engine) to obtain the overall plug-in settings (Physion Groom), such as Fig.12 As shown, it is a flowchart of encapsulating the above algorithm framework in Unreal Engine to obtain PhysionGroom and operate Physion Groom.
[0307] Step 1210, import virtual hair parameters.
[0308] Indicatively, import existing database parameters in the Unreal Engine's content browser (e.g., import through the database migration tool Alembic). The general standard parameter format of virtual hair is implemented as Strand-based. After importing, Alembic will automatically convert to Groom assets.
[0309] Optionally, different areas and hairstyles can generally be made into different "hair blocks", stored as Alembic and imported into the engine.
[0310] Step 1220, adding overall settings and collision bodies to the virtual object.
[0311] Instructively, add a Physion Groom component to the virtual object (Actor) in Unreal Engine, and mount several PhysionSdf components on the Physion Groom component that are responsible for collision and driving the movement of the hair root special effect particles on the virtual hair; the Physion Sdf component can select a variety of analytical collision body forms, such as capsules, spheres, planes, etc.
[0312] Optionally, add a detail panel for each Physion component under the Actor, which shows the hierarchical relationship of each Physion component.
[0313] Schematically, the Physion Groom component provides some basic physical settings of Physion, such as gravity direction, mesh density, etc., which users generally do not need to change.
[0314] Schematically, the Physion Sdf component is a collision body component used to handle hair binding and collision. The PhysionSdf component includes a variety of shapes, such as capsules, spheres, etc.
[0315] Schematically, the Physion Sub Groom component is used to mount virtual hair parameters. Currently, most virtual hair parameters are modified under this component.
[0316] Step 1230, adding several blocks of virtual hair.
[0317] Indicatively, several Physion Sub Groom components are mounted on the Physion Sdf component that drives the movement of the hair root special effect particles on the virtual hair. The Physion Sub Groom component is mainly responsible for mounting the Groom assets of the corresponding "hair blocks" and taking on the responsibility of generation.
[0318] Step 1240, set the hair parameters and align with the collision body.
[0319] Instructively, the parameters of the virtual hair are set, that is, different "hair blocks" are mounted on different PhysionSub Groom components, and after mounting, the virtual hair is aligned with the collision body (such as the capsule body) shown in the Physion Sdf.
[0320] Alternatively, if Fig.13As shown, area 1310 is the actual scene after the various Physion Groom plug-ins are set up in Unreal Engine, that is, area 1310 shows the scene after the corresponding hair asset is mounted for Physion Sub Groom and aligned with Physion Sdf; wherein, the setting process is performed by Fig.13 The area shown in the middle area 1320 is represented.
[0321] Step 1250, adjust physical parameters and preview the simulation.
[0322] Schematically, adjust various physical parameters on the Physion Sub Groom component, and then click Play in the UnrealEngine editor to preview the real-time simulation results. At this time, click Play in Unreal Engine to preview the simulation.
[0323] like Fig.14 As shown in FIG. 14 , a product-side application example of using the Physion Groom plug-in to mount various complex hair blocks is shown. As shown in area 1410 , the virtual hair of the virtual object can be realized as various hairstyles such as long hair 1411 , curly hair, and braids 1412 ; as shown in area 1420 , the details panel shows that multiple Physion SubGroom components are placed under the Physion Sdf component, which are responsible for the mounting process of each hair block.
[0324] It is worth noting that the above application scenarios and application examples are merely illustrative examples and are not limited to the embodiments of the present application.
[0325] To sum up, in order to avoid the problem of poor analysis efficiency caused by directly performing comprehensive analysis on multiple broken lines, the speed changes corresponding to multiple special effect particles on the broken lines are determined by analyzing the multiple broken lines separately, and then the multiple broken lines are comprehensively analyzed on the basis of analyzing the multiple broken lines separately. This can improve the efficiency of calculation and analysis, and generate the accompanying movement animation that accompanies the movement of the specified three-dimensional model in a more real-time and efficient manner, improve the timeliness of animation generation, and enable the animation generation method of the strip three-dimensional model to be applied to a wider range of scenarios.
[0326] In an embodiment of the present application, a framework for simulating hair animation quickly and stably is proposed, which combines the DER algorithm and the MPM algorithm, and proposes a large number of engineering practice strategies to ensure high efficiency and high stability, so that the algorithm framework based on the combination of the DER algorithm and the MPM algorithm can produce highly realistic hair animation within a limited time budget. The algorithm framework can be applied to various real-time scenarios to generate high-quality virtual hair and improve the simulation of virtual objects.
[0327] Fig.15 is a structural block diagram of an animation generating device provided by an exemplary embodiment of the present application, such as Fig.12 As shown, the device includes the following parts:
[0328] A broken line acquisition module 1510 is used to acquire broken lines corresponding to a plurality of strip-shaped three-dimensional models, wherein the broken lines include a plurality of special effect particles, and the strip-shaped three-dimensional models are bound to a specified three-dimensional model;
[0329] A force determination module 1520 is used to determine, for a target fold line among the multiple fold lines, in response to the movement of the designated three-dimensional model at the i-th moment, based on the movement speed and movement direction of the designated three-dimensional model, force values corresponding to the multiple special effect particles on the target fold line at the i-th moment, wherein the force values are used to represent the force conditions of the special effect particles on the target fold line when the designated three-dimensional model moves, wherein i is a positive integer;
[0330] The speed determination module 1530 is used to calculate the speed change of the special effect particle between the i-th moment and the i+1-th moment based on the force value, and obtain the speed changes corresponding to the plurality of special effect particles on the target fold line;
[0331] The trajectory calculation module 1540 is used to calculate the movement trajectories corresponding to the multiple special effect particles respectively based on the movement speed of the special effect particles on the multiple broken lines at the i-th moment and the speed change of the special effect particles, and generate an accompanying movement animation of the strip-shaped three-dimensional model accompanying the specified three-dimensional model based on the movement trajectory.
[0332] In an optional embodiment, the trajectory calculation module 1540 is also used to, for the target special effect particle, merge the speed change of the target special effect particle at the i-th moment with the moving speed of the target special effect particle at the i-th moment to obtain a first adjustment speed of the target special effect particle; obtain the first adjustment speeds corresponding to multiple special effect particles on the multiple broken lines, the first adjustment speeds being used to characterize the movement of the target special effect particle at a sub-moment between the i-th moment and the i+1-th moment; determine the moving trajectory corresponding to the target special effect particle based on the multiple first adjustment speeds within a preset time period, and obtain the moving trajectories corresponding to the multiple special effect particles, the preset time period including multiple moments including the i-th moment.
[0333] In an optional embodiment, the plurality of broken lines are in a special effect grid space, and the special effect particles corresponding to the plurality of broken lines are located in the special effect grid space;
[0334] The trajectory calculation module 1540 is also used to bind the first adjustment speeds corresponding to the multiple special effect particles respectively with the corresponding special effect particles to obtain multiple binding results, wherein the mth special effect particle is bound to the corresponding mth first adjustment speed, and m is a positive integer; the multiple binding results are mapped to the special effect grid space for particle collision detection to obtain the moving trajectory corresponding to the target special effect particle within the preset time period.
[0335] In an optional embodiment, the trajectory calculation module 1540 is also used to map the multiple binding results to the special effect grid space; perform collision simulation on the multiple binding results through the special effect grid space to obtain second adjustment speeds corresponding to the multiple special effect particles respectively; map the second adjustment speed corresponding to the target special effect particle among the multiple second adjustment speeds to the target special effect particle to obtain a moving trajectory corresponding to the target special effect particle within the preset time period.
[0336] In an optional embodiment, the speed determination module 1530 is also used to determine the first speed value of the special effect particle corresponding to the force value at the i-th moment; determine the acceleration value of the special effect particle at the i-th moment based on the force value; calculate the second speed value of the special effect particle at the i+1-th moment based on the first speed value at the i-th moment and the acceleration value at the i-th moment; use the difference between the second speed value and the first speed value as the speed change of the special effect particle between the i-th moment and the i+1-th moment, and obtain the speed changes corresponding to multiple special effect particles on the target broken line.
[0337] In an optional embodiment, the speed determination module 1530 is further used to obtain the special effect particle mass of the special effect particle; and obtain the acceleration value of the special effect particle at the i-th moment based on the force value and the special effect particle mass.
[0338] In an optional embodiment, the force determination module 1520 is also used to determine, in response to the movement of the designated three-dimensional model at the i-th moment, the stretching forces corresponding to the multiple special effect particles at the i-th moment based on the moving speed and moving direction of the designated three-dimensional model, the stretching force being used to indicate the stretching condition of the special effect particles by two adjacent special effect particles; determine the bending forces corresponding to the multiple special effect particles at the i-th moment based on the moving speed and moving direction of the designated three-dimensional model, the bending force being used to indicate the influence of the plane angle of the special effect particles by two adjacent special effect particles; determine the twisting forces corresponding to the multiple special effect particles at the i-th moment based on the moving speed and moving direction of the designated three-dimensional model, the twisting force being used to indicate the influence of the spatial angle of the special effect particles by two adjacent special effect particles; and determine the force values corresponding to the multiple special effect particles based on at least one of the stretching force, the bending force and the twisting force.
[0339] In an optional embodiment, the force determination module 1520 is also used to determine the target tensile force, target bending force and target twisting force corresponding to any one target special effect particle among the multiple special effect particles; the resultant force of the target tensile force, the target bending force and the target twisting force is used as the force value corresponding to the target special effect particle, and the force values corresponding to the multiple special effect particles are obtained respectively.
[0340] In an optional embodiment, the force determination module 1520 is also used to determine, for a target special effect particle, a first special effect particle and a second special effect particle adjacent to the target special effect particle; based on the moving speed and moving direction of the specified three-dimensional model, obtain a first bending energy value corresponding to the first special effect particle and a second bending energy value corresponding to the second special effect particle, the bending energy value being used to represent the angle change of the particle connecting edge connecting two adjacent special effect particles; and obtain the force value of the target special effect particle based on the first bending energy value and the second bending energy value.
[0341] In an optional embodiment, the force determination module 1520 is also used to determine a third special effect particle and a target special effect particle adjacent to the first special effect particle; determine a fourth special effect particle and a target special effect particle adjacent to the second special effect particle; obtain the first bending energy value based on the relative positions among the first special effect particle, the third special effect particle and the target special effect particle; obtain the second bending energy value based on the relative positions among the second special effect particle, the fourth special effect particle and the target special effect particle.
[0342] In an optional embodiment, the speed determination module 1530 is further used to obtain the speed changes corresponding to the multiple special effect particles on the multiple broken lines based on parallel analysis of the multiple broken lines.
[0343] In an optional embodiment, the speed determination module 1530 is also used to obtain a first number of broken lines from the multiple broken lines; obtain the speed changes corresponding to the multiple special effect particles on the first number of broken lines; obtain a second number of broken lines from the multiple broken lines except the first number of broken lines; perform interpolation operations on the speed changes corresponding to the multiple special effect particles on the first number of broken lines, and obtain the interpolated speed changes corresponding to the second number of broken lines as the speed changes.
[0344] In an optional embodiment, the trajectory calculation module 1540 is further used to generate a plurality of moving trajectory animation frames according to the moving trajectories respectively corresponding to the plurality of special effect particles; and the plurality of moving trajectory animation frames are generated to obtain the following moving animation.
[0345] To sum up, in order to avoid the problem of poor analysis efficiency caused by directly performing comprehensive analysis on multiple broken lines, the speed changes corresponding to multiple special effect particles on the broken lines are determined by analyzing the multiple broken lines separately, and then the multiple broken lines are comprehensively analyzed on the basis of analyzing them separately. This can improve the calculation and analysis efficiency while ensuring the accuracy of trajectory calculation, generate the accompanying movement animation that accompanies the movement of the specified three-dimensional model more real-time and efficiently, improve the timeliness of animation generation, and enable the animation generation method of the strip three-dimensional model to be applied to a wider range of scenarios.
[0346] It should be noted that the animation generation device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the animation generation device provided in the above embodiment and the animation generation method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0347] Fig.16The schematic diagram of the structure of a server provided by an exemplary embodiment of the present application is shown. The server 1600 includes a central processing unit (CPU) 1601, a system memory 1604 including a random access memory (RAM) 1602 and a read-only memory (ROM) 1603, and a system bus 1605 connecting the system memory 1604 and the central processing unit 1601. The server 1600 also includes a mass storage device 1606 for storing an operating system 1613, an application program 1614, and other program modules 1615.
[0348] The mass storage device 1606 is connected to the central processing unit 1601 through a mass storage controller (not shown) connected to the system bus 1605. The mass storage device 1606 and its associated computer readable media provide non-volatile storage for the server 1600. That is, the mass storage device 1606 may include a computer readable medium (not shown) such as a hard disk or a compact disc read only memory (CD-ROM) drive.
[0349] Without loss of generality, computer readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. The above-mentioned system memory 1604 and mass storage device 1606 can be collectively referred to as memory.
[0350] According to various embodiments of the present application, the server 1600 can also be connected to a remote computer on the network through a network such as the Internet. That is, the server 1600 can be connected to the network 1612 through the network interface unit 1611 connected to the system bus 1605, or the network interface unit 1611 can be used to connect to other types of networks or remote computer systems (not shown).
[0351] The above-mentioned memory also includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU.
[0352] An embodiment of the present application also provides a computer device, which includes a processor and a memory, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the animation generation method provided by the above-mentioned method embodiments.
[0353] An embodiment of the present application also provides a computer-readable storage medium, on which is stored at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the animation generation method provided by the above-mentioned method embodiments.
[0354] The embodiments of the present application also provide a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the animation generation method described in any of the above embodiments.
[0355] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. An animation generation method, characterized in that: The method comprises: Acquire multiple broken lines corresponding to strip-shaped three-dimensional models, wherein the broken lines include multiple special effect particles, and the strip-shaped three-dimensional models are bound to the specified three-dimensional model; For a target fold line among the multiple fold lines, in response to the movement of the designated three-dimensional model at the i-th moment, based on the movement speed and movement direction of the designated three-dimensional model, determine the force values corresponding to the multiple special effect particles on the target fold line at the i-th moment, the force values are used to represent the force conditions of the special effect particles on the target fold line when the designated three-dimensional model moves, wherein i is a positive integer; Calculate the speed change of the special effect particle between the i-th moment and the i+1-th moment based on the force value, and obtain the speed changes corresponding to the plurality of special effect particles on the target fold line; The moving trajectories corresponding to the multiple special effect particles are calculated based on the moving speeds of the special effect particles on the multiple broken lines at the i-th moment and the speed changes of the special effect particles, and an accompanying moving animation of the strip-shaped three-dimensional model accompanying the specified three-dimensional model is generated based on the moving trajectories.
2. The method according to claim 1, characterized in that: The calculating the movement trajectories respectively corresponding to the plurality of special effect particles based on the movement speeds of the special effect particles on the plurality of broken lines at the i-th moment and the speed changes of the special effect particles comprises: For a target special effect particle, a speed change of the target special effect particle at the i-th moment is merged with a moving speed of the target special effect particle at the i-th moment to obtain a first adjustment speed of the target special effect particle, wherein the first adjustment speed is used to characterize a movement of the target special effect particle at a sub-moment between the i-th moment and the i+1-th moment; Obtaining first adjustment speeds respectively corresponding to a plurality of special effect particles on the plurality of broken lines; Based on a plurality of first adjustment speeds within a preset time period, a movement trajectory corresponding to the target special effect particle is determined, and the movement trajectories respectively corresponding to the plurality of special effect particles are obtained, wherein the preset time period includes a plurality of moments including the i-th moment.
3. The method according to claim 2, characterized in that The plurality of broken lines are in a special effect grid space, and the special effect particles corresponding to the plurality of broken lines are located in the special effect grid space; The step of determining the moving trajectory corresponding to the target special effect particle based on a plurality of first adjustment speeds within a preset time period includes: Binding the first adjustment speeds respectively corresponding to the plurality of special effect particles to the corresponding special effect particles to obtain a plurality of binding results, wherein the mth special effect particle is bound to the corresponding mth first adjustment speed, where m is a positive integer; The multiple binding results are mapped to the special effect grid space to perform particle collision detection, and a moving trajectory corresponding to the target special effect particle within the preset time period is obtained.
4. The method according to claim 3, characterized in that Mapping the plurality of binding results to the special effect grid space to perform particle collision detection to obtain a movement trajectory corresponding to the target special effect particle within the preset time period includes: Mapping the plurality of binding results to the special effect grid space; Performing collision simulation on the plurality of binding results through the special effect grid space to obtain second adjustment speeds respectively corresponding to the plurality of special effect particles; A second adjustment speed corresponding to the target special effect particle among a plurality of second adjustment speeds is mapped to the target special effect particle to obtain a movement track corresponding to the target special effect particle within the preset time period.
5. The method according to any one of claims 1 to 4, characterized in that: The step of calculating the speed change of the special effect particle between the i-th moment and the i+1-th moment based on the force value to obtain the speed change corresponding to the plurality of special effect particles on the target broken line includes: Determine a first velocity value of the special effect particle corresponding to the force value at the i-th moment; Determine the acceleration value of the special effect particle at the i-th moment based on the force value; Based on the first speed value at the i-th moment and the acceleration value at the i-th moment, a second speed value of the special effect particle at the i+1-th moment is calculated; The difference between the second speed value and the first speed value is used as the speed change of the special effect particle between the i-th moment and the (i+1)-th moment, to obtain the speed changes corresponding to the plurality of special effect particles on the target broken line.
6. The method according to claim 5, characterized in that The determining the acceleration value of the special effect particle at the i-th moment based on the force value includes: Obtaining the special effect particle mass of the special effect particle; The acceleration value of the special effect particle at the i-th moment is obtained based on the force value and the mass of the special effect particle.
7. The method according to any one of claims 1 to 4, characterized in that: In response to the movement of the designated three-dimensional model at the i-th moment, based on the movement speed and movement direction of the designated three-dimensional model, determining the force values corresponding to the plurality of special effect particles on the target fold line at the i-th moment, respectively, includes: In response to the designated three-dimensional model moving at the i-th moment, determining the stretching forces respectively corresponding to the plurality of special effect particles at the i-th moment based on the moving speed and moving direction of the designated three-dimensional model, wherein the stretching forces are used to indicate a stretching condition of the special effect particle by two adjacent special effect particles; Determine, based on the moving speed and moving direction of the specified three-dimensional model, the bending forces respectively corresponding to the plurality of special effect particles at the i-th moment, the bending forces being used to indicate the influence of two adjacent special effect particles on the plane angle of the special effect particle; Determine, based on the moving speed and moving direction of the specified three-dimensional model, the distortion forces respectively corresponding to the plurality of special effect particles at the i-th moment, the distortion forces being used to indicate the spatial angle influence of two adjacent special effect particles on the special effect particle; Based on at least one of the stretching force, the bending force and the twisting force, force values corresponding to the plurality of special effect particles are determined.
8. The method according to claim 7, characterized in that The determining, based on at least one of the stretching force, the bending force, and the twisting force, force values corresponding to the plurality of special effect particles respectively comprises: For any target special effect particle among the plurality of special effect particles, determining a target stretching force, a target bending force, and a target twisting force corresponding to the target special effect particle; The resultant force of the target tensile force, the target bending force and the target twisting force is used as the force value corresponding to the target special effect particle, and the force values corresponding to the multiple special effect particles are obtained.
9. The method according to claim 7, characterized in that: The determining, based on the moving speed and moving direction of the specified three-dimensional model, the bending forces respectively corresponding to the plurality of special effect particles at the i-th moment includes: For a target special effect particle, determining a first special effect particle and a second special effect particle adjacent to the target special effect particle; Based on the moving speed and moving direction of the specified three-dimensional model, a first bending energy value corresponding to the first special effect particle and a second bending energy value corresponding to the second special effect particle are obtained, where the bending energy values are used to represent the angle change of the particle connection edge connecting two adjacent special effect particles; The force value of the target special effect particle is obtained based on the first bending energy value and the second bending energy value.
10. The method according to claim 9, characterized in that The obtaining of a first bending energy value corresponding to the first special effect particle and a second bending energy value corresponding to the second special effect particle includes: Determining a third special effect particle and a target special effect particle adjacent to the first special effect particle; Determining a fourth special effect particle and a target special effect particle adjacent to the second special effect particle; acquiring the first bending energy value based on the relative positions of the first special effect particle, the third special effect particle, and the target special effect particle; The second bending energy value is obtained based on the relative positions of the second special effect particle, the fourth special effect particle, and the target special effect particle.
11. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Based on the parallel analysis of the multiple broken lines, the speed changes corresponding to the multiple special effect particles on the multiple broken lines are obtained.
12. The method according to claim 11, characterized in that The method of obtaining the speed changes corresponding to the plurality of special effect particles on the plurality of broken lines based on the parallel analysis of the plurality of broken lines includes: obtaining a first number of foldlines from the plurality of foldlines; Obtain speed changes corresponding to a plurality of special effect particles on the first number of broken lines; Acquire a second number of foldlines from the plurality of foldlines except the first number of foldlines; An interpolation operation is performed on the speed changes corresponding to the plurality of special effect particles on the first number of broken lines to obtain the interpolated speed changes corresponding to the second number of broken lines as the speed changes.
13. The method according to any one of claims 1 to 4, characterized in that: The step of generating a movement animation in which the strip-shaped three-dimensional model moves along with the designated three-dimensional model based on the movement trajectory includes: Generate multiple moving track animation frames through the moving tracks corresponding to the multiple special effect particles respectively; The plurality of movement trajectory animation frames are generated to obtain the follow-up movement animation.
14. An animation generating device, characterized in that: The device comprises: A broken line acquisition module, used to acquire broken lines corresponding to a plurality of strip-shaped three-dimensional models, wherein the broken lines include a plurality of special effect particles, and the strip-shaped three-dimensional models are bound to a specified three-dimensional model; a force determination module, for determining, for a target fold line among the multiple fold lines, force values corresponding to the multiple special effect particles on the target fold line at the i-th moment in response to the movement of the designated three-dimensional model at the i-th moment, based on the movement speed and movement direction of the designated three-dimensional model, wherein the force values are used to represent the force conditions of the special effect particles on the target fold line when the designated three-dimensional model moves, wherein i is a positive integer; A speed determination module, used for calculating the speed change of the special effect particle between the i-th moment and the (i+1)-th moment based on the force value, and obtaining the speed changes corresponding to the plurality of special effect particles on the target fold line; The trajectory calculation module is used to calculate the movement trajectories corresponding to the multiple special effect particles respectively based on the movement speed of the special effect particles on the multiple broken lines at the i-th moment and the speed change of the special effect particles, and generate an accompanying movement animation of the strip-shaped three-dimensional model accompanying the specified three-dimensional model based on the movement trajectory.
15. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the animation generation method according to any one of claims 1 to 13.
16. A computer-readable storage medium, characterized in that: The storage medium stores at least one program, and the at least one program is loaded and executed by the processor to implement the animation generation method according to any one of claims 1 to 13.
17. A computer program product, characterized in that It comprises a computer program or an instruction, which, when executed by a processor, implements the animation generation method as claimed in any one of claims 1 to 13.
