Animation generation method and apparatus, device, storage medium, and program product
By decomposing the 3D hair model into multiple polylines and calculating the force data and velocity changes of 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.
Patent Information
- Application Number
- PCT/CN2024/078492
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-26
- Filing Date
- 2024-02-26
- Publication Date
- 2024-10-31
AI Technical Summary
When generating high-fidelity three-dimensional hair animations, the existing technology has low analysis efficiency and cannot meet real-time requirements, especially in terms of calculation of motion trajectories and collision analysis between multiple hairs.
By decomposing the strip-shaped 3D model into multiple polylines, each polyline contains multiple special effect particles, the force data and velocity changes of the special effect particles are calculated based on the movement speed and direction of the specified 3D model, and then animation is generated to avoid direct synthesis. Analyze the inefficiencies of multiple polylines.
The efficiency and timeliness of animation generation are improved, allowing the animation of striped 3D models to be applied in a wider range of scenes to meet real-time requirements.
Smart Images

Figure CN2024078492_31102024_PF_FP_ABST
Abstract
Description
Animation generation method, device, equipment, storage medium and program product
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on April 26, 2023, with application number 2023104788963 and application name “Animation generation method, device, equipment, storage medium and program product”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of computer technology, and in particular to animation generation technology. Background Art
[0003] Computer graphics technology is a branch of applied computer science, widely used in fields such as gaming and modeling. In recent years, with the explosive growth of virtual digital objects in the modeling field, high-quality virtual digital objects have garnered increasing attention. High-fidelity three-dimensional (3D) hair can significantly enhance the realism of virtual digital objects.
[0004] In related technologies, a simulation method based on a point-line model is usually used to model hair into multiple line segments of finite length. Each line segment is composed of a certain number of particles and lines connecting adjacent particles. By comprehensively analyzing the movement between multiple particles, the movement of the hair is calculated.
[0005] However, the above analysis method usually needs to comprehensively consider the movement between multiple hairs to calculate the motion trajectories of a large number of 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 analysis data is large and the analysis efficiency is low, which cannot be well applied to animation generation scenarios with high real-time requirements.
[0006] Summary of the Invention
[0007] The present invention provides an animation generation method, apparatus, device, medium, and program product that can improve computational analysis efficiency while ensuring trajectory calculation accuracy, and more effectively and in real time generate an animation of a strip-shaped 3D model moving along with a specified 3D model. The technical solution is as follows.
[0008] In one aspect, a method for generating an animation is provided, which is executed by a computer device, and the method comprises:
[0009] Determining a polyline corresponding to each of a plurality of strip-shaped three-dimensional models, wherein the polyline includes a plurality of special effect particles, and the strip-shaped three-dimensional model is bound to a specified three-dimensional model;
[0010] For a target fold line among the multiple fold lines, in response to the designated three-dimensional model generating movement at time i, force data corresponding to each of the multiple special effect particles on the target fold line at time i is determined based on the movement speed and movement direction of the designated three-dimensional model, the force data being used to represent the force conditions of the special effect particles on the target fold line when moving with the designated three-dimensional model, where i is a positive integer;
[0011] For each special effect particle on the target broken line, calculating a velocity change of the special effect particle from the i-th moment to the i+1-th moment based on the force data corresponding to the special effect particle;
[0012] According to 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 on the multiple broken lines from the i-th moment to the i+1-th moment, the movement trajectories corresponding to the special effect particles on the multiple broken lines are calculated, and based on the movement trajectories, an animation of the strip-shaped three-dimensional model moving along with the specified three-dimensional model is generated.
[0013] In another aspect, an animation generation device is provided, the device comprising:
[0014] A broken line determination module is used to determine the broken lines corresponding to the 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 the specified three-dimensional model;
[0015] a force determination module for determining, for a target fold line among the plurality of fold lines, force data corresponding to each of the plurality of 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 data is used to represent the force conditions of the special effect particles on the target fold line when the special effect particles move with the designated three-dimensional model, wherein i is a positive integer;
[0016] A speed determination module is configured to calculate, for each special effect particle on the target polyline, a speed change of the special effect particle from the i-th moment to the i+1-th moment based on the force data corresponding to the special effect particle;
[0017] The trajectory calculation module is used to calculate the motion trajectories corresponding to the special effect particles on the multiple broken lines 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 on the multiple broken lines from the i-th moment to the (i+1)-th moment, and generate an animation of the multiple strip-shaped three-dimensional models moving along with the specified three-dimensional model based on the motion trajectories.
[0018] On the other hand, a computer device is provided, comprising 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.
[0019] 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. 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.
[0020] In another aspect, a computer program product or computer program is provided, comprising 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 executes the computer instructions, causing the computer device to perform the animation generation method described in any of the above embodiments.
[0021] The beneficial effects of the technical solutions provided in the embodiments of the present application include at least:
[0022] In an embodiment of the present application, taking the analysis of a target fold line among the fold lines corresponding to multiple strip-shaped three-dimensional models as an example, based on the movement speed and movement direction of the specified three-dimensional model at the i-th moment, the force data corresponding to the multiple special effect particles on the target fold line is determined, thereby calculating the velocity change of the special effect particles. Furthermore, the movement trajectories corresponding to the special effect particles on the multiple fold lines are calculated based on the movement speed and movement change of the special effect particles on the multiple fold lines. In this way, the problem of poor analysis efficiency caused by directly performing a comprehensive analysis on multiple fold lines is avoided. The present application first analyzes the multiple fold lines separately to determine the velocity change corresponding to the multiple special effect particles on the fold line. Then, based on the analysis of the multiple fold lines separately, a comprehensive analysis is performed on the multiple fold lines. This improves the efficiency of the calculation and analysis, and more effectively generates an animation of the strip-shaped three-dimensional model accompanying the movement of the specified three-dimensional model in real time, improving the timeliness of the animation generation and making the animation generation method of the strip-shaped three-dimensional model applicable to a wider range of scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] FIG1 is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;
[0024] FIG2 is a flowchart of an animation generation method provided by an exemplary embodiment of the present application;
[0025] FIG3 is a flowchart of an animation generation method provided by another exemplary embodiment of the present application;
[0026] FIG4 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;
[0027] FIG5 is a schematic diagram of calculating force data of special effect particles provided by an exemplary embodiment of the present application;
[0028] FIG6 is a schematic diagram of directly grouping special effect particles provided by an exemplary embodiment of the present application;
[0029] FIG7 is a schematic diagram of grouping special effect particles using overlapping grouping provided by an exemplary embodiment of the present application;
[0030] FIG8 is a flowchart of an animation generation method provided by another exemplary embodiment of the present application;
[0031] FIG9 is a schematic diagram showing a comparison of time step lengths provided by an exemplary embodiment of the present application;
[0032] FIG10 is a schematic diagram of a designated three-dimensional model moving along a trajectory provided by an exemplary embodiment of the present application;
[0033] FIG11 is a flowchart of an animation generation method provided by another exemplary embodiment of the present application;
[0034] FIG12 is a flowchart of configuring a game engine provided by an exemplary embodiment of the present application;
[0035] FIG13 is a diagram of a setting interface for virtual hair parameters provided by an exemplary embodiment of the present application;
[0036] FIG14 is a schematic diagram of an interface for previewing an animation of virtual hair accompanying virtual head movement provided by an exemplary embodiment of the present application;
[0037] FIG15 is a structural block diagram of an animation generating apparatus provided by an exemplary embodiment of the present application;
[0038] FIG16 is a structural block diagram of a server provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0040] First, a brief introduction is given to the terms involved in the embodiments of this application.
[0041] Graphics Processing Unit (GPU): Also known as a display core, video processor, display chip, or graphics chip, it is a microprocessor specialized for performing graphics operations on personal computers, workstations, game consoles, and some mobile devices (such as tablets and smartphones). GPUs have hundreds or thousands of cores and are optimized to run large numbers of calculations in parallel. GPUs are best known for 3D rendering in games, but are also particularly useful for running analytics, deep learning, and machine learning algorithms. Some calculations run on a GPU are 10 to 100 times faster than the same calculations on a traditional central processing unit (CPU).
[0042] Related technologies typically use simulation methods based on point-line models, modeling hair as multiple line segments of finite length. Each line segment consists of a certain number of particles and lines connecting adjacent particles. The movement of the hair is calculated by comprehensively analyzing the motion between multiple particles. However, this analysis method typically requires comprehensive consideration of the motion between multiple hairs. Calculating the motion trajectories of a large number of hairs requires considering not only collisions between hairs but also collisions between multiple particles on a single hair. This results in a large amount of analysis data and low efficiency, making it difficult to apply to animation generation scenarios with high real-time requirements.
[0043] In an embodiment of the present application, a plurality of broken lines corresponding to strip-shaped three-dimensional models bound to a specified three-dimensional model are obtained, and the broken lines include a plurality of special effect particles; for a target broken line among the plurality of broken lines, in response to the specified three-dimensional model generating movement at the i-th moment, force data corresponding to the plurality of special effect particles on the target broken line at the i-th moment are determined based on the movement speed and movement direction of the specified three-dimensional model; a speed change of the special effect particles from the i-th moment to the i+1-th moment is calculated based on the force data, and a speed change corresponding to the plurality of special effect particles on the target broken line is obtained; based on the movement 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 from the i-th moment to the i+1-th moment, the motion trajectories corresponding to the plurality of special effect particles are calculated, and an animation of the strip-shaped three-dimensional model moving along with the specified three-dimensional model is generated based on the motion trajectories. 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, the speed changes corresponding to multiple special effect particles on the broken lines are determined, and then comprehensive analysis is performed on multiple broken lines based on the separate analysis of multiple broken lines. This can improve the efficiency of calculation and analysis, and generate an animation of a strip three-dimensional model accompanied by the movement of a specified three-dimensional model in a more real-time and efficient manner, thereby improving the timeliness of animation generation.
[0044] Based on the above animation generation method, it is possible to generate an animation effect in which a strip-shaped 3D model moves along with a specified 3D model. This animation effect can be applied to various animation generation fields, such as game screen generation and scene construction. For example, an animation effect can be generated in which the hair of a virtual object moves along with the movement of the virtual object's head, an animation effect can be generated in which grass and trees in a virtual environment move in response to the vibration of the ground, or an animation effect can be generated in which the hair of a virtual animal moves along with the movement of the virtual animal. It is worth noting that the above animation generation fields and animation generation scenarios are merely illustrative examples and are not limited to these by this application.
[0045] 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, storage, display, 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 the relevant laws, regulations, and standards of the relevant region. For example, the multiple strip-shaped three-dimensional models, force values, and other data content involved in this application were all obtained with full authorization.
[0046] Next, the implementation environment involved in the embodiments of the present application is described. The animation generation method provided in the embodiments of the present application can be executed by a computer device. Specifically, it can be implemented by a terminal alone, by a server alone, or by a terminal and a server through data interaction. The embodiments of the present application are not limited to this. Optionally, the animation generation method is described using the interaction between a terminal and a server as an example.
[0047] Schematically, please refer to FIG. 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 .
[0048] In some embodiments, terminal 110 has a virtual object control function for controlling the movement of virtual objects in a virtual environment. For example, a game application is installed on terminal 110, and a player operating terminal 110 can control the movement of virtual objects in the game within the virtual scene by operating the game application. For example, the player can control the virtual object to run, jump, or turn its head within the virtual environment.
[0049] Optionally, when the player controls the movement of a virtual object, the position of the virtual object's head relative to the virtual environment changes, 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.
[0050] In some embodiments, terminal 110 transmits multiple strip-shaped 3D models to server 120 via communication network 130, so that server 120 obtains the multiple strip-shaped 3D models and determines the polylines corresponding to the multiple strip-shaped 3D models. Specifically, server 120 obtains polylines corresponding to multiple virtual hairs. The polylines include multiple special effect particles. Schematically, the multiple special effect particles included in each polyline are particles that are divided to facilitate analysis of the virtual hair.
[0051] In some embodiments, the terminal 110 will also send control data representing the control operation triggered by the player on the virtual object to the server 120 through the communication network 130. The control data includes motion data such as the movement speed and movement direction of the virtual head.
[0052] Illustratively, for any target polyline among the multiple polylines, if the control data received by server 120 indicates that a designated 3D model is moving at time i, the server 120 determines the force values corresponding to the multiple special effect particles on the target polyline at time i based on the speed and direction of the designated 3D model. Specifically, server 120 determines the force values corresponding to the multiple special effect particles on the target virtual hair at time i based on the speed and direction of the virtual head. The force values represent the force applied to the special effect particles on the target polyline as they move in conjunction with the designated 3D model, where i is a positive integer.
[0053] Optionally, after determining the force values corresponding to the multiple special effect particles on the target fold line, the server 120 calculates the speed changes of the multiple special effect particles from the i-th moment to the i+1-th moment based on the force values, and then obtains the speed changes corresponding to the multiple special effect particles on the target fold line.
[0054] Optionally, server 120 calculates the movement trajectories corresponding to the multiple special effect particles based on the movement speeds and speed changes of the special effect particles on the multiple fold lines at the i-th moment. Illustratively, server 120 uses the multiple fold lines as target fold lines based on the target fold line analysis method, thereby determining the speed changes corresponding to the multiple special effect particles on the multiple fold lines. Furthermore, server 120 combines the movement speeds and speed changes of the special effect particles on the multiple fold lines at the i-th moment, and after analyzing the fold lines individually and as a whole, more efficiently and accurately calculates the movement trajectories corresponding to the multiple special effect particles.
[0055] In some embodiments, the server 120 generates an animation of the strip three-dimensional model moving along with the specified three-dimensional model based on the calculated motion trajectories corresponding to the multiple special effect particles, and sends the animation to the terminal 110 through the communication network 130. The terminal 110 renders and displays the animation of the strip three-dimensional model moving along with the specified three-dimensional model on the screen, thereby displaying the animation of the strip three-dimensional model moving along with the specified three-dimensional model more timely.
[0056] It is worth noting that the aforementioned terminals include, but are not limited to, mobile terminals such as mobile phones, tablet computers, portable laptops, intelligent voice interaction devices, smart home appliances, and in-vehicle terminals, and may also be implemented as desktop computers, etc. The aforementioned servers may be independent physical servers, or server clusters or distributed systems composed of multiple physical servers, or 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 (CDNs), and big data and artificial intelligence platforms. In some embodiments, the aforementioned servers may also be implemented as nodes in a blockchain system.
[0057] In combination with the above-mentioned noun introduction and application scenarios, the animation generation method provided in this application is explained. Taking the method executed by the server as an example, as shown in Figure 2, the method includes the following steps 210 to 240.
[0058] Step 210: Determine the corresponding broken lines of the plurality of strip-shaped three-dimensional models.
[0059] Illustratively, the strip-shaped three-dimensional model is used to indicate a three-dimensional model that is strip-shaped or strip-shaped. The strip-shaped three-dimensional model may be implemented as, for example, virtual hair, virtual flowers and plants, virtual fur, and the like.
[0060] Optionally, based on factors such as the length and thickness of the strip-shaped three-dimensional model, broken lines corresponding to the plurality of strip-shaped three-dimensional models are obtained.
[0061] In some embodiments, the player operates the virtual object on the terminal so that the virtual hair of the virtual object moves along with the movement of the virtual object's head, 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.
[0062] 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 respectively; or, the server generates multiple strip three-dimensional models based on model development, and determines the broken lines corresponding to the multiple strip three-dimensional models respectively when analyzing the strip three-dimensional models.
[0063] Each broken line includes multiple special effect particles.
[0064] Schematically, multiple special effect particles on a broken line are connected by particle connecting edges. When the broken line includes n special effect particles, n-1 particle connecting edges are included to connect the n special effect particles.
[0065] Optionally, the special effect particles are particles located on the fold line and used to adjust the presentation of the fold line. For example, the special effect particles can adjust the curvature of the fold line, such as adjusting the angle between two edges connecting the special effect particles to achieve the effect of adjusting the fullness of the fold line; or the special effect particles can adjust the distortion of the fold line, such as adjusting the spatial distortion of two edges connecting the special effect particles.
[0066] The strip 3D model is bound to the specified 3D model.
[0067] Illustratively, the strip-shaped 3D model can be a model directly bound to the specified 3D model, i.e., a model that visually has a direct connection to the specified 3D model. Optionally, when the strip-shaped 3D model is implemented as virtual hair, the specified 3D model can be 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 can be 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 can be implemented as a virtual animal bound to the virtual hair (e.g., virtual dog hair bound to a virtual dog), etc. Of course, in actual applications, the strip-shaped 3D model can also be a model that is indirectly bound to the specified 3D model, i.e., a model that visually has no direct connection to the specified 3D model, and this embodiment of the present application does not impose any limitation on this.
[0068] Step 220, for a target broken line among the multiple broken lines, in response to the movement of the specified three-dimensional model at the i-th moment, based on the movement speed and movement direction of the specified three-dimensional model, determine the force data corresponding to the multiple special effect particles on the target broken line at the i-th moment.
[0069] Schematically, the target broken line is any broken line among the broken lines corresponding to the multiple strip-shaped three-dimensional models. When analyzing the multiple broken lines, the multiple broken lines are analyzed separately. The embodiment of the present application is explained as follows using the analysis of the target broken line among the multiple broken lines as an example.
[0070] The i-th moment is any moment. For example, the i-th moment may be a moment in the game process, or a moment in the scene construction process, etc.
[0071] Optionally, the motion of a designated 3D model is detected in real time or periodically. When the designated 3D model is detected to be moving at time i, the multiple special effect particles on the target polyline are analyzed. For example, if a virtual head is the designated 3D model, the motion of the virtual head of the virtual object is detected in real time during the game. When the virtual head is detected to be moving in the virtual scene at time i, the multiple special effect particles on the selected target virtual hair are analyzed.
[0072] In some embodiments, based on the movement speed and movement direction of the specified three-dimensional model, force data corresponding to multiple special effect particles on the target broken line at the i-th moment are determined.
[0073] Schematically, when the designated three-dimensional model bound to the multiple strip-shaped three-dimensional models moves, the multiple strip-shaped three-dimensional models will also move accordingly, and the movement process is associated with the movement of the designated three-dimensional model.
[0074] Based on the movement of the specified three-dimensional model, the movement speed and movement direction of the specified three-dimensional model are determined, thereby determining the force data corresponding to multiple special effect particles on the target broken line corresponding to the selected strip-shaped three-dimensional model.
[0075] Among them, the force data is used to represent the force situation of the special effect particles on the target broken line when they move with the specified three-dimensional model. Specifically, it can represent the force magnitude and force direction, where i is a positive integer.
[0076] Indicatively, when the movement speed of the specified 3D model is faster, the force on multiple special effect particles on the target fold line is greater; when the movement direction of the specified 3D model changes faster, the force on multiple special effect particles on the target fold line is greater, and so on.
[0077] In some embodiments, the force data may be implemented as at least one of a tensile force, a bending force, and a torsional force.
[0078] The stretching force is defined on the particle edge connecting the special effect particles, representing the stretching between the two special effect particles connected by the particle edge. For example, if special effect particles A and B are connected by particle edge 1, and the specified 3D model moves at a faster speed, the special effect particle A closer to the specified 3D model will move faster, while the special effect particle B farther away from the specified 3D model will move slower, thus generating a stretching force on particle edge 1.
[0079] Bend force is defined on effect particles to represent the bending caused by the change in the angle between the particle edges on either side of the effect particle. For example, if Particle Edge 1 and Particle Edge 2 are connected by Effect Particle A, when the 3D model is directed to turn, the bend force is determined based on the change in the angle between Particle Edge 1 and Particle Edge 2.
[0080] Distortion force is defined on effect particles to represent the distortion caused by the spatial distortion of the particle connection edges on both sides of the effect particle. For example, if Particle Connection Edge 1 and Particle Connection Edge 2 are connected by Effect Particle A, when the 3D model is directed to rotate, the distortion force is determined based on the spatial distortion of Particle Connection Edge 1 and Particle Connection Edge 2.
[0081] In some embodiments, the combined force of the stretching force, the bending force, and the twisting force is used as the force data corresponding to the special effect particles, thereby determining the force data corresponding to the plurality of special effect particles on the target broken line.
[0082] Step 230 : For each special effect particle on the target broken line, the velocity change of the special effect particle from the i-th moment to the i+1-th moment is calculated based on the force data corresponding to the special effect particle.
[0083] Illustratively, after obtaining the force data corresponding to the plurality of special effect particles, the particle masses corresponding to the plurality of special effect particles are determined.
[0084] Optionally, the particle mass is a pre-set particle parameter, for example, setting multiple special effect particles to have the same particle mass; or setting some special effect particles to have one particle mass and another part to have another particle mass.
[0085] In some embodiments, based on the force data 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.
[0086] Optionally, the time difference is determined from the i-th moment to the i+1-th moment, and then the speed change of the special effect particle from the i-th moment to the i+1-th moment is determined based on the time difference and the acceleration.
[0087] In some embodiments, based on the above process, multiple special effect particles on the target broken line are analyzed respectively, thereby determining the speed changes corresponding to the multiple special effect particles.
[0088] Step 240, 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 on the multiple broken lines from the i-th moment to the i+1-th moment, calculate the movement trajectories corresponding to the special effect particles on the multiple broken lines, and generate an animation of multiple strip-shaped three-dimensional models accompanying the movement of the specified three-dimensional model based on the movement trajectories.
[0089] Optionally, in addition to determining the speed changes corresponding to the multiple special effect particles on the target fold line, the speed changes of the special effect particles on other fold lines among the multiple fold lines are determined according to the implementation method of the above steps 220 to 230.
[0090] In some embodiments, the movement speed of the special effect particles on multiple broken lines at the i-th moment is determined, and the movement speed is used to represent the initial velocity of the special effect particles at the i-th moment; in addition, each broken line is analyzed separately to obtain the speed change of the special effect particles on each broken line.
[0091] Optionally, for each special effect particle, after determining the movement speed of the special effect particle at the i-th moment and the speed change from the i-th moment to the i+1-th moment, the sum of the movement speed and the speed change is calculated to obtain the adjustment speed corresponding to each special effect particle, that is, the first adjustment speed of multiple special effect particles on multiple broken lines is obtained.
[0092] In some embodiments, motion trajectories corresponding to the plurality of special effect particles are determined based on the first adjustment speed.
[0093] Schematically, the speed change of the special effect particle is determined based on the movement of the broken line to which it belongs, and then the first adjustment speed is obtained based on the speed change and the movement speed. The first adjustment speed can more directly show the motion trajectory of the strip three-dimensional model corresponding to the broken line following the movement of the specified three-dimensional model.
[0094] Optionally, after obtaining the first adjustment speed of each special effect particle, a comprehensive analysis is performed on multiple special effect particles on 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.
[0095] In some embodiments, the movement trajectories corresponding to the plurality of special effect particles are determined based on the second adjustment speed.
[0096] In schematic form, after obtaining the first adjustment speed based on the speed change and the movement speed, taking into account that there may be collisions between multiple broken lines, resulting in collisions between multiple special effect particles on multiple broken lines, collision detection is performed on multiple special effect particles on 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 motion trajectory of the strip three-dimensional model corresponding to the broken line following the movement of the specified three-dimensional model.
[0097] In an optional embodiment, based on the motion trajectories corresponding to the plurality of special effect particles, the motion region of the broken line including the special effect particles is adjusted.
[0098] Illustratively, 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 B are on fold line 1, while special effect particles C and D are on fold line 2. Based on the motion trajectories corresponding to special effect particles A and B, the motion region of fold line 1 including special effect particles A and B is adjusted. Similarly, based on the motion trajectories corresponding to special effect particles C and D, the motion region of fold line 2 including special effect particles C and D is adjusted, and so on.
[0099] Schematically, based on the motion regions corresponding to the multiple broken lines, an animation is generated in which the strip-shaped three-dimensional model moves along with the designated three-dimensional model.
[0100] For example, a 3D model is implemented as a virtual head, and a strip-shaped 3D model is implemented as virtual hair. Based on the motion trajectories of multiple special effect particles on the polylines corresponding to the virtual hair, the motion regions of the polylines from time i to time i+1 are determined. The motion regions indicate the areas through which the polylines pass. The motion of the polylines is determined based on the regions, thereby generating an animation that shows how the virtual hair follows the movement of the virtual head.
[0101] It should be noted that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0102] In summary, taking the analysis of a target polyline among multiple polylines as an example, the force data corresponding to the multiple special effect particles on the target polyline is determined based on the speed and direction of movement of the specified 3D model at time i, thereby calculating the velocity change of the special effect particles. Furthermore, the motion trajectories corresponding to the multiple special effect particles are determined based on the movement speeds and velocity changes of the multiple special effect particles. This avoids the problem of poor analysis efficiency caused by directly performing a comprehensive analysis of multiple polylines. By analyzing multiple polylines separately and then determining the velocity changes corresponding to the multiple special effect particles on the polyline, and then performing a comprehensive analysis of the multiple polylines based on the separate analyses, computational analysis efficiency can be improved, allowing for more real-time and efficient generation of an animation of a strip-shaped 3D model accompanying the movement of the specified 3D model. This improves the timeliness of animation generation and facilitates rendering and display of the generated animation, making the animation generation method for strip-shaped 3D models applicable to a wider range of scenarios.
[0103] In an optional embodiment, when calculating the motion trajectories corresponding to multiple special effect particles, multiple broken lines are first analyzed separately as target broken lines. Based on the separate analysis process, force data corresponding to the multiple special effect particles on the target broken lines is obtained. The velocity change determined based on the force data is related to the target broken line, and analysis efficiency can be improved by performing parallel analysis on the special effect particles on multiple broken lines. As an example, as shown in FIG3 , the embodiment shown in FIG2 can also be implemented as follows: steps 310 to 350.
[0104] Step 310: Determine the corresponding broken lines of the plurality of strip-shaped three-dimensional models.
[0105] Illustratively, a strip-shaped 3D model is used to indicate a 3D model that is strip-shaped or strip-shaped, and can be implemented as virtual hair, virtual plants, virtual fur, etc. To facilitate analysis of the strip-shaped 3D models, each strip-shaped 3D model is treated as a polyline, thereby obtaining polylines corresponding to multiple strip-shaped 3D models.
[0106] Furthermore, to facilitate analysis of the motion of the strip-shaped 3D model, the corresponding polylines are divided using special effect particles. Specifically, each polyline includes multiple special effect particles. These special effect particles represent the granularity of the polyline divisions; the more special effect particles a polyline includes, the finer the granularity.
[0107] In an optional embodiment, isotropic poly-line rods are used as the polyline representation of the strip-shaped 3D model. This means that the polyline has an isotropic property. Isotropy indicates that the corresponding physical and chemical properties of the polyline do not vary with direction, also known as homogeneity.
[0108] Schematically, as shown in FIG4 , it is a schematic diagram of a broken line corresponding to a strip-shaped three-dimensional model.
[0109] Among them, the broken line includes N special effect particles, which are represented by circles. The figure shows 4 special effect particles, namely special effect particle 410x0, special effect particle 420x1, special effect particle 430x2 and special effect particle x3; in addition, each broken line also includes N-1 particle connection edges connecting the special effect particles.
[0110] Optionally, each special effect particle has 3 degrees of freedom, which represent its position in the 3D coordinate system. Each particle connecting edge has 1 degree of freedom, which represents its rotation angle. Therefore, each polyline has 4N-1 degrees of freedom, i.e., 4N-1 = 3N+N-1.
[0111] The strip 3D model is bound to the specified 3D model.
[0112] Schematically, the strip-shaped 3D model is a model bound to the specified 3D model. Optionally, when the strip-shaped 3D model is implemented as virtual hair, the specified 3D model implements a virtual head that can be bound to the virtual hair.
[0113] Optionally, taking the implementation of the strip 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 3D model bound thereto, an initialization operation is performed on the 3D scene.
[0114] Illustratively, the 3D scene creator imports a strip-shaped 3D model corresponding to virtual hair into the 3D scene from an external source; alternatively, the 3D scene creator customizes virtual hair within the 3D scene to implement the process of importing the strip-shaped 3D model. Furthermore, after acquiring the virtual hair, physical parameters related to the virtual hair are set. For example, the length, thickness, and density of the virtual hair are set. Furthermore, for the polyline used to describe the virtual hair, the number of special effect particles on the polyline, 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, and the initial tensile force of the particle connection edges corresponding to the special effect particles are also set.
[0115] It is worth noting that the above physical parameters are merely illustrative examples and are not limited to these in the embodiments of the present application.
[0116] In addition to setting up the virtual hair, the person setting up the 3D scene also needs to select a virtual head to be bound to the virtual hair, for example: binding virtual hair A to the virtual head corresponding to virtual object 1.
[0117] 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 in the grid stores the closest distance to the surface and is used to determine whether the voxel point is inside the surface. It is usually used in collision processing to represent complex geometries, such as the virtual head.
[0118] 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.
[0119] Step 320, for a target broken line among the multiple broken lines, in response to the movement of the specified three-dimensional model at the i-th moment, based on the movement speed and movement direction of the specified three-dimensional model, determine the force data corresponding to the multiple special effect particles on the target broken line at the i-th moment.
[0120] At least one energy is defined on each broken line, and the at least one energy changes based on the motion of the specified three-dimensional model; the force data on each special effect particle is obtained based on the energy calculation.
[0121] Optionally, three types of energy are defined on the broken line, including stretching energy (Stretching), bending energy (Bending) and twisting energy (Twisting).
[0122] Among them, stretching energy is defined on the particle connection edge connecting the special effect particles, and is used to represent the stretching situation between the two special effect particles connected on the particle connection edge; bending energy is defined on the special effect particles, and is used to represent the bending situation caused by the change in the angle 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 represent the distortion situation caused by the distortion change in space of the particle connection edges on both sides of the special effect particles.
[0123] In some embodiments, for example, analyzing the force applied to any special effect particle on a target polyline, there are two special effect particles adjacent to the special effect particle on the target polyline. As shown in FIG4 , the two special effect particles adjacent to special effect particle 420 are special effect particle 410 and special effect particle 430. Special effect particles are represented by vertices or particles.
[0124] When calculating the force data of a special effect particle, the properties of the special effect particles adjacent to the special effect particle are determined. The force data of a particle consists of stretching force, bending force, and twisting force.
[0125] In an optional embodiment, in response to the designated three-dimensional model generating movement 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.
[0126] The stretching force is used to indicate the stretching condition of the special effect particle by two adjacent special effect particles.
[0127] 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 movement speed and movement direction of the specified three-dimensional model.
[0128] The bending force is used to indicate the influence of two adjacent special effect particles on the plane angle of the special effect particle.
[0129] In an optional embodiment, the distortion 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 specified three-dimensional model.
[0130] The distortion force is used to indicate the spatial angle influence of two adjacent special effect particles on the special effect particle.
[0131] In some embodiments, as shown in FIG5 , a schematic diagram of special effect particles that need to be accessed when calculating force data of a special effect particle is shown.
[0132] 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 the two adjacent special effect particles.
[0133] Indicatively, the stretching force corresponding to the special effect particle is determined by the stretching energy corresponding to the special effect particle; the twisting force corresponding to the special effect particle is determined by the twisting energy corresponding to the special effect particle; and the bending force corresponding to the special effect particle is determined by the bending energy corresponding to the special effect particle.
[0134] 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 It should be understood that the target special effect particle can be any special effect particle. In the embodiment of the present application, the target special effect particle is the special effect particle 510x i Take this as an example to introduce.
[0135] Get the first special effect particle 511x i-1 The 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 Force data.
[0136] Schematically, 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 With the third special effect particle 513x i-2 And target special effect particles 510x i The first energy value is used to represent the relative position between the first special effect particles 511xi-1 With the third special effect particle 513x i-2 The connected particles connect the edge 521, and the first special effect particle 511x i-1 With target special effect particles 510x i The energy value is determined by the bending condition between the connecting edges 522 of the connected particles.
[0137] Similarly, when determining the second special effect particle 512x i+1 When the corresponding second energy value is reached, the 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 With the fourth special effect particle 514x i+2 And target special effect particles 510x i The second energy value is used to represent the relative position between the second special effect particles 512x i+1 With the fourth special effect particle 514x i+2 The connected particles connect the edge 523, and the second special effect particle 512x i+1 With target special effect particles 510x i The energy value is determined by the bending condition between the connecting edges 524 of the connected particles.
[0138] The energy values include 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; and 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.
[0139] In this way, through the above method, based on the movement speed and direction of the specified three-dimensional model, at least one of the tensile force, bending force and twisting force corresponding to the multiple special effect particles at the i-th moment is determined as the force data corresponding to the multiple special effect particles. This can ensure that the determined force data can accurately reflect the force conditions of the special effect particles on the broken line following the movement of the specified three-dimensional model, and thus help to accurately determine the movement conditions of the special effect particles based on the force data, thereby ensuring the accuracy of the movement trajectory of the determined special effect particles, so that the animation effect of the final generated strip-shaped three-dimensional model is vivid and accurate.
[0140] Optionally, the following description is given by taking determining the bending force corresponding to special effect particles as an example.
[0141] For any target special effect particle among multiple special effect particles, a first special effect particle and a second special effect particle adjacent to the target special effect particle are determined; based on the movement speed and movement 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, and the bending energy value is used to represent the angle change of the particle connection edge connecting the two adjacent special effect particles and the target special effect particle.
[0142] A bending force of the target special effect particle is obtained based on the first bending energy value and the second bending energy value.
[0143] Illustratively, a third special effect particle and a target special effect particle adjacent to the first special effect particle are determined; a fourth special effect particle and a target special effect particle adjacent to the second special effect particle are determined; a first bending energy value is obtained based on the relative positions among the first special effect particle, the third special effect particle, and the target special effect particle; a second bending energy value is obtained 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. The twisting force and the tensile force are determined according to the above-mentioned method, and the embodiments of the present application are not limited to this.
[0145] In this way, through the above method, based on the bending energy values corresponding to the first special effect particle and the second special effect particle adjacent to the target special effect particle (determined according to the relative position between the adjacent special effect particles), the bending force corresponding to the target special effect particle is determined, which can ensure that the determined bending force accurately reflects the bending of the target special effect particle caused by the influence of the energy of the adjacent special effect particles, that is, accurately reflects the change in the angle of the particle connecting edge between the target special effect particle and the adjacent special effect particles; similarly, based on a similar method, the twisting force and tensile force of the target special effect particle are determined, which can also ensure that the determined twisting force and tensile force have high accuracy.
[0146] 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.
[0147] In an optional embodiment, force data corresponding to the plurality of special effect particles are determined based on at least one of a tensile force, a bending force, and a twisting force.
[0148] The force data is used to represent the force conditions of the special effect particles on the target polyline when they move along with the specified three-dimensional model.
[0149] In some embodiments, the combined force of the bending force, the twisting force, and the stretching force is used as the force data corresponding to the special effect particle.
[0150] 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; and the resultant force of the target tensile force, target bending force and target twisting force is used as the force data corresponding to the target special effect particle.
[0151] In this way, through the above method, the resultant force of the target tensile force, target bending force and target twisting force corresponding to the target special effect particle is used as the force data corresponding to the target special effect particle. The force condition of the target special effect particle can be comprehensively reflected from the three dimensions of tensile force, bending force and twisting force, ensuring that the determined force data accurately reflects the movement of the target special effect particle with the specified three-dimensional model, which is conducive to making the final generated animation effect more vivid and accurate, and fit the real scene.
[0152] It should be noted that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0153] Step 330 : For each special effect particle on the target polyline, the velocity change of the special effect particle from the i-th moment to the i+1-th moment is calculated based on the force data of the special effect particle.
[0154] In an illustrative manner, after determining the force data corresponding to each special effect particle on the target broken line, each special effect particle is taken as an analysis object, and the velocity change of the special effect particle from the i-th moment to the i+1-th moment is calculated based on the force data.
[0155] In some embodiments, a first velocity of the special effect particle corresponding to the force data at the i-th moment is determined.
[0156] Indicatively, after importing the strip 3D model, the speed values of the special effect particles on the broken line corresponding to the strip 3D model are recorded in real time; or, after importing the strip 3D model, the speed values of the special effect particles on the broken line corresponding to the strip 3D model are recorded periodically, etc.
[0157] Optionally, at the i-th moment, a velocity value of the special effect particle to be analyzed based on the force data is determined, and the velocity value is used as the first velocity. For example, the first velocity of the special effect particle at the i-th moment is 1 m / s. Optionally, the i-th moment is the current moment.
[0158] In some embodiments, the acceleration of the special effect particle at the i-th moment is determined based on the force data.
[0159] Optionally, obtain the special effect particle mass of the special effect particle.
[0160] Illustratively, the quality of special effect particles can be a value set by the 3D scene designer. 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, and so on. Alternatively, if the target polyline includes special effect particles A, B, and C, and the quality of the target polyline is set to 2.7, then the quality of the target polyline is evenly divided based on the three special effect particles included on the target polyline, so that the quality of special effect particles A, B, and C is all 0.9. Alternatively, if the target polyline includes special effect particles A, B, and C, and the quality of the target polyline is set to 2.7, special effect particle A is the particle closest to the specified 3D model, special effect particle B is the particle in the middle, and special effect particle C is the particle farthest from the specified 3D model, then based on a preset mass distribution relationship (e.g., weighting based on distance from the specified 3D model), the quality of special effect particle A is 1.3, the quality of special effect particle B is 0.9, the quality of special effect particle C is 0.5, and so on.
[0161] Optionally, the acceleration of the special effect particle at the i-th moment is obtained based on the force data and the mass of the special effect particle.
[0162] Illustratively, after determining the force data of the special effect particle and the special effect particle mass corresponding to the special effect particle, the acceleration of the special effect particle at the i-th moment is determined based on Newton's second law.
[0163] In some embodiments, a second velocity of the special effect particle at time (i+1) is calculated based on the first velocity of the special effect particle at time (i) and the acceleration at time (i).
[0164] Illustratively, after obtaining the recorded first velocity of the special effect particle at the i-th moment and the acceleration of the special effect particle at the i-th moment, the second velocity of the special effect particle at the i+1-th moment is calculated based on the time length between the i+1-th moment and the i-th moment.
[0165] Optionally, the duration between the i-th moment and the i+1-th moment can be a pre-set analysis duration. For example, the duration between the i-th moment and the i+1-th moment can be 0.3 microseconds; or, the duration between the i-th moment and the i+1-th moment can be 0.01 microseconds; or, the duration between the i-th moment and the i+1-th moment can be the duration corresponding to one frame, etc. It is worth noting that the above durations are merely illustrative examples and can be flexibly adjusted in the application, and the embodiments of the present application do not limit this.
[0166] In some embodiments, the difference between the second speed and the first speed is used as the speed change of the special effect particle from the i-th moment to the i+1-th moment, so as to obtain the speed changes corresponding to multiple special effect particles on the target broken line according to the above method.
[0167] Illustratively, after the second speed is calculated, the difference between the second speed and the recorded first speed of the special effect particle at time i is determined, and the difference is used as the speed change of the special effect particle from time i to time (i+1).
[0168] Optionally, based on the method of determining the speed change corresponding to the special effect particle, the acceleration of the corresponding special effect particle is determined according to the special effect particle mass of other special effect particles on the target fold line, and then the second speeds 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.
[0169] In this way, through the above method, based on the first velocity of the special effect particle at the i-th moment and the acceleration of the special effect particle at the i-th moment determined based on the force data and the characteristic particle mass of the special effect particle, the second velocity of the special effect particle at the i+1-th moment is determined, and then the difference between the second velocity and the first velocity is calculated as the velocity change of the special effect particle from the i-th moment to the i+1-th moment, which can ensure that the determined velocity change has a high accuracy, and thus the movement of the special effect particle can be accurately analyzed based on this.
[0170] 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.
[0171] In some embodiments, based on the above-mentioned method of determining the speed change corresponding to the special effect particle on the target fold line, the speed change corresponding to multiple special effect particles on other fold lines is determined, that is: the speed change of the special effect particle determined based on the above-mentioned method is related to the interaction between multiple special effect particles on the fold line to which the special effect particle belongs, and there is a corresponding relationship between the speed change of the special effect particle and the special effect particle and the fold line where the special effect particle is located.
[0172] Optionally, in the process of analyzing the speed changes of the plurality of special effect particles on the plurality of broken lines respectively, the plurality of broken lines are analyzed in parallel.
[0173] For example, taking broken line 1, broken line 2 and broken line 3 among the multiple broken lines, broken line 1, broken line 2 and broken line 3 each 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.
[0174] Among them, the speed change of 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, on the one hand, realize the analysis process within the broken line, and determine the speed change of each special effect particle on the broken line based on the correlation between each special effect particle within a single broken line. On the other hand, parallel analysis of multiple broken lines can effectively improve the computing efficiency, thereby improving the generation speed and rendering speed of animation effects.
[0175] Optionally, on the basis of performing parallel analysis on multiple broken lines, multiple special effect particles on the broken lines can 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 can be analyzed in parallel.
[0176] In an optional embodiment, the GPU computing process is performed using the Compute Unified Device Architecture (CUDA). CUDA is a parallel computing platform and programming model specifically designed for general-purpose computing development on GPUs, providing a simple GPU programming interface. Specifically, the above-mentioned animation generation method is performed on CUDA.
[0177] 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.
[0178] (1) The processing method used when accessing adjacent special effect particles
[0179] In some embodiments, shuffle intrinsics are used to access adjacent special effect particles (also known as neighbor particles). Shuffle intrinsics are internal functions set in the GPU for performing random operations.
[0180] Schematically, as shown in FIG5 , when determining the force data corresponding to a special effect particle, for the target special effect particle 510x i For example, the special effect particles with a distance of at most 2 will be accessed, that is, the farthest distance from the target special effect particle is 510x i The third special effect particle with an interval of 1 special effect particle 513x i-2 and the fourth special effect particle 513x i+2 will be accessed.
[0181] Based on the above access characteristics, the GPU's shuffle intrinsics can be used to implement the process of accessing adjacent special effect particles. This method is much faster than using shared memory.
[0182] 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 from the shared memory. The inherent characteristics of the shared memory writing and reading make it difficult to efficiently analyze adjacent special effect particles.
[0183] In addition, since the shuffle intrinscis set in the GPU accesses the GPU registers, the read and write speed of the shuffle intrinscis method itself is faster than shared memory, thereby improving the processing speed of adjacent special effect particles with the help of shuffle intrinscis.
[0184] (2) GPU thread adjustment
[0185] 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.
[0186] 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.
[0187] Generally speaking, a CUDA parallel program is executed by multiple threads. Several threads form a thread block. Multiple threads in the same thread block can synchronize and communicate through shared memory. In addition, 32 consecutive threads form a warp. Within a warp, all threads execute the same instructions.
[0188] In some embodiments, in order to improve GPU occupancy and adapt to implementation scenarios, a method of appropriately reducing the number of broken lines that need to be analyzed can be used, and an interpolation method can be used to determine the positions of other broken lines.
[0189] Optionally, a first number of broken lines are obtained from the plurality of broken lines; and speed changes corresponding to a plurality of special effect particles on the first number of broken lines are obtained.
[0190] 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 data analysis, velocity change analysis, etc.) and the broken line positions (motion areas) are determined.
[0191] Optionally, a second number of polylines other than the first number of polylines in the plurality of polylines is obtained.
[0192] Illustratively, after 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.
[0193] Optionally, interpolation operation is performed based on the speed changes corresponding to multiple special effect particles on the first number of broken lines to obtain interpolated speed changes corresponding to the second number of broken lines as the speed changes corresponding to multiple special effect particles on the second number of broken lines.
[0194] Schematically, the positions of the remaining polylines are determined with the assistance of a portion of the polylines that were precisely analyzed. For example, assuming there are 10,000 strip-shaped 3D models, corresponding to 10,000 polylines, 500 to 2,000 polylines are selected as polylines for precise analysis. The polylines that are precisely analyzed can be referred to as simulated polylines (e.g., when the strip-shaped 3D model corresponding to the polyline is virtual hair, the simulated polyline can be referred to as simulated hair). Furthermore, the remaining polylines (i.e., all polylines except the polylines that are precisely analyzed) are referred to as interpolated polylines (e.g., when the strip-shaped 3D model corresponding to the polyline is virtual hair, the interpolated polyline can be referred to as interpolated hair). In other words, the interpolated polylines are obtained by interpolating the simulated polylines that were precisely analyzed.
[0195] Optionally, motion trajectories corresponding to a plurality of special effect particles are calculated based on the speed variation and the interpolated speed variation.
[0196] Schematically, the motion areas of a first number of broken lines (model broken lines) are determined based on the speed change; in addition, the motion areas of a second number of broken lines (interpolation broken lines) are determined based on the interpolation speed change, thereby obtaining motion trajectories corresponding to multiple special effect particles.
[0197] In the above process, a subset of polylines are selected as simulated polylines for precise analysis, reducing the number of GPU threads required to process the velocity variations of the special effect particles along those polylines. This reduces GPU utilization and significantly avoids excessive GPU consumption. Simultaneously, for the remaining interpolated polylines not precisely analyzed, interpolation calculations are performed based on the velocity variables of the special effect particles along the simulated polylines to obtain the corresponding velocity variations of the special effect particles along the interpolated polylines. This ensures the accuracy of the velocity variations of the special effect particles along each polyline while avoiding excessive GPU resource consumption.
[0198] In some embodiments, the special effect particles on each polyline can be divided into multiple groups (multiple thread warps). Based on the nature of the thread warps, each group contains 32 consecutive special effect particles, and each group is assigned to a different GPU thread block for processing. For example, a polyline containing 50 special effect particles requires two GPU thread blocks to process. Therefore, when the polyline contains a large number of special effect particles, GPU utilization can be improved by processing them in different GPU thread blocks.
[0199] It should be noted that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0200] (3) Grouping adjustment of special effect particles
[0201] 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.
[0202] 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.
[0203] Schematically, as shown in FIG6, it is the grouping result after directly grouping the special effect particles. Among them, the first group 610 is represented as Group j-1 The second group 620 is represented by Group j The third group 630 is represented by Group j+1Based on the force data determination method shown in FIG5 , the force data corresponding to different special effect particles is determined using adjacent special effect particles. Taking special effect particle i in second group 620 as an example, determining the force data for special effect particle i requires the energy of special effect particle i-1 in first group 610, which does not belong to second group 620. Similarly, taking special effect particle i-1 in first group 610 as an example, determining the force data for special effect particle i-1 requires the energy of special effect particle i in second group 620, which does not belong to first group 610. Because the force data determination process requires additional read and write operations between different thread warps, the direct grouping method suffers from low efficiency.
[0204] In some embodiments, based on the above process, the impact of the above problem is alleviated by designing overlapping grouping.
[0205] Schematically, as shown in FIG7, the grouping result after the special effect particles are grouped by overlapping grouping is shown. 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 the two thread blocks can only calculate part of the result, the results of the two thread blocks are complementary and can be added together to get the correct result.
[0206] For example, special effect particles i+30 and i+31 in first group 710 will also overlap in second group 720. Taking special effect particle i+31 as an example, based on the force data determination method shown in Figure 5, when special effect particle i+31 is processed by first group 710, it only receives the contribution (energy contribution) from special effect particle i+30, while the contributions from special effect particles i+31 and i+32 are directly set to 0. However, when special effect particle i+31 is processed by second group 720, it receives the contributions from special effect particles i+31 and i+32, while the contribution from special effect particle i+30 is set to 0. By adding the results of first group 710 and second group 720 (using an atomic addition method), the contributions from special effect particle i+31 itself and the two adjacent special effect particles can be accurately determined, resulting in a correct result. Although atomic operations are used, the frequency is low, so it will not have much impact on processing efficiency.
[0207] (4) Merge write process
[0208] Schematically, when solving for the velocity change, the process of calculating the second velocity and determining the velocity change is achieved by using discrete elastic rods (DER) with semi-implicit integration. The main task of the semi-implicit DER is to calculate the current force data of each special effect particle, thereby calculating the acceleration of each special effect particle at the current moment, and then calculating the second velocity of each special effect particle at the next moment, thus obtaining the velocity change Δu within this time step (from time i to time i+1).
[0209] Optionally, the above process of solving the semi-implicit integral DER is summarized as solving the following equation:
[0210] Formula 1: (M+h 2 H)u=Mu0+hf
[0211] Among them, M is used to represent the special effect particle mass matrix of multiple special effect particles on the broken line where the special effect particles to be solved are located; h is used to represent the time step length (the duration from moment i to moment i+1); H represents the derivative of f; u represents the second velocity to be solved; u0 represents the first velocity of the special effect particles to be solved at the current moment; f represents the force data of the special effect particles to be solved.
[0212] 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); Mu0+hf on the right side of the above formula is called the right-hand side (RHS), and the second speed u is solved by LHS and RHS to obtain the speed change Δu.
[0213] 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 part of this matrix.
[0214] For example, the calculation result for the i-th special effect particle is the submatrix {{4i–1,4i–1},{4i+3,4i+3}}. When stored in global memory, based on the global memory's requirement to store special effect particles sequentially, if each special effect particle has over 100 bytes of memory, the gap between the data at the same location for each special effect particle will be over 100 bytes. This will result in writing the result of each special effect particle to global memory immediately after calculation, which is inconsistent with the GPU's coalesced access requirements and makes the writing process very slow.
[0215] In some embodiments, a shared memory is used as an intermediate layer to store the calculation results of adjacent special effect particles (e.g., the energy of adjacent special effect particles) in the shared memory. After the calculation results of all special effect particles are calculated together, all calculation results are written to the global memory. When writing to the global memory, there is no need to pay special attention to the order of writing to the global memory. Adjacent threads can process adjacent data in the global memory, eliminating the need to strictly analyze the calculation results corresponding to the special effect particles according to the order of adjacent special effect particles, thereby significantly accelerating the writing process.
[0216] It should be noted that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0217] In an optional embodiment, the LDL decomposition method may be used to solve the above formula 1.
[0218] 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. The following optimization scheme can be used to implement LDL decomposition on GPUs.
[0219] 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. Therefore, 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 simultaneously. In this case, shuffle intrinsics are also used to retrieve data from adjacent threads. The matrix L is stored in column major order so that it can be merged when writing the calculation results. However, this process has the side effect of not being able to merge the readout after reading in the matrix.
[0220] Optionally, shared memory is used to store the most recent 10 columns of data, which will be used by the current thread, to avoid repeated non-merged reads.
[0221] It should be noted that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0222] In some embodiments, after solving Formula 1 based on the above process, the second speed u is obtained, and then the speed change Δu is solved.
[0223] Step 350, 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 on the multiple broken lines from the i-th moment to the i+1-th moment, calculate the movement trajectories corresponding to the special effect particles on the multiple broken lines, and generate an animation of multiple strip-shaped three-dimensional models accompanying the movement of the specified three-dimensional model based on the movement trajectories.
[0224] In an illustrative manner, based on the above formula 1, the speed changes corresponding to the multiple special effect particles on the same broken line are determined by the masses of the multiple special effect particles on the same broken line and the force data corresponding to the special effect particles.
[0225] In addition, based on the above formula 1, multiple broken lines are analyzed separately in a parallel manner, and with the help of the mass of multiple special effect particles on the same broken line and the force data 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 movement speed of the special effect particles on multiple broken lines and the speed change of the special effect particles.
[0226] Schematically, for each special effect particle, after determining the movement speed and speed change corresponding to the special effect particle, the sum of the movement speed and the speed change is calculated to obtain the adjustment speed corresponding to each special effect particle, that is, the first adjustment speed corresponding to the multiple special effect particles on the multiple broken lines is obtained.
[0227] In some embodiments, motion trajectories corresponding to the plurality of special effect particles are determined based on the first adjustment speed.
[0228] Illustratively, the above method is used to determine the first adjustment speeds corresponding to multiple special effect particles at multiple moments within a preset time period. Then, based on the first adjustment speeds corresponding to the multiple special effect particles at each moment, the corresponding motion trajectories of the multiple special effect particles are obtained. For example, based on the first adjustment speed a1 of special effect particle A at moment 1, the first adjustment speed a2 of special effect particle A at moment 2, and the first adjustment speed a3 of special effect particle A at moment 3, the motion trajectories of special effect particle A from moment 1 to moment 3 are obtained.
[0229] In some embodiments, after obtaining the first adjustment speed, a comprehensive analysis is performed on multiple special effect particles on 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 a second adjustment speed, and based on the second adjustment speed, the motion trajectories corresponding to the multiple special effect particles are determined.
[0230] Illustratively, the second adjustment speeds corresponding to multiple moments in a preset time period are determined based on the above method, and then the motion trajectories corresponding to the multiple special effect particles are obtained based on the second adjustment speeds corresponding to the multiple special effect particles at the multiple moments.
[0231] In an optional embodiment, a plurality of motion trajectory animation frames are generated by using the motion trajectories corresponding to a plurality of special effect particles.
[0232] Schematically, after obtaining the motion trajectories corresponding to multiple special effect particles, the motion range corresponding to the broken line is determined based on the motion trajectories of the special effect particles on the same broken line, and the motion ranges corresponding to multiple broken lines are determined based on this method.
[0233] 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 motion ranges corresponding to the first number of broken lines are determined based on the motion trajectories of the special effect particles on the first number of broken lines, and the interpolation motion ranges corresponding to the second number of broken lines are determined based on the interpolation motion trajectories of the special effect particles on the second number of broken lines. The motion ranges and the interpolation motion ranges are combined to generate multiple motion trajectory animation frames, which show the animation process of the multiple broken lines moving along the specified three-dimensional model.
[0234] Optionally, a plurality of motion trajectory animation frames are generated to obtain an animation in which the ribbon-shaped three-dimensional model follows the movement of the specified three-dimensional model.
[0235] Schematically, after generating multiple motion trajectory animation frames indicating that the strip-shaped three-dimensional model follows the movement of the specified three-dimensional model, the multiple motion trajectory animation frames are combined into an animation according to a time sequence, and the animation shows the movement of the strip-shaped three-dimensional model following the movement of the specified three-dimensional model.
[0236] In this way, through the above method, motion trajectory animation frames are first generated based on the motion trajectories corresponding to multiple special effect particles, and then an animation representing the movement of a strip-shaped three-dimensional model following a specified three-dimensional model is generated based on multiple motion trajectory animation frames. By generating animation frame by frame, it can be ensured that the generated animation is realistic and accurate, and fits the real scene.
[0237] It should be noted that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0238] To sum up, the above method can avoid the problem of poor analysis efficiency caused by directly performing a comprehensive analysis on multiple broken lines. By analyzing multiple broken lines separately and then determining the speed changes corresponding to multiple special effect particles on the broken lines, and then performing a 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 animation of a strip three-dimensional model accompanied by the movement of a specified three-dimensional model can be generated more real-time and efficiently, thereby improving the timeliness of animation generation and enabling the animation generation method of a strip three-dimensional model to be applied to a wider range of scenarios.
[0239] In this embodiment, parallel analysis of multiple broken lines is described. First, the special effect particles on the multiple broken lines are individually analyzed. Force data corresponding to each of the multiple special effect particles is then obtained based on the individual analyses. The velocity change determined based on the force data is correlated with the broken line corresponding to the special effect particle. This parallel analysis of multiple broken lines improves analysis efficiency, significantly avoiding the inefficiency of performing a unified analysis of multiple special effect particles corresponding to multiple broken lines.
[0240] In an optional embodiment, when calculating the trajectory based on the velocities and velocity variations of the special effect particles along multiple broken lines, the corresponding trajectory of the special effect particles is obtained using a mapping relationship between the special effect grid space and the special effect particles. As shown schematically in FIG8 , step 240 in FIG2 can also be implemented as steps 810 to 830.
[0241] Step 810 : For the target special effect particle, the speed change of the target special effect particle from the i-th moment to the i+1-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.
[0242] Illustratively, the target special effect particle is used to indicate any one of the multiple special effect particles on multiple polylines. For example, based on a strip-shaped 3D model, a total of a polylines are obtained, and each polyline includes b special effect particles. Therefore, 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.
[0243] Among them, based on the above-mentioned calculation process of the speed change, the special effect particles on each broken line are analyzed respectively to obtain the speed change reflecting the interaction between the special effect particles on each broken line, such as: the speed changes corresponding to the b special effect particles on the broken line a1 in the broken line a, reflecting the interaction between the b special effect particles on the broken line a1, etc.
[0244] Optionally, after calculating the speed change of any target special effect particle among multiple special effect particles from the i-th moment to the i+1-th moment, and recording the movement speed (first speed value) of the target special effect particle at the i-th moment, the speed change of the target special effect particle and the movement speed of the target special effect particle are summed to obtain the first adjusted speed of the target special effect particle.
[0245] The first adjustment speed is 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.
[0246] Optionally, after calculating the speed change of the target special effect particle from the i-th moment to the i+1-th moment, and recording the movement speed corresponding to the target special effect particle at the i-th moment, the speed change is divided into equal steps N, that is, the speed change is divided equally with the equal steps N, such as: dividing 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 movement speed of the target special effect particle at the i-th moment, Δu / N is merged with the movement speed of the target special effect particle at the i-th moment, thereby obtaining the first adjusted speed of the target special effect particle.
[0247] Illustratively, the interval between time i and time i+1 is called Δt. Δt is divided into N equal steps, yielding N sub-times Δt / N. When analyzing time i+Δt / N (the first Δt / N duration), Δu / N is combined with the target special effect particle's velocity at time i to obtain the first adjusted velocity of the target special effect particle at time i+Δt / N. Similarly, when analyzing time i+2*Δt / N (the second Δt / N duration), 2Δu / N is combined with the target special effect particle's velocity at time i to obtain the first adjusted velocity of the target special effect particle at time i+2*Δt / N. In other words, the first adjusted velocity of the target special effect particle is the velocity obtained by adding Δu / N to the velocity of the target special effect particle at time i.
[0248] Step 820: Obtain first adjustment speeds corresponding to a plurality of special effect particles on a plurality of broken lines.
[0249] Illustratively, according to the method for obtaining the first adjustment speed of the target special effect particles, calculations are performed on multiple special effect particles on multiple broken lines 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 respectively.
[0250] Step 830 : determining the motion trajectories corresponding to the special effect particles on the multiple broken lines based on the multiple first adjustment speeds of the special effect particles on the multiple broken lines within a preset time period.
[0251] Illustratively, after obtaining the first adjustment speeds respectively corresponding to the plurality of special effect particles on the plurality of broken lines, collision detection is performed on the plurality of special effect particles in combination.
[0252] For example, assuming that there are a*b special effect particles on the multiple broken lines, after obtaining the first adjustment speeds corresponding to the a*b special effect particles, collision detection is performed on the a*b special effect particles, thereby adjusting the first adjustment speeds.
[0253] In an optional embodiment, collision detection is implemented through 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 a grid (represented below as a special effect grid space), by sticking the 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 transferring the state of the special effect particles to the special effect grid space through an interpolation method, thereby achieving a combination of the Euler grid method and the Lagrangian gridless method.
[0254] Therefore, the multiple broken lines are in the special effect grid space, and the special effect particles corresponding to the multiple broken lines are respectively located in the special effect grid space.
[0255] The special effects grid space is the analysis space projected when analyzing special effects particles. As shown in Figure 4, large rectangular area 440 is a schematic representation of the special effects grid space; multiple small rectangular areas (such as small rectangular area 441) are areas divided based on the granularity of the special effects grid space.
[0256] In this way, through the above method, the corresponding first adjustment speed is first determined for each special effect particle on multiple broken lines, that is, a single broken line is considered separately first to determine the movement of the special effect particles on the broken line to which it belongs, and then a comprehensive force analysis is performed on multiple broken lines. The first adjustment speed corresponding to the special effect particles on the broken line is adjusted through the collision detection mechanism to determine the movement of the special effect particles under the interaction of multiple broken lines. In this way, the accuracy of the determined movement trajectory of the special effect particles is guaranteed. At the same time, the mechanism of first analyzing a single broken line and then analyzing multiple broken lines as a whole can effectively improve the calculation efficiency.
[0257] In an optional embodiment, the first adjustment speeds corresponding to the plurality of special effect particles are respectively bound to the corresponding special effect particles to obtain a plurality of binding results.
[0258] The mth special effect particle is bound to the corresponding mth first adjustment speed, where m is a positive integer.
[0259] Illustratively, by binding the first adjustment speed with 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.
[0260] In an optional embodiment, multiple binding results are mapped to the special effect grid space to perform particle collision detection, and motion trajectories corresponding to the special effect particles within a preset time period are obtained.
[0261] The preset time period includes multiple moments including the i-th moment.
[0262] In some embodiments, the plurality of binding results are mapped to the effects grid space.
[0263] 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.
[0264] Schematically, within the special effect grid space, multiple binding results are processed using a grid-solve method. For example, grid-solve methods include velocity projection and divergence projection, which enhance the correlation between special effect particles through grid operations.
[0265] In some embodiments, a second adjusted speed corresponding to the special effect particle among the plurality of second adjusted speeds is mapped to the special effect particle to obtain a motion trajectory corresponding to the special effect particle within a preset time period.
[0266] Schematically, 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 systematic nature of the special effect particle analysis process is improved through the sequential analysis process. After mapping the second adjustment speed corresponding to a special effect particle among the multiple second adjustment speeds to the special effect particle, the motion trajectory corresponding to the special effect particle is obtained, and then the motion trajectory of the strip-shaped three-dimensional model corresponding to the broken line following the specified three-dimensional model is obtained.
[0267] In this way, mapping the binding results between the special effect particles and the corresponding first adjustment speed to the special effect grid space, and performing collision simulation in the special effect grid space based on the binding results can ensure that the motion trajectory obtained by the collision simulation has high accuracy. At the same time, performing collision simulation in the special effect grid space also helps to improve the efficiency of the collision simulation.
[0268] It should be noted that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0269] In an optional embodiment, after the DER method is used to calculate the velocity change of the special effect particles between the i-th moment and the i+1-th moment, the MPM method is used to implement collision detection analysis.
[0270] 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 the velocity change of the special effect particle from the i-th moment to the i+1-th moment is calculated by the DER method, it is necessary to calculate the multi-step MPM method, which can improve the calculation efficiency at the same time.
[0271] To illustrate, to synchronize single-step DER and multi-step MPM, the velocity change Δu calculated by the DER method is divided into N equal parts, where N is the number of MPM steps. Before each MPM calculation, the velocity change Δu is applied to the first velocity 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 velocity change Δu corresponding to special effect particle A and the first velocity value u of special effect particle A. This first velocity value u is the velocity of the special effect particle at time i.
[0272] As shown in FIG9 , it is a schematic diagram of the step length comparison of the time step, where 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.
[0273] Similarly, special attention should be paid to specifying the motion of a 3D model (e.g., determined by the SDF method). When computing the DER, the state of the SDF should be the state at t+NΔt, whereas when computing 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.
[0274] 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.
[0275] The physical model of water or sand will protect the special effect particles on the broken line corresponding to 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.
[0276] 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.
[0277] Optionally, to improve real-time efficiency, the algorithm framework of the present embodiment can select an analytic collider (SDF) as the specified 3D model. Examples include spheres, cuboids, cylinders, and capsules. These analytic colliders have faster animation update speeds, improving simulation efficiency.
[0278] 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.
[0279] Schematically, the DER method introduces a concept called curvature binormal, and the definition formula of curvature binormal is shown in the following formula 2.
[0280] Formula 2:
[0281] 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.
[0282] Optionally, the minimum denominator of the curvature binormal formula in Formula 2 above can be limited to a non-zero value (e.g., 0.01) to avoid generating large curvature binormals. This process does not significantly affect the visual quality of the simulation. In other words, the above process identifies all particle connection edges that could cause simulated explosions as bad cases, and performs targeted processing as shown in Formula 2 above to avoid affecting simulation stability.
[0283] In an optional embodiment, the trajectory route is randomly generated.
[0284] The trajectory route is used to indicate that a specified 3D model moves along the trajectory route. As shown in FIG10 , an irregular trajectory route 1010 is randomly generated. The trajectory route starts at any point and is generated through random turning transformations (e.g., at least one turning) to reach the end point.
[0285] Optionally, the designated three-dimensional model is controlled to move along a trajectory route.
[0286] Schematically, as shown in Figure 10, after obtaining the trajectory route, 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.
[0287] Specifically, during the stability test, the 3D model is controlled to move rapidly along a randomly generated trajectory, while the rotation of the specified 3D model is continuously and randomly changed. This process is run continuously for hundreds of hours to ensure that the simulation does not explode.
[0288] It should be noted that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0289] To sum up, in order to avoid the problem of poor analysis efficiency caused by directly performing a comprehensive analysis on multiple broken lines, the speed changes corresponding to multiple special effect particles on the broken lines are determined after analyzing the multiple broken lines separately, and then a comprehensive analysis is performed on the multiple broken lines based on the separate analysis of the multiple broken lines. This can improve the efficiency of calculation and analysis, generate animations 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.
[0290] In this embodiment, we describe a process for obtaining motion trajectories corresponding to special effect particles using a mapping relationship between the special effect grid space and special effect particles. After obtaining the first adjusted velocities corresponding to multiple special effect particles on a broken line, the first adjusted velocities are adjusted by analyzing the collision relationships between the multiple special effect particles. This two-step adjustment process streamlines the analysis of the special effect particles, ensuring stability while improving the efficiency of trajectory generation.
[0291] In an optional embodiment, the above-mentioned animation generation method is applied to the trajectory generation process of virtual hair, with the designated 3D model implemented as a virtual head and the ribbon-shaped 3D model implemented as virtual hair bound to the virtual head. This animation generation method is referred to as "a framework for efficient and stable hair animation calculations," meaning that it constructs a generation algorithm framework for simulating virtual hair motion based on the animation generation method. As shown schematically in Figure 11, this animation generation method can also be implemented as follows: Steps 1110 to 1130.
[0292] Step 1110, update boundary conditions.
[0293] The Update Boundary Condition specifies the boundary conditions for updating the current time step. Specifically, it specifies the state of the virtual environment, including the specified 3D model and the strip 3D model, at the current time step. For example, if the virtual head is the head of virtual object A, the Update Boundary Condition specifies the conditions for updating the virtual environment within which virtual object A resides.
[0294] Among them, 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.
[0295] Optionally, the movement of the virtual hair roots (the roots of the virtual hair) caused by the movement of the virtual head will also be performed here.
[0296] Step 1120, semi-implicit integration.
[0297] 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) for each virtual hair, taking into account the interaction between multiple special effect particles on the single virtual hair, without considering the special effect particle collisions of the virtual hair itself, and the special effect particle collisions between virtual hairs.
[0298] The above process will resolve the collision between the virtual hair and other rigid bodies in the virtual environment. For details about the semi-implicit integral DER, please refer to the above step 340 and will not be repeated here.
[0299] Step 1130, explicit integration.
[0300] 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. The special effect particles on the virtual hair are treated as discrete special effect particles, and N MPM simulations are performed on the special effect particles in one DER time step, so as to determine the motion trajectory based on the collisions between multiple special effect particles on multiple broken lines.
[0301] Optionally, after determining the speed variation, when performing any of N MPM simulations, 1 / N of the speed variation obtained in the previous stage is applied to perform the current MPM simulation and determine the motion trajectory of the special effect particles.
[0302] The explicit integration includes the process of mapping special effect particles to special effect grid space (Particle to Grid, P2G), the grid processing process, and the process of mapping special effect grid space to special effect particles (Grid to Particle, G2P).
[0303] It should be noted that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0304] 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 for determining the motion trajectory corresponding to the special effect particles.
[0305] 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, and additional specified constraints are used 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 an animation of the virtual hair accompanying the movement of the virtual head.
[0306] Optionally, several application scenarios to which the above algorithm framework can be applied are schematically introduced.
[0307] (1) Customize the parameters of the 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. Once everything is ready, run the program corresponding to the virtual scene to obtain an animation of the virtual hair moving along with the virtual head during this period. This animation is then imported into other 3D scene processing software for subsequent processing.
[0308] (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.
[0309] (3) The algorithm framework is directly used in the game engine. When the engine is updated, the algorithm framework calculates the motion trajectory of the virtual hair in the game scene and updates the generated animation in real time. Due to the high efficiency of the algorithm framework, it is not difficult to apply it in similar real-time scenarios.
[0310] Optionally, after encapsulating the above algorithm framework in the game engine (Unreal Engine), the overall plug-in setting (Physion Groom) is obtained. As shown in FIG12 , it is a flowchart of encapsulating the above algorithm framework in Unreal Engine to obtain Physion Groom and operating Physion Groom.
[0311] Step 1210: Import virtual hair parameters.
[0312] As an example, import existing database parameters (e.g., via the database migration tool Alembic) into Unreal Engine's content browser. The standard parameter format for virtual hair is generally implemented as Strand-based. After importing, Alembic will automatically convert it into a Groom asset.
[0313] Alternatively, different areas and hairstyles can generally be made into different "hair blocks", stored as Alembic and imported into the engine.
[0314] Step 1220: Add overall settings and collision bodies to the virtual object.
[0315] Schematically, add a Physion Groom component to the virtual object (Actor) in Unreal Engine, and mount several Physion Sdf components in the Physion Groom component to be 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.
[0316] Optionally, add a details panel for each Physion component under the Actor, which shows the hierarchical relationship of each Physion component.
[0317] Schematically, the Physion Groom component provides some basic physics settings for Physion, such as gravity direction, mesh density, etc., which users generally do not need to change.
[0318] Schematically, the Physion Sdf component is a collider component used to handle hair binding and collision. The Physion Sdf component includes various shapes, such as capsules and spheres.
[0319] Schematically, the Physion Sub Groom component is used to mount the virtual hair parameters. Currently, most virtual hair parameters are modified under this component.
[0320] Step 1230: Add several blocks of virtual hair.
[0321] Schematically, several Physion Sub Groom components are mounted on the Physion Sdf component that drives the movement of the root special effect particles on the virtual hair. The Physion Sub Groom component is mainly responsible for mounting the Groom assets corresponding to the "hair blocks" and taking on the generation responsibility.
[0322] Step 1240, set the hair parameters and align it with the collision body.
[0323] Schematically, set the parameters of the virtual hair, that is, mount different "hair blocks" to different Physion Sub Groom components, and align the virtual hair with the collision body (such as the capsule) shown in the Physion Sdf after mounting.
[0324] Optionally, as shown in FIG13 , area 1310 is an actual scene in which 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 the Physion Sub Groom and aligned with the Physion Sdf; wherein, the setting process is represented by the area shown as area 1320 in FIG13 .
[0325] Step 1250 , adjust physical parameters and preview the simulation.
[0326] As an example, adjust various physical parameters on the Physion Sub Groom component, then click Play in the Unreal Engine editor to preview the real-time simulation results.
[0327] Figure 14 shows a product-side application example using the Physion Groom plug-in to mount various complex hair styles. As shown in area 1410, the virtual object's virtual hair can be implemented in various styles, such as long hair 1411, curly hair, and braids 1412. As shown in area 1420, the details panel reveals multiple Physion Sub Groom components placed under the Physion Sdf component, responsible for mounting various hair styles.
[0328] 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.
[0329] To sum up, in order to avoid the problem of poor analysis efficiency caused by directly performing a comprehensive analysis on multiple broken lines, the speed changes corresponding to the multiple special effect particles on the broken lines are determined after analyzing the multiple broken lines separately. Then, on the basis of analyzing the multiple broken lines separately, a comprehensive analysis is performed on the multiple broken lines. This can improve the efficiency of calculation and analysis, and generate an animation of a strip three-dimensional model accompanied by the movement of a specified three-dimensional model in a more real-time and efficient manner, thereby improving the timeliness of animation generation and enabling the animation generation method of the strip three-dimensional model to be applied to a wider range of scenarios.
[0330] 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. This enables the algorithm framework based on the combination of the DER algorithm and the MPM algorithm to produce highly realistic hair animation within a limited time budget. When the algorithm framework is applied to various real-time scenarios, high-quality virtual hair can be generated, thereby improving the simulation of virtual objects.
[0331] FIG15 is a structural block diagram of an animation generating device provided by an exemplary embodiment of the present application. As shown in FIG15 , the device includes the following parts:
[0332] A broken line determination module 1510 is configured to determine broken lines corresponding to a plurality of strip-shaped three-dimensional models, each of which includes a plurality of special effect particles and is bound to a specified three-dimensional model;
[0333] A force determination module 1520 is configured to determine, for a target fold line among the plurality of fold lines, force data corresponding to each of the plurality of 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 data is used to represent the force conditions of the special effect particles on the target fold line when the designated three-dimensional model moves with the target fold line, where i is a positive integer;
[0334] A speed determination module 1530 is configured to calculate, for each special effect particle on the target polyline, a speed change of the special effect particle from the i-th moment to the i+1-th moment based on the force data corresponding to the special effect particle;
[0335] The trajectory calculation module 1540 is used to calculate the motion trajectories corresponding to the special effect particles on the multiple broken lines 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 on the multiple broken lines from the i-th moment to the i+1-th moment, and generate an animation of the strip-shaped three-dimensional model moving along with the specified three-dimensional model based on the motion trajectories.
[0336] In an optional embodiment, the trajectory calculation module 1540 is specifically configured to:
[0337] For a target special effect particle, a speed change of the target special effect particle from the i-th moment to the i+1-th moment is combined with the movement speed of the target special effect particle at the i-th moment to obtain a first adjustment speed of the target special effect particle, where the first adjustment speed is 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; first adjustment speeds corresponding to the plurality of special effect particles on the plurality of broken lines are obtained respectively; and based on the plurality of first adjustment speeds of the special effect particles on the plurality of broken lines within a preset time period, the movement trajectories corresponding to the special effect particles on the plurality of broken lines are determined, where the preset time period includes a plurality of moments including the i-th moment.
[0338] In an optional embodiment, the plurality of broken lines are located in a special effect grid space, and the special effect particles on the plurality of broken lines are located in the special effect grid space;
[0339] The trajectory calculation module 1540 is specifically used to:
[0340] Binding first adjustment speeds corresponding to a plurality of special effect particles to corresponding special effect particles to obtain a plurality of binding results; mapping the plurality of binding results to the special effect grid space for particle collision detection to obtain motion trajectories corresponding to the special effect particles within the preset time period.
[0341] In an optional embodiment, the trajectory calculation module 1540 is specifically configured to:
[0342] The multiple binding results are mapped to the special effect grid space; collision simulation is performed on the multiple binding results through the special effect grid space to obtain second adjustment speeds corresponding to the multiple special effect particles respectively; the second adjustment speed corresponding to the special effect particle among the multiple second adjustment speeds is mapped to the special effect particle to obtain a motion trajectory corresponding to the special effect particle within the preset time period.
[0343] In an optional embodiment, the speed determination module 1530 is specifically configured to:
[0344] Determine a first velocity of the special effect particle corresponding to the force data at the i-th moment; determine an acceleration of the special effect particle at the i-th moment based on the force data; calculate a second velocity of the special effect particle at the i+1-th moment based on the first velocity of the special effect particle at the i-th moment and the acceleration at the i-th moment; and use the difference between the second velocity and the first velocity as the velocity change of the special effect particle from the i-th moment to the i+1-th moment.
[0345] In an optional embodiment, the speed determination module 1530 is specifically configured to:
[0346] Obtaining a special effect particle mass of the special effect particle; and determining the acceleration of the special effect particle at the i-th moment based on the force data and the special effect particle mass.
[0347] In an optional embodiment, the force determination module 1520 is specifically configured to:
[0348] Based on the movement speed and direction of the specified three-dimensional model, at least one of the stretching force, bending force and twisting force corresponding to the multiple special effect particles at the i-th moment is determined, the stretching force is used to indicate the stretching of the special effect particle by two adjacent special effect particles, the bending force is used to indicate the influence of the plane angle of the special effect particle by two adjacent special effect particles, and the twisting force is used to indicate the influence of the spatial angle of the special effect particle by two adjacent special effect particles; based on at least one of the stretching force, the bending force and the twisting force, the force data corresponding to the multiple special effect particles are determined.
[0349] In an optional embodiment, the force determination module 1520 is specifically configured to:
[0350] For any target special effect particle among the multiple special effect particles, a target tensile force, a target bending force, and a target twisting force corresponding to the target special effect particle are determined; and a resultant force of the target tensile force, the target bending force, and the target twisting force is used as force data corresponding to the target special effect particle.
[0351] In an optional embodiment, the force determination module 1520 is specifically configured to:
[0352] For any target special effect particle among the multiple special effect particles, determine a first special effect particle and a second special effect particle adjacent to the target special effect particle; based on the movement speed and movement 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 connection edge connecting two adjacent special effect particles and the target special effect particle; and obtain the bending force of the target special effect particle based on the first bending energy value and the second bending energy value.
[0353] In an optional embodiment, the force determination module 1520 is specifically configured to:
[0354] 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 of 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 of the second special effect particle, the fourth special effect particle, and the target special effect particle.
[0355] In an optional embodiment, the speed determination module 1530 is further configured to:
[0356] 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.
[0357] In an optional embodiment, the speed determination module 1530 is specifically configured to:
[0358] Obtain a first number of broken lines from the plurality of broken lines; obtain speed changes corresponding to the plurality of special effect particles on the first number of broken lines; obtain a second number of broken lines other than the first number of broken lines from the plurality of broken lines; perform interpolation operations based on the speed changes corresponding to the plurality of special effect particles on the first number of broken lines, and obtain interpolated speed changes corresponding to the second number of broken lines as the speed changes corresponding to the plurality of special effect particles on the second number of broken lines.
[0359] In an optional embodiment, the trajectory calculation module 1540 is specifically configured to:
[0360] A plurality of motion trajectory animation frames are generated based on the motion trajectories respectively corresponding to the plurality of special effect particles; and the animation is generated based on the plurality of motion trajectory animation frames.
[0361] To sum up, in order to avoid the problem of poor analysis efficiency caused by directly performing a comprehensive analysis on multiple broken lines, the speed changes corresponding to multiple special effect particles on a single broken line are determined by analyzing multiple broken lines separately, and then a comprehensive analysis is performed on multiple broken lines based on the separate analysis of multiple broken lines. This can improve the calculation and analysis efficiency while ensuring the accuracy of trajectory calculation, and generate an animation of a strip three-dimensional model accompanying the movement of a specified three-dimensional model in a more real-time and efficient manner, thereby improving the timeliness of animation generation and enabling the animation generation method of a strip three-dimensional model to be applied to a wider range of scenarios.
[0362] It should be noted that the animation generation device provided in the above embodiment is merely an example of 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 can be 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 are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0363] Figure 16 shows a schematic diagram of the structure of a server provided by an exemplary embodiment of the present application. 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 CPU 1601. The server 1600 also includes a mass storage device 1606 for storing an operating system 1613, application programs 1614, and other program modules 1615.
[0364] 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. In other words, 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.
[0365] Without further generality, computer-readable media may include computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules, or other data. The system memory 1604 and mass storage device 1606 described above may be collectively referred to as memory.
[0366] According to various embodiments of the present application, the server 1600 may also be connected to a remote computer on a network such as the Internet for operation. That is, the server 1600 may be connected to the network 1612 via the network interface unit 1611 connected to the system bus 1605, or the network interface unit 1611 may be used to connect to other types of networks or remote computer systems (not shown).
[0367] The memory also includes one or more programs, which are stored in the memory and configured to be executed by the CPU.
[0368] An embodiment of the present application also provides a computer device, which includes a processor and a memory, wherein the memory stores 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 the processor to implement the animation generation method provided by the above-mentioned method embodiments.
[0369] An embodiment of the present application also provides a computer-readable storage medium, which stores 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.
[0370] Embodiments of the present application further provide a computer program product or 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 executes the computer instructions, causing the computer device to perform the animation generation method described in any of the above embodiments.
[0371] The above description is merely an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. An animation generation method, executed by a computer device, comprising: Determine the polylines corresponding to the plurality of strip-shaped three-dimensional models, each of which includes a plurality of special effect particles, and the strip-shaped three-dimensional model is 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, force data corresponding to the multiple special effect particles on the target fold line at the i-th moment are determined based on the movement speed and movement direction of the designated three-dimensional model, wherein the force data is 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; For each special effect particle on the target fold line, calculating a speed change of the special effect particle from the i-th moment to the i+1-th moment based on the force data corresponding to the special effect particle; According to 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 on the multiple broken lines from the i-th moment to the i+1-th moment, the movement trajectories corresponding to the special effect particles on the multiple broken lines are calculated respectively, and based on the movement trajectories, an animation of the multiple strip-shaped three-dimensional models accompanying the movement of the specified three-dimensional model is generated.
2. The method according to claim 1, wherein the step of calculating the motion trajectories corresponding to the special effect particles on the plurality of broken lines according to the motion 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 on the plurality of broken lines from the i-th moment to the i+1-th moment comprises: For a target special effect particle, a speed change amount of the target special effect particle from the i-th moment to the i+1-th moment is merged with the movement 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 the 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 the special effect particles on the plurality of broken lines; Based on a plurality of first adjustment speeds of the special effect particles on the plurality of fold lines within a preset time period, the motion trajectories corresponding to the special effect particles on the plurality of fold lines are determined, wherein the preset time period includes a plurality of moments including the i-th moment.
3. The method according to claim 2, wherein the plurality of broken lines are in a special effect grid space, and the special effect particles on the plurality of broken lines are located in the special effect grid space; The determining, based on a plurality of first adjustment speeds of the special effect particles on the plurality of fold lines within the preset time period, respectively corresponding motion trajectories of the special effect particles on the plurality of fold lines comprises: Binding 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; The multiple binding results are mapped to the special effect grid space to perform particle collision detection, and a motion trajectory corresponding to the special effect particle within the preset time period is obtained.
4. According to the method of claim 3, mapping the plurality of binding results to the special effect grid space for particle collision detection to obtain a motion trajectory corresponding to the special effect particle within the preset time period comprises: 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; The second adjustment speed corresponding to the special effect particle among the plurality of second adjustment speeds is mapped to the special effect particle, To the motion trajectory corresponding to the special effect particle within the preset time period.
5. The method according to any one of claims 1 to 4, wherein the calculating the speed change of the special effect particle from the i-th moment to the i+1-th moment based on the force data corresponding to the special effect particle comprises: Determine a first speed of the special effect particle corresponding to the force data at the i-th moment; Determine the acceleration of the special effect particle at the i-th moment based on the force data; Based on the first speed of the special effect particle at the i-th time and the acceleration at the i-th time, a second speed of the special effect particle at the i+1-th time is calculated; The difference between the second speed and the first speed is used as the speed change of the special effect particle from the i-th moment to the (i+1)-th moment.
6. The method according to claim 5, wherein determining the acceleration of the special effect particle at the i-th moment based on the force data comprises: Obtaining the special effect particle mass of the special effect particle; The acceleration of the special effect particle at the i-th moment is determined based on the force data and the mass of the special effect particle.
7. The method according to any one of claims 1 to 6, wherein determining the force data corresponding to the plurality of special effect particles on the target broken line at the i-th moment based on the movement speed and movement direction of the specified three-dimensional model comprises: Based on the movement speed and movement direction of the specified three-dimensional model, at least one of the stretching force, bending force and twisting force respectively corresponding to the plurality of special effect particles at the i-th moment is determined, wherein the stretching force is used to indicate the stretching condition of the special effect particle by two adjacent special effect particles, the bending force is used to indicate the influence condition of the plane angle of the special effect particle by two adjacent special effect particles, and the twisting force is used to indicate the influence condition of the space angle of the special effect particle by two adjacent special effect particles; Based on at least one of the stretching force, the bending force and the twisting force, force data corresponding to each of the plurality of special effect particles are determined.
8. The method according to claim 7, wherein determining the force data corresponding to each of the plurality of special effect particles based on at least one of the stretching force, the bending force and the twisting force 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 data corresponding to the target special effect particle.
9. The method according to claim 7 or 8, wherein the bending force is determined by: For any target special effect particle among the plurality of special effect particles, determining a first special effect particle and a second special effect particle adjacent to the target special effect particle; Based on the movement speed and movement 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 acquired, where the bending energy values are used to represent the angle change of the particle connection edge connecting two adjacent special effect particles and the target special effect particle; The bending force 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, wherein obtaining 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 comprises: Determining a third special effect particle adjacent to the first special effect particle and the target special effect particle; Determining a fourth special effect particle adjacent to the second special effect particle and the target 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 10, further comprising: 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, wherein the step 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 comprises: 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 based 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 corresponding to the plurality of special effect particles on the second number of broken lines.
13. The method according to any one of claims 1 to 12, wherein generating an animation of the plurality of strip-shaped three-dimensional models moving along with the designated three-dimensional model based on the motion trajectory comprises: Generate a plurality of motion trajectory animation frames based on the motion trajectories respectively corresponding to the plurality of special effect particles; The animation is generated based on the plurality of motion trajectory animation frames.
14. An animation generating device, comprising: A broken line determination module, used to determine the broken lines corresponding to the plurality of strip-shaped three-dimensional models, the broken lines include a plurality of special effect particles, and the strip-shaped three-dimensional models are bound to the specified three-dimensional model; a force determination module, for determining, for a target fold line among the multiple fold lines, force data corresponding to a plurality of special effect particles on the target fold line at the i-th moment in response to the specified three-dimensional model generating movement at the i-th moment, based on the movement speed and movement direction of the specified three-dimensional model, wherein the force data is used to represent the force conditions of the special effect particles on the target fold line when the specified three-dimensional model moves, wherein i is a positive integer; A speed determination module, for calculating, for each special effect particle on the target fold line, a speed change of the special effect particle from the i-th moment to the i+1-th moment based on the force data corresponding to the special effect particle; The trajectory calculation module calculates the motion trajectories corresponding to the special effect particles on the multiple broken lines according to 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 on the multiple broken lines from the i-th moment to the i+1-th moment, and generates an animation of the multiple strip-shaped three-dimensional models moving along with the specified three-dimensional model based on the motion trajectories.
15. A computer device, comprising 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, wherein at least one program is stored in the storage medium, and the at least one program is loaded and executed by a processor to implement the animation generation method according to any one of claims 1 to 13.
17. A computer program product, comprising a computer program or instructions, wherein when the computer program or instructions are executed by a processor, the animation generation method according to any one of claims 1 to 13 is implemented.
Citation Information
Patent Citations
Technique for simulating the dynamics of hair
CN103870628A
Particle effect rendering method and device, equipment and storage medium
CN114219884A
Particle motion simulation method, device, equipment, storage medium and program product
CN114974438A
Computer graphic system and method for simulating hair
US20100277475A1
Adaptive material point method
US20160210384A1
Cited By
Three-dimensional model animation video generation method and device, electronic equipment and storage medium
CN119478148A
