Method, device, electronic device and readable storage medium for physical simulation

By using a pre-trained model correction method based on vertex animation data, the problems of high computational cost and poor simulation effect in existing technologies are solved, realizing realistic simulation of soft objects in large-scale scenes and improving the simulation effect in games.

CN119312664BActive Publication Date: 2025-12-16GUANGZHOU BOGUAN TELECOMM TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411303526.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2025-12-16
Estimated Expiration
2044-09-18

AI Technical Summary

Technical Problem

Existing real-time physics simulation methods involve large computational demands in large-scale scenes, making it difficult to achieve realistic deformation and complex physical representations of soft tissues. Linear skinning technology is limited by skeletal structures, resulting in poor simulation effects.

Method used

The vertex animation inertia data for the third frame is determined by using the vertex animation data of the simulated entity in the first and second frames. This data is then input into a pre-trained correction model. The vertex animation data for the third frame is generated by combining the vertex animation influencing factor data. The pre-trained model is then used to correct the animation data of the current frame.

Benefits of technology

It achieves a realistic effect of simulating soft objects in real time in games, reduces the amount of computation, improves the accuracy and smoothness of the simulation, and avoids the limitations of skeletal structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119312664B_ABST
    Figure CN119312664B_ABST
Patent Text Reader

Abstract

The application discloses a physical simulation method and device, electronic equipment and computer readable storage medium. The method comprises the following steps: determining vertex animation inertia data of a third frame simulation entity based on vertex animation data of a first frame simulation entity and vertex animation data of a second frame simulation entity; the vertex animation of the first frame, the second frame and the third frame simulation entity are sequentially adjacent; inputting the vertex animation inertia data of the third frame simulation entity, the vertex animation data of the second frame simulation entity and vertex animation influencing factor data corresponding to the vertex animation of the third frame simulation entity into a pre-trained correction model; the pre-trained correction model outputs vertex animation correction data of the third frame simulation entity; and generating the vertex animation data of the third frame simulation entity based on the vertex animation inertia data of the third frame simulation entity and the vertex animation correction data of the third frame simulation entity. The method can simulate the simulation effect of the simulation entity in real time, and the simulation effect is better.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically to a method, apparatus, electronic device, and computer-readable storage medium for physical simulation. Background Technology

[0002] Real-time physics simulation refers to the technique of simulating the motion and behavior of objects in computer games or simulation software in a way that closely resembles the physical laws of the real world. Flexible body simulation, a subset of real-time physics simulation, focuses on simulating non-rigid objects that can deform, such as clothing, hair, and muscle tissue. In games, flexible body simulation can significantly improve the performance of non-rigid objects, making their movements more realistic.

[0003] Flexible body simulation is a physical simulation technique performed in a real-time computing environment. Existing implementation methods include particle-spring modeling and real-time finite element method (FEM) solving. Particle-spring modeling discretizes a flexible object into a set of particles (nodes) and springs connecting these particles. For example, clothing or hair can be considered as composed of numerous particles and springs connecting them. By calculating and simulating the forces acting on each particle and spring, realistic dynamic effects of the fabric under different environments can be achieved. Real-time finite element method (FEM) solving establishes a muscle tissue model, discretizing it into a finite element mesh. The finite element mesh typically consists of voxel elements and nodes. Voxel elements calculate deformation in their continuous space. The finite element method is used to numerically calculate the muscle tissue model, simulating the deformation and stress distribution of the muscle tissue by solving the elasticity equations. The stress of the finite element mesh is applied to each simulation node, and the new position of the node is updated to render the latest dynamic effect.

[0004] While the aforementioned real-time physics simulation methods have their applications, they are computationally intensive and difficult to use in large-scale scenarios. To reduce the computational burden in flexible body simulation, developers adopted the Soft Bone Solution. This solution models the skeletons in the game, adds elastic constraints between bones, and performs real-time elastic simulation between them. After the simulation is complete, linear skinning technology is used to generate the final rendered mesh. However, linear skinning technology, limited by the skeletal structure, struggles to handle large-scale simulations of soft tissue deformation or complex physical representations, or distortion or plastic deformation of the model surface, resulting in poor simulation effects. Summary of the Invention

[0005] This application provides a method, apparatus, electronic device, and computer-readable storage medium for physical simulation, which solves the problem of poor physical simulation effect of simulated entities.

[0006] In a first aspect, embodiments of this application provide a method for physical simulation, the method comprising:

[0007] Based on the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity, the vertex animation inertia data of the third frame simulated entity is determined; wherein, the vertex animation of the first frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the second frame simulated entity, and the vertex animation of the second frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the third frame simulated entity.

[0008] The vertex animation inertial data of the simulated entity in the third frame, the vertex animation data of the simulated entity in the second frame, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame are input into the pre-trained correction model, and the pre-trained correction model outputs the vertex animation correction data of the simulated entity in the third frame; wherein, the vertex animation influencing factor data is used to characterize the factors that affect the dynamic behavior of the simulated entity.

[0009] Vertex animation data of the third frame simulated entity is generated based on the vertex animation inertial data and the vertex animation correction data of the third frame simulated entity.

[0010] Secondly, embodiments of this application also provide a physical simulation apparatus, the apparatus comprising:

[0011] The first determining module is used to determine the vertex animation inertia data of the third frame simulated entity based on the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity; wherein, the vertex animation of the first frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the second frame simulated entity, and the vertex animation of the second frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the third frame simulated entity.

[0012] The second determining module is used to input the vertex animation inertial data of the simulated entity in the third frame, the vertex animation data of the simulated entity in the second frame, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame into a pre-trained correction model, and the pre-trained correction model outputs the vertex animation correction data of the simulated entity in the third frame; wherein, the vertex animation influencing factor data is used to characterize the factors that affect the dynamic behavior of the simulated entity.

[0013] The generation module is used to generate vertex animation data of the third frame simulated entity based on the vertex animation inertial data and the vertex animation correction data of the third frame simulated entity.

[0014] Thirdly, embodiments of this application also provide an electronic device, including:

[0015] Processor; and

[0016] The memory stores the data processing program. After the electronic device is powered on and the processor runs the program, it performs the following steps:

[0017] Based on the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity, the vertex animation inertia data of the third frame simulated entity is determined; wherein, the vertex animation of the first frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the second frame simulated entity, and the vertex animation of the second frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the third frame simulated entity.

[0018] The vertex animation inertial data of the simulated entity in the third frame, the vertex animation data of the simulated entity in the second frame, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame are input into the pre-trained correction model, and the pre-trained correction model outputs the vertex animation correction data of the simulated entity in the third frame; wherein, the vertex animation influencing factor data is used to characterize the factors that affect the dynamic behavior of the simulated entity.

[0019] Vertex animation data of the third frame simulated entity is generated based on the vertex animation inertial data and the vertex animation correction data of the third frame simulated entity.

[0020] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a data processing program, which is executed by a processor to perform the following steps:

[0021] Based on the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity, the vertex animation inertia data of the third frame simulated entity is determined; wherein, the vertex animation of the first frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the second frame simulated entity, and the vertex animation of the second frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the third frame simulated entity.

[0022] The vertex animation inertial data of the simulated entity in the third frame, the vertex animation data of the simulated entity in the second frame, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame are input into the pre-trained correction model, and the pre-trained correction model outputs the vertex animation correction data of the simulated entity in the third frame; wherein, the vertex animation influencing factor data is used to characterize the factors that affect the dynamic behavior of the simulated entity.

[0023] Vertex animation data of the third frame simulated entity is generated based on the vertex animation inertial data and the vertex animation correction data of the third frame simulated entity.

[0024] Compared with the prior art, this application has the following advantages:

[0025] This application provides a physical simulation method that determines the vertex animation inertia data of a third frame of a simulated entity based on the vertex animation data of a first frame of the simulated entity and the vertex animation data of a second frame of the simulated entity. The vertex animation of the first frame of the simulated entity is the vertex animation of the simulated entity in the frame preceding the vertex animation of the second frame of the simulated entity, and the vertex animation of the second frame of the simulated entity is the vertex animation of the simulated entity in the frame preceding the vertex animation of the third frame of the simulated entity. Specifically, in this application, the animation data of the simulated entity in the current frame when it is not subjected to any force is first predicted using the frame preceding the current frame and the frame preceding that frame. Then, the vertex animation inertia data of the third frame of the simulated entity, the vertex animation data of the second frame of the simulated entity, and the vertex animation influencing factor data corresponding to the vertex animation of the third frame of the simulated entity are input into a pre-trained correction model. The pre-trained correction model outputs the corrected vertex animation data of the third frame of the simulated entity. The vertex animation influencing factor data is used to characterize the factors affecting the dynamic behavior of the simulated entity. In other words, the pre-trained correction model predicts the corrected vertex animation data for the current frame using the animation data of the simulated entity when it is not subjected to any force, the animation data of the previous frame adjacent to the current frame, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the current frame. Finally, based on the vertex animation inertia data and the corrected vertex animation data of the simulated entity in the third frame, the vertex animation data of the simulated entity in the third frame is generated. That is, the predicted animation data of the simulated entity in the current frame when it is not subjected to any force is corrected using the predicted corrected vertex animation data of the current frame to obtain the vertex animation data of the simulated entity in the current frame. This method can simulate the simulation effect of the simulated entity in real time during game runtime, and the simulation effect is relatively good. Attached Figure Description

[0026] Figure 1 This is a flowchart illustrating a physical simulation method provided in an embodiment of this application;

[0027] Figure 2 This is a flowchart illustrating another physical simulation method provided in an embodiment of this application;

[0028] Figure 3 This is a structural block diagram of a physical simulation device provided in an embodiment of this application;

[0029] Figure 4 This is a structural block diagram of the electronic device provided in the embodiments of this application. Detailed Implementation

[0030] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0031] It should be noted that the terms "first," "second," "third," etc., in the claims, specification, and drawings of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. Such data are interchangeable where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that shown or described herein. Furthermore, the terms "comprising," "having," and their variations are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or apparatuses.

[0032] Real-time physics simulation refers to the technique of simulating the motion and behavior of objects in computer games or simulation software in a way that closely resembles the physical laws of the real world. Flexible body simulation, a subset of real-time physics simulation, focuses on simulating non-rigid objects capable of deformation, such as clothing, hair, and muscle tissue. In games, flexible body simulation can significantly improve the performance of non-rigid objects, making their movements more realistic. For example, clothing flutters in the wind or sways naturally with the character's movements; a character's hair exhibits realistic dynamics when running or being blown by the wind; and in some simulation games, body parts (such as the chest and hips) can have more realistic physical feedback, especially with the support of motion capture and animation fusion technologies. Flexible body simulation makes virtual environments closer to the real world, thereby attracting players and enhancing the entertainment value of games.

[0033] Flexible body simulation is a physical simulation technique performed in a real-time computing environment. The particle-spring model is one of the most common methods, used to discretize flexible objects into a set of particles (nodes) and springs connecting these particles. For example, clothing or hair can be considered as composed of numerous particles and springs connecting them. Taking clothing simulation as an example, the particle-spring model can simulate the softness, elasticity, and dynamic behavior of fabric. Each particle represents a vertex of the fabric mesh, while the springs simulate the constraints between adjacent particles. During the simulation, the springs are affected by forces such as tension, compression, and bending, thus affecting the position and motion of adjacent particles. In this way, by simulating the physical interaction between each particle and the spring, the fabric can be simulated. Simultaneously, the spring-particle model can simulate the dynamic deformation, vibration, and gravitational effects of the fabric under external forces. By calculating and simulating the forces acting on each particle and spring, realistic dynamic effects of the fabric in different environments can be achieved, such as wind blowing or collisions with objects.

[0034] For muscle tissue, real-time finite element method (FEM) is typically used for solution. First, a muscle tissue model is created, and material properties are defined for it, including Young's modulus, Poisson's ratio, and density. Next, the muscle tissue model is discretized into a finite element mesh, which typically consists of voxel elements and nodes. Voxel elements are usually tetrahedral or hexahedral. Voxel elements are used to calculate deformation in their continuous space. The finite element method is used to numerically calculate the muscle tissue model, simulating deformation and stress distribution by solving the elasticity equations. The stress of the finite element mesh is applied to each simulated node, updating the node's new position to render the latest dynamic effects.

[0035] While the aforementioned real-time physics simulation methods have their applications, they are computationally intensive and difficult to use in large-scale scenarios. To reduce the computational burden in flexible body simulation, developers adopted the Soft Bone Solution. This solution models the skeleton in the game, adds elastic constraints between bones, and performs real-time elasticity simulation between bones. After the simulation, linear skinning technology is used to generate the final rendering mesh. The Soft Bone Solution typically only needs to simulate the elasticity of a few bones before calculating the final rendering mesh using linear skinning. However, linear skinning technology often struggles to accurately simulate the deformation of soft tissues, such as muscles, fat, and skin, leading to stiff and unrealistic deformations in character animations. If the deformation of soft tissues is simulated locally between bone chains, generating the final rendering mesh using linear skinning will result in unreasonable deformation and stretching. Due to the limitations of the skeletal structure, linear skinning technology struggles to handle large-scale simulations of soft tissue deformation or complex physical representations, or distortion or plastic deformation of the model surface, resulting in poor simulation effects.

[0036] To address the aforementioned problems in related technologies, embodiments of this application provide a method, apparatus, electronic device, and computer-readable storage medium for physical simulation. One embodiment of the physical simulation method can be executed by a computer device, which can be a terminal or server, etc. The terminal can be a smartphone, tablet, laptop, touchscreen, game console, etc. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, and big data and artificial intelligence platforms.

[0037] The physical simulation method provided in this application can be used to acquire vertex animation data of simulated entities in real time, thereby achieving the simulation effect of simulated entities in real time.

[0038] like Figure 1 The diagram shown is a flowchart illustrating a physical simulation method provided in an embodiment of this application. The method includes:

[0039] Step S101: Based on the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity, determine the vertex animation inertial data of the third frame simulated entity; wherein, the vertex animation of the first frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the second frame simulated entity, and the vertex animation of the second frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the third frame simulated entity.

[0040] In this embodiment, a simulated entity refers to an object whose dynamic behavior is simulated through physical simulation in a virtual environment. Flexible body simulation typically involves objects with soft, deformable properties, such as fabric, rope, liquid, and balloons. Such simulations usually need to consider the object's physical properties, such as elasticity, density, and friction, and calculate the object's deformation and motion in real time during the simulation. During the simulation of a simulated entity, its dynamic behavior is simulated based on its physical properties, including deformation, motion, and interaction with other objects.

[0041] Vertex animation data for a simulated entity refers to the position information of each vertex of the simulated entity in each frame of the animation. It can be denoted as X = [x0, x1, ..., x...]. n ], where x i Let n represent the simulated entity vertex animation data of the i-th frame, where n is a positive integer.

[0042] It should be noted that a 3D model is a mesh composed of multiple polygons (usually triangles), and each polygon is defined by several vertices. Each vertex has specific spatial coordinates (x, y, z).

[0043] Application scenarios of simulated entities in flexible body simulation include: (1) Fabric simulation: simulating the natural swaying and folding of fabrics such as clothing, flags, and curtains. (2) Liquid simulation: simulating the flow and ripple effects of liquids such as water and oil. (3) Rope simulation: simulating the bending and stretching of slender objects such as ropes and chains. (4) Balloon simulation: simulating the dynamic effects of balloon inflation and deflation. (5) Collision detection: performing collision detection during the simulation process to ensure that the interaction between objects conforms to the laws of physics.

[0044] To obtain vertex animation data for a simulated entity, you can create or import a 3D model in 3D modeling software. Enable a physics engine (such as Blender's Soft Body Dynamics, Maya's Nucleus, etc.). Set the conditions for the physics simulation, such as gravity and collision detection. Run the physics simulation and observe the physical behavior of the 3D model in the animation. Record the new position information of all vertices in each frame. This yields the vertex animation data for the simulated entity. Alternatively, you can create a particle system in 3D modeling software and set particle properties, such as emission speed and lifespan. Run a particle simulation and observe the particle behavior. Record the position information of all particles in each frame. The position information of all particles can be considered as vertex animation data. Another method to obtain vertex animation data for a simulated entity is to create or import a 3D model in 3D modeling software and manually adjust the vertex positions in each frame to achieve the desired animation effect. Record the position information of all vertices in each frame to form vertex animation data.

[0045] It should be noted that the vertex animations of the first, second, and third frames of the simulated entity are three adjacent frames. For example, the vertex animation of the first frame of the simulated entity is the vertex animation of the (i-2)th frame of the simulated entity, the vertex animation of the second frame of the simulated entity is the vertex animation of the (i-1)th frame of the simulated entity, and the vertex animation of the third frame of the simulated entity is the vertex animation of the i-th frame of the simulated entity.

[0046] This application uses the physical simulation of game character clothing as an example for explanation. The physical simulation of clothing in game characters refers to the realistic and dynamic representation of virtual clothing achieved through a physics engine within the game. The aim is to allow the clothing of game characters to move and deform naturally according to the character's actions and changes in the environment, thereby enhancing the game's immersion and realism.

[0047] Obtaining vertex animation data for simulated clothing involves: acquiring the skeletal animation data of the character model; configuring the corresponding skinning data for the character model; using the skinning data to drive the skeletal animation data to obtain the character animation data; and then applying the simulated clothing to the character model to obtain the vertex animation data for the simulated clothing.

[0048] Obtaining skeletal animation data can be achieved through several methods. First, it can be done manually by creating animations using professional 3D modeling software (such as Blender, Maya, 3ds Max, etc.). This involves adding bones to the 3D model using the rigging function in the 3D modeling software and then setting the position and rotation of the bones frame-by-frame using keyframe animation techniques. Alternatively, pre-made animation files can be purchased or downloaded for free from various online asset stores (such as the Unity Asset Store, Unreal Marketplace, etc.). Finally, it can be done by accessing the source files of a game or project and extracting existing animation data from that game.

[0049] For example, skeletal animation data can be obtained by recording the skeletal animation of a character in a game. That is, determine the animation segments of the character to be recorded, such as basic actions like walking, running, and attacking, as well as special actions specific to certain game scenarios. The motion capture system (including cameras, sensors, computing devices, etc.) records the character's motion data in real time to obtain skeletal animation data.

[0050] It should be noted that after obtaining the skeletal animation dataset, the obtained skeletal animation data can be processed, including (1) data cleaning, cleaning the collected skeletal animation data, removing noise, and correcting erroneous data. (2) animation editing: using professional animation editing software (such as Autodesk MotionBuilder, Blender, etc.) to edit, adjust and optimize the recorded skeletal animation data to make it more suitable for use in games. (3) animation fusion: multiple action segments can be spliced ​​together to form a smoother animation sequence.

[0051] Skeletal animation is the process of controlling a character's bones to move the character model. Skeletal animation consists of a series of continuous skeletal frames, each representing a single moment in time.

[0052] Each bone in a character represents a joint or body part, and its position and rotation can be changed. Position refers to the coordinates of each bone in 3D space (usually values ​​on the x, y, and z axes). Position determines the bone's spatial location in the current frame. Rotation refers to the orientation or pose of each bone, typically represented by Euler angles, quaternions, or rotation matrices, describing the angle of rotation of the bone relative to its parent bone or world coordinates.

[0053] Skeletal animation data (DataSet-Pose) refers to the position and rotation data of a character's skeleton in each frame, recorded during game development and animation production. For example, a game character's skeleton includes the head, torso, arms, and legs. Therefore, the skeletal animation data for each frame includes: ① the position and rotation of the head bones; ② the position and rotation of the torso bones; ③ the position and rotation of the left and right arms; ④ the position and rotation of the left and right legs, etc. The skeletal animation dataset can be denoted as Y... char =[y char-0 ,y char-1 ,…,y char-n ], where y char-i Represents the position and rotation data (Pose) of the i-th frame, x∈[0,1,2,…,n], where n is a positive integer.

[0054] Acquiring skinning data can be done by configuring skinning data for skeletal animation, that is, assigning weights to each vertex of the character model's surface mesh. For example, in 3D modeling software, you can manually adjust the weights of each vertex of the character model's surface mesh to ensure natural animation. Alternatively, you can use an automatic weighting tool (such as Weights Paint Mode) to generate the weights for each vertex of the character model's surface mesh. Skinning data can also be obtained by recording the skeletal animation of a character in a game while acquiring the skeletal animation dataset. This skinning data contains all the necessary skinning information, such as weight data and bone hierarchy relationships.

[0055] It should be noted that in 3D animation and game development, skinning data refers to the skin data of a character. In this application, skinning data refers to the body data of a 3D model of a character without clothing. That is, in this application, skinning data is the surface mesh data of the character model, which can be driven by a skeletal animation system to achieve various actions.

[0056] Skinning data describes how to combine the surface mesh of a 3D model with its skeleton to achieve skeletal animation effects. Specifically, skinning data allows a character model to deform according to changes in skeletal animation, resulting in realistic animation effects. In games and virtual reality applications, skinning data enables characters to perform actions based on user input or other game logic.

[0057] The skinning data contains the following information: (1) Weights: The degree of association between each vertex of the 3D model's surface mesh and the bones. Weights represent the degree to which each vertex is affected by one or more bones. For example, the vertices of an arm are mainly affected by the upper arm bone and the forearm bone, and the weight values ​​determine the relative strength of these effects. (2) Bone Indices: The indices of the bones associated with each vertex of the 3D model's surface mesh. Each vertex is affected by multiple bones simultaneously, so it is necessary to record the indices of these bones in the bone array. (3) Bone Transformations: Information such as the position, rotation, and scaling of bones in the animation. This information is used to calculate the position and pose of bones in each frame. (4) Calculations in the Vertex Shader: In real-time rendering, the skinning data is used in the vertex shader to calculate the final position of the vertices. The vertex shader calculates the new position of each vertex based on the current position and rotation of the bones, combined with the vertex weights.

[0058] Obtaining character animation data (DataSet Character) involves applying the bone position and rotation data from each frame of the skeletal animation to the skinning data. Through weighted calculations, the new positions of each vertex of the character model's surface mesh are determined, forming a new mesh shape. The vertex position data in this new mesh shape constitutes vertex animation data, containing the character's animation state in the current frame. In other words, character animation data is obtained by driving the skeletal animation data with the skinning data.

[0059] It should be noted that in computer graphics and game development, character animation data (DataSet-Character) is a dataset used to describe the animation state and behavior of a character. It contains information about the character in different animation states, such as (1) the position (coordinates) and rotation angle of each bone in each frame of the animation; the weight relationship between each vertex of the character's surface mesh and the relevant bones, used to calculate the position change of each vertex in the animation. (2) the character's animation in different states, such as standing, walking, running, attacking, being injured, etc.; the animation data for each state may include keyframes, animation curves, etc. (3) how to mix the data of different animation states when the character smoothly transitions between different animations. (4) events triggered on specific frames of the animation, such as triggering a hit effect or sound effect at the point of impact of an attack action.

[0060] Obtaining the vertex animation data (DataSet Simulated) for simulated clothing can be achieved by loading or creating a 3D character model in DCC software, applying the character's animation data to the 3D character model, and then launching the clothing simulation function in DCC software. During the simulation, the vertex positions of the clothing change based on the character's animation data and the results of the clothing simulation. This changed vertex position data constitutes the vertex animation data for the simulated clothing.

[0061] It should be noted that DCC software refers to professional tools used to create and edit 3D models, animations, and other content, such as Blender, Maya, and 3ds Max.

[0062] In some embodiments, obtaining the vertex animation inertial data of the third frame of the simulated entity based on the vertex animation data of the second frame of the simulated entity and the positional change of the same vertex of the simulated entity includes:

[0063] The vertex animation data of the simulated entity in the second frame is multiplied by the corresponding first weight, and the position change of the same vertex of the simulated entity is multiplied by the corresponding second weight and then added together. The resulting weighted sum is the vertex animation inertial data of the simulated entity in the third frame.

[0064] In the embodiments of this application, such as Figure 2 The diagram shown is a flowchart illustrating another physical simulation method provided in this application embodiment. The obtained vertex animation data of the simulated entity in the second frame is x. i-1 The first frame of the simulated entity's vertex animation data obtained is x. i-2 Then the vertex animation inertial data x of the simulated entity in the third frame init-i It can be calculated using the following formula 1.

[0065] x init-i =α⊙x i-1 +β⊙(x i-1 -x i-2 ) (Formula 1)

[0066] Where α is the vertex animation data x of the simulated entity in the second frame. i-1 The corresponding first weight. β is the position change x of the same vertex of the simulated entity in the vertex animation of the simulated entity in the first frame and the vertex animation of the simulated entity in the second frame. i-1 -x i-2 The corresponding second weight. ⊙ represents component-wise multiplication, which refers to performing element-wise multiplication on two vectors or matrices. Multiplication multiplies corresponding elements to generate a result vector or matrix with the same dimensions.

[0067] In some embodiments, before the steps of multiplying the vertex animation data of the simulated entity in the second frame by the corresponding first weight and multiplying the position change of the same vertex of the simulated entity by the corresponding second weight and then adding them together, the method further includes:

[0068] Acquire vertex animation data of multiple third-frame simulated entities, vertex animation data of second-frame simulated entities adjacent to the vertex animation of each third-frame simulated entity, and vertex animation data of first-frame simulated entities adjacent to the vertex animation of the second-frame simulated entities.

[0069] Based on the vertex animation data of the second frame simulated entity adjacent to the vertex animation of each third frame simulated entity, and the positional change of the same vertex of the simulated entity in the vertex animation data of each first frame simulated entity and the vertex animation data of each second frame simulated entity, multiple vertex animation prediction data of the third frame simulated entity are generated.

[0070] Minimize the difference between the vertex animation data of each third frame simulated entity and the vertex animation prediction data of the corresponding third frame simulated entity to obtain the first weight corresponding to the vertex animation data of the second frame simulated entity and the second weight of the position change of the same vertex of the simulated entity in the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity.

[0071] In some embodiments, minimizing the difference between the vertex animation data of each third-frame simulated entity and the vertex animation prediction data of the corresponding third-frame simulated entity includes:

[0072] A linear model is generated based on the vertex animation data of the second frame simulated entity, the first weight corresponding to the vertex animation data of the second frame simulated entity, the position change of the same vertex of the simulated entity in the vertex animation of the first frame simulated entity and the vertex animation of the second frame simulated entity, the second weight corresponding to the position change of the same vertex of the simulated entity, and the vertex animation data of the third frame simulated entity.

[0073] By fitting the linear model using the least squares method to satisfy preset conditions, the first weight corresponding to the vertex animation data of the second frame simulated entity and the second weight of the position change of the same vertex of the simulated entity in the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity are obtained. The preset condition is that the sum of squared residuals between the vertex animation data of the third frame simulated entity and the corresponding vertex animation prediction data of the third frame simulated entity is minimized.

[0074] In this embodiment of the application, the vertex animation data x of the simulated entity in the (i-1)th frame is used. i-1 The vertex animation data x of the simulated entity in the (i-1)th frame i-1The corresponding first weight α, and the change in position x of the same vertex of the simulated entity in the vertex animation of the simulated entity in the (i-2)th frame and the vertex animation of the simulated entity in the (i-1)th frame. i-1 -x i-2 The second weight β corresponding to the position change of the same vertex of the simulated entity and the vertex animation data x of the simulated entity in the third frame. i The linear model generated is Equation 2.

[0075] x i =[α,β]*[x i-1 x i-1 -x i-2 ](Formula 2)

[0076] The equation in Formula 2 above is solved using the least squares method, and the first weight α and the second weight β are fitted.

[0077] Step S102: Input the vertex animation inertial data of the third frame simulated entity, the vertex animation data of the second frame simulated entity, and the vertex animation influencing factor data corresponding to the vertex animation of the third frame simulated entity into the pre-trained correction model. The pre-trained correction model outputs the vertex animation correction data of the third frame simulated entity. The vertex animation influencing factor data is used to characterize the factors that affect the dynamic behavior of the simulated entity.

[0078] In this embodiment, the vertex animation inertial data of the simulated entity is used to characterize the motion of the simulated entity when no external force is applied. Here, "no external force" means that no force is applied or only conservative forces such as gravity are applied.

[0079] Vertex animation influencing factor data is used to characterize the factors that affect the dynamic behavior of the simulated entity. That is, vertex animation influencing factor data is the factors that affect the simulation results of the simulated entity. It includes: (1) the basic physical properties of the simulated object, such as mass, density, elastic modulus, coefficient of friction, etc. These properties directly affect the behavior of the object under force. (2) the state at the beginning of the simulation, including position, velocity, angular velocity, etc. The initial conditions are the basis of the simulation and determine the starting point of subsequent motion. (3) the forces acting on the simulated object, including gravity, thrust, tension, etc., as well as the torque generated by rotation. These forces will determine the acceleration and rotation of the object. (4) environmental conditions, such as air resistance, hydrodynamic effects, ground friction, etc. These factors will affect the trajectory of the object. (5) the constraints on the simulated object (such as hinge connections, ropes, etc.), and it is necessary to define the specific form and strength of these constraints.

[0080] In the physics simulation of game character clothing, in addition to the skeletal structure mentioned above, other factors affecting the simulation results of the game character clothing also need to be considered. These factors are called environmental parameter data (DataSet Env), including but not limited to: ground height, wind direction and strength, gravity magnitude, character motion parameters relative to the scene, and the position and shape of other colliders.

[0081] It should be noted that environmental parameter data refers to the environmental parameter data used in each frame when generating the simulated entity, which can be denoted as Y. Env =[y env-0 y env-1 , ..., y env-n ], where y env-0 This represents the environmental parameter data of the simulated entity in the vertex animation data of the first frame.

[0082] Continuing with the example of the physical simulation of game character clothing, we will design character clothing for a character model in 3D clothing design and simulation software (such as Marvelous Designer). Character clothing can include armor, capes, skirts, etc. When designing the character model's clothing, ensure that the clothing flows naturally in the wind or fits the body during character movement. Place the designed character clothing onto the character model built in DCC, and set the environment parameter data for each frame of animation in DCC. Use the character animation data to drive the character model in DCC, generating and exporting the vertex animation data of the simulated clothing. Simultaneously, record and export the environment parameter data.

[0083] In the embodiments of this application, such as Figure 2 As shown, the vertex animation inertial data x of the simulated entity in the third frame is... init-i The vertex animation data x of the second frame simulating the entity i-1 And the vertex animation influencing factor data a corresponding to the vertex animation of the simulated entity in the third frame. i Input a pre-trained correction model, which outputs the vertex animation correction data of the simulated entity in the third frame.

[0084] In some embodiments, before inputting the vertex animation inertial data of the third frame simulated entity, the vertex animation data of the second frame simulated entity, and the vertex animation influencing factor data corresponding to the vertex animation of the third frame simulated entity into the pre-trained correction model, the method further includes:

[0085] Obtain a training dataset, which includes multiple training samples and corresponding annotations for each training sample. Each training sample includes vertex animation inertial data of the simulated entity in the third frame, vertex animation data of the simulated entity in the second frame, and vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame. The annotations corresponding to each training sample are the vertex animation data of the simulated entity in the real third frame.

[0086] The training samples are input into the correction model to be trained, and the correction model to be trained outputs the vertex animation correction data of the simulated entity in the third frame predicted by the training samples.

[0087] The vertex animation correction data of the third frame simulated entity is superimposed on the vertex animation inertial data of the third frame simulated entity to obtain the predicted vertex animation data of the third frame simulated entity.

[0088] Based on the predicted vertex animation data of the simulated entity in the third frame and the actual vertex animation data of the simulated entity in the third frame, the correction model to be trained is trained to obtain a pre-trained correction model.

[0089] In this embodiment, multiple sets of vertex animations for adjacent first-frame, second-frame, and third-frame simulated entities can be acquired. Based on the vertex animation data of each set of first-frame and second-frame simulated entities, vertex animation inertial data for the third-frame simulated entity is obtained. Then, the vertex animation inertial data of each set of third-frame simulated entities, the vertex animation data of the second-frame simulated entity in the frame preceding each third-frame simulated entity's vertex animation, and the vertex animation influencing factor data corresponding to the third-frame simulated entity's vertex animation are input into the correction model to be trained. The correction model outputs predicted corrected vertex animation data for the third-frame simulated entity. The predicted corrected vertex animation data for the third-frame simulated entity is used to correct the vertex animation inertial data of the third-frame simulated entity, resulting in predicted vertex animation data for the third-frame simulated entity. Then, the difference between the predicted vertex animation data and the actual vertex animation data of the third-frame simulated entity is used as the loss function of the correction model to be trained until the model converges, resulting in a pre-trained correction model.

[0090] In some embodiments, after the step of obtaining the training dataset, the method further includes:

[0091] The vertex animation inertial data of the simulated entity in the third frame, the vertex animation data of the simulated entity in the second frame, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame are spliced ​​together frame by frame to obtain the spliced ​​input data.

[0092] In this embodiment, the physical simulation of the game character's clothing will be used as an example for further explanation. The skeletal animation data, environment parameter data, and vertex animation data of the simulated entity have the same number of frames, and they correspond one-to-one frame. When organizing the training data, the skeletal animation data and environment parameter data are first concatenated frame by frame into input data (DataSet input), which can be denoted as Y = [y0, y1, ..., y...]. n ], where y i =[y char-i y env-i ], y i This represents the input data for the i-th frame, which is a concatenation of the skeletal animation data and the environment parameter data. i∈[0,1,2,…,n], where n is a positive integer.

[0093] It should be noted that, in this embodiment of the application, it is assumed that the factors affecting the simulation results of the simulated entity include skeletal animation and environment. The skeletal animation data and environment parameter data are concatenated frame by frame as input data. By concatenating the skeletal animation data and environment parameter data frame by frame as input data, the machine learning algorithm can comprehensively process the influence of skeletal animation data and environment parameter data on the simulation results of the simulated entity.

[0094] In some embodiments, after the step of obtaining the training dataset, the method further includes:

[0095] The training dataset is subjected to dimensionality reduction processing to obtain the dimensionality-reduced data corresponding to the training dataset.

[0096] In this embodiment, the physical simulation of the game character's clothing will be used as an example for further explanation. PCA dimensionality reduction is performed on the input data to obtain the first PCA code corresponding to the input data, which can be denoted as W = [w0, w1, ..., w n ], where w i The first PCA encoding of the input data of the i-th frame after dimensionality reduction.

[0097] It should be noted that the relationship between Y and W is W = U(Yy) u ), where U is the transformation matrix for PCA dimensionality reduction, y u This is the mean of the input data for all frames in Y.

[0098] Among them, y i and w i The relationship between them is:

[0099] y i =U T *w i +y u (Formula 3)

[0100] Among them, U T Let U be the transpose of the transformation matrix U.

[0101] If you don't want to perform PCA dimensionality reduction on the input data, you can simply set W = Y.

[0102] In this embodiment, the method further includes performing PCA dimensionality reduction on the vertex animation data of the simulated entity to obtain a second PCA encoding corresponding to the vertex animation data of the simulated entity, which can be denoted as Z = [z0, z1, ..., z]. n ], where z i The second PCA encoding corresponds to the vertex animation data of the simulated entity in the i-th frame. The second PCA encoding is used as the output data.

[0103] The relationship between the vertex animation data X of the simulated entity and the corresponding PCA code Z of the vertex animation data of the simulated entity is Z = U(Xx) u U is the transformation matrix for PCA dimensionality reduction, x u is the mean of the vertex animation data of the simulated entity across all frames in X.

[0104] Where, x i With z i The relationship between them is:

[0105] x i =U T *z i +x u (Formula 4)

[0106] It should be noted that PCA dimensionality reduction reduces the complexity of input data and vertex animation data of simulated entities, thereby reducing the training difficulty of models in machine learning.

[0107] Dimensionality reduction is a preprocessing method for high-dimensional data. It retains the most important features of high-dimensional data while removing noise and unimportant features, thereby improving data processing speed. In practical production and applications, dimensionality reduction can save significant time and costs within a certain range of information loss. Dimensionality reduction makes datasets more usable, reduces the computational cost of algorithms, removes noise, and makes results easier to understand.

[0108] Principal Component Analysis (PCA) is a widely used data compression algorithm. In PCA, the data is transformed from its original coordinate system to a new one, determined by the data itself. During the transformation, the direction of maximum variance is used as the coordinate axis. The first new coordinate axis is chosen from the direction of maximum variance in the original data, and the second new coordinate axis is chosen from the direction orthogonal to the first and with the second largest variance. This process is repeated a number of times equal to the number of feature dimensions of the original data.

[0109] In this embodiment of the application, during model training, the first PCA encoding W = [w0, w1, ..., w] corresponding to the input data is used. n As one of the input data for the modified model to be trained, the second PCA encoding Z = [z0, z1, ..., z] corresponding to the vertex animation data of the entity is used to simulate the entity. n The output data of the modified model to be trained is used to train the modified model. This specifically includes the following steps:

[0110] Step 1: Generate the first noise data r0 and the second noise data r1;

[0111] Step 2: Apply the first noise data r0 to the second PCA encoding z0 of the first frame to obtain z. * 0 = z0 + r0; where z * 0 can be used as the PCA code corresponding to the vertex animation prediction data of the first frame of the simulated entity;

[0112] The second noise data r1 is applied to the second PCA code z1 of the second frame to obtain z. * 1 = z1 + r1; z * 1 can be used as the PCA encoding corresponding to the vertex animation prediction data of the simulated entity in the second frame;

[0113] Step 3: Starting from the third frame, perform the following calculations:

[0114] z * init-i =α⊙z * i-1 +β⊙(z * i-1 -z * i-2 ) (Formula 5)

[0115] Among them, z* init-iPCA encoding corresponding to the vertex inertial data of the simulated entity in the i-th frame, where the vertex inertial data characterizes the motion of the simulated entity when no external force is applied. ⊙ ... * i-1 z is the PCA encoding corresponding to the vertex animation prediction data of the simulated entity in frame i-1. * i-2 z is the PCA encoding corresponding to the vertex animation prediction data of the simulated entity in frame i-2. * i-1 -z * i-2 The PCA encoding is the change in vertex position between the vertex animation prediction data of the simulated entity in frame i-2 and the vertex animation prediction data of the simulated entity in frame i-1.

[0116] α is the first weight vector corresponding to the vertex animation prediction data of the simulated entity in frame i-1; β is the second weight vector corresponding to the change in vertex position between the vertex animation prediction data of the simulated entity in frame i-2 and the vertex animation prediction data of the simulated entity in frame i-1.

[0117] It should be noted that α and β can be obtained by fitting the linear model given in Equation 4 using the least squares method.

[0118] z i =[α,β]*[z i-1 , z i-1 -z i-2 ](Formula 6)

[0119] Among them, z i z i-1 and z i-2 It can be the second PCA encoding Z = [z0, z1, ..., z] corresponding to the vertex animation data of the simulated entity. n The vertex animation data of any three adjacent frames of simulated entities in the image are obtained by minimizing z. i and [α, β]*[z i-1 , z i-1 -z i-2 The sum of squared residuals between α and β is used to obtain α and β.

[0120] Least squares is a technique for estimating unknown parameters. It finds the best-fit parameters by minimizing the sum of squared residuals between observed values ​​and model predictions.

[0121] Step 4: Encode the PCA values ​​z* corresponding to the vertex inertial data of the simulated entity in the i-th frame. init-i The PCA encoding z corresponding to the vertex animation data of the simulated entity in frame i-1. i-1 and the PCA encoding w corresponding to the input data of frame i-1 i Input the correction model to be trained, and the correction model to be trained will output the vertex correction data Φ(z*) of the simulated entity in the i-th frame. init-i , z i-1 w i Vertex correction data Φ(z*) for simulated entities init-i , z i-1 w i It is used to correct the vertex inertial data of simulated entities.

[0122] Step 5: Use the PCA encoding z* corresponding to the vertex inertial data of the simulated entity in the i-th frame. init-i and the vertex correction data Φ(z*) of the simulated entity in the i-th frame init-i , z i-1 w i The PCA encoding corresponding to the vertex animation prediction data of the simulated entity in the i-th frame is obtained. Specifically:

[0123] z*i=z* init-i +Φ(z* init-i , z i-1 w i )(Formula 7)

[0124] That is, the vertex inertial data z* of the simulated entity in the i-th frame is obtained through Formula 5 above. init-i and the vertex correction data Φ(z*) of the simulated entity in the i-th frame init-i , z i-1 w i The calculation is performed to obtain the PCA encoding corresponding to the vertex animation prediction data of the simulated entity in the i-th frame.

[0125] Step 6: Calculate the error L

[0126] L = L pos +L vel (Formula 8)

[0127] L pos =L pos-0 +||z * i -z i || (Formula 9)

[0128] L vel =L vel-0 +||(z * i -z* i-1 )-(z i -z i-1 )|| (Formula 10)

[0129] Among them, L pos The PCA encoding z corresponding to the vertex animation prediction data of the simulated entity in frame i. * i The PCA encoding z corresponding to the actual vertex animation data of the simulated entity in frame i. i The error between them. ||z * i -z i || is the PCA encoding z corresponding to the vertex animation prediction data of the simulated entity in the i-th frame. * i The PCA encoding z corresponding to the actual vertex animation data of the simulated entity in frame i. i The norm between L. vel This represents the error between the PCA encoding corresponding to the change in the first vertex position and the change in the second vertex position. The change in the first vertex position is the change in vertex position between the predicted vertex animation data of the simulated entity in frame i and the predicted vertex animation data of the simulated entity in frame (i-1). The change in the second vertex position is the change in vertex position between the actual vertex animation data of the simulated entity in frame i and the actual vertex animation data of the simulated entity in frame (i-1). * i -z * i-1 )-(z i -z i-1 The norm between the PCA codes corresponding to the change in the position of the first vertex and the change in the position of the second vertex.

[0130] Step 7: Use gradient descent (AdamW, AmsGrad, etc.) to optimize the parameters of the corrected model to be trained on the error L in Step 6, so that the error function is minimized, and the pre-trained corrected model is obtained.

[0131] In some embodiments, after the step of obtaining the training dataset, the method further includes:

[0132] The training dataset is divided into multiple sets of data windows using a training window of a preset length.

[0133] The modified model to be trained is trained using the training data in each data window to obtain a pre-trained modified model.

[0134] In this implementation, the input and output data are divided into multiple groups using a training window, where the size of the training window is s. The input data in each training window is [w0, w1, ..., w...]. s The output data is [z0, z1, ..., z]. s ].

[0135] The training data is divided into multiple data windows. Training the corrected model using all of these data windows can reduce the increase in error of the corrected model over time.

[0136] Step S103: Based on the vertex animation inertial data and the vertex animation correction data of the third frame simulated entity, generate the vertex animation data of the third frame simulated entity.

[0137] In this embodiment of the application, the vertex animation correction data Φ(x) of the simulated entity in the third frame obtained in step S102 is used. init-i x i-1 a i The vertex animation inertial data x of the simulated entity in the third frame obtained in step S101 init-i Make corrections. During correction, the vertex animation correction data of the simulated entity in the third frame can be directly superimposed on the vertex animation inertia data x of the simulated entity in the third frame. init-i Specifically, this can be achieved through the following formula 10:

[0138] x i =x init-i +Φ(x init-i x i-1 a i )(Formula 11)

[0139] It should be noted that if the training data used to train the modified model has undergone dimensionality reduction, during real-time game execution, when predicting the vertex animation data of the simulated entity in frame i, the vertex animation inertia data of the simulated entity in frame i, the vertex animation data of the simulated entity in frame i-1, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in frame i can be dimensionality reduced separately. After obtaining the corresponding dimensionality reduction results, they can be input into the pre-trained modified model. Alternatively, the vertex animation inertia data of the simulated entity in frame i, the vertex animation data of the simulated entity in frame i-1, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in frame i can be mapped one-to-one, then concatenated to obtain the concatenated result, and the concatenated result can be dimensionality reduced. The dimensionality reduction results of the vertex animation inertia data of the simulated entity in frame i, the vertex animation data of the simulated entity in frame i-1, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in frame i can be input into the pre-trained modified model, and the pre-trained modified model outputs the dimensionality reduction result corresponding to the vertex animation modified data of the simulated entity in frame i. The dimensionality reduction result corresponding to the vertex animation correction data of the simulated entity in frame i is superimposed on the dimensionality reduction result corresponding to the vertex animation inertial data of the simulated entity in frame i to obtain the dimensionality reduction result corresponding to the predicted vertex animation data of the simulated entity in frame i.

[0140] After obtaining the dimensionality reduction result corresponding to the vertex animation data of the simulated entity in frame i, the dimensionality reduction result can be restored to the vertex animation data of the simulated entity in frame i using Formula 4. It should be noted that when restoring to the vertex animation data of the simulated entity in frame i, x in Formula 4... u The value can be the average of the vertex animation data of the simulated entity in all frames of X.

[0141] This application provides a physical simulation method that determines the vertex animation inertia data of a third frame of a simulated entity based on the vertex animation data of a first frame of the simulated entity and the vertex animation data of a second frame of the simulated entity. The vertex animation of the first frame of the simulated entity is the vertex animation of the simulated entity in the frame preceding the vertex animation of the second frame of the simulated entity, and the vertex animation of the second frame of the simulated entity is the vertex animation of the simulated entity in the frame preceding the vertex animation of the third frame of the simulated entity. Specifically, in this application, the animation data of the simulated entity in the current frame when it is not subjected to any force is first predicted using the frame preceding the current frame and the frame preceding that frame. Then, the vertex animation inertia data of the third frame of the simulated entity, the vertex animation data of the second frame of the simulated entity, and the vertex animation influencing factor data corresponding to the vertex animation of the third frame of the simulated entity are input into a pre-trained correction model. The pre-trained correction model outputs the corrected vertex animation data of the third frame of the simulated entity. The vertex animation influencing factor data is used to characterize the factors affecting the dynamic behavior of the simulated entity. In other words, the pre-trained correction model predicts the corrected vertex animation data for the current frame using the animation data of the simulated entity when it is not subjected to any force, the animation data of the previous frame adjacent to the current frame, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the current frame. Finally, based on the vertex animation inertia data and the corrected vertex animation data of the simulated entity in the third frame, the vertex animation data of the simulated entity in the third frame is generated. That is, the predicted animation data of the simulated entity in the current frame when it is not subjected to any force is corrected using the predicted corrected vertex animation data of the current frame to obtain the vertex animation data of the simulated entity in the current frame. This method can simulate the simulation effect of the simulated entity in real time during game runtime, and the simulation effect is relatively good.

[0142] Corresponding to the physical simulation method provided in the embodiments of this application, the embodiments of this application also provide a physical simulation apparatus, such as... Figure 3 As shown, the device 300 includes:

[0143] The first determining module 301 is used to determine the vertex animation inertial data of the third frame simulated entity based on the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity; wherein, the vertex animation of the first frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the second frame simulated entity, and the vertex animation of the second frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the third frame simulated entity.

[0144] The second determining module 302 is used to input the vertex animation inertial data of the third frame simulated entity, the vertex animation data of the second frame simulated entity, and the vertex animation influencing factor data corresponding to the vertex animation of the third frame simulated entity into a pre-trained correction model, and the pre-trained correction model outputs the vertex animation correction data of the third frame simulated entity; wherein, the vertex animation influencing factor data is used to characterize the factors that affect the dynamic behavior of the simulated entity.

[0145] The generation module 303 is used to generate vertex animation data of the third frame simulated entity based on the vertex animation inertial data and the vertex animation correction data of the third frame simulated entity.

[0146] In some embodiments, the first determining module is further configured to:

[0147] Based on the vertex animation data of the first frame of the simulated entity and the vertex animation data of the second frame of the simulated entity, determine the positional change of the same vertex of the simulated entity in the vertex animation of the first frame of the simulated entity and the vertex animation of the second frame of the simulated entity.

[0148] Based on the vertex animation data of the simulated entity in the second frame and the position change of the same vertex of the simulated entity, the vertex animation inertial data of the simulated entity in the third frame is obtained.

[0149] In some embodiments, the first determining module is further configured to:

[0150] The vertex animation data of the simulated entity in the second frame is multiplied by the corresponding first weight, and the position change of the same vertex of the simulated entity is multiplied by the corresponding second weight and then added together. The resulting weighted sum is the vertex animation inertial data of the simulated entity in the third frame.

[0151] In some embodiments, the apparatus further includes:

[0152] The acquisition module is used to acquire vertex animation data of multiple third-frame simulated entities, vertex animation data of second-frame simulated entities adjacent to the vertex animation of each third-frame simulated entity, and vertex animation data of first-frame simulated entities adjacent to the vertex animation of the second-frame simulated entities.

[0153] Based on the vertex animation data of the second frame simulated entity adjacent to the vertex animation of each third frame simulated entity, and the positional change of the same vertex of the simulated entity in the vertex animation data of each first frame simulated entity and the vertex animation data of each second frame simulated entity, multiple vertex animation prediction data of the third frame simulated entity are generated.

[0154] Minimize the difference between the vertex animation data of each third frame simulated entity and the vertex animation prediction data of the corresponding third frame simulated entity to obtain the first weight corresponding to the vertex animation data of the second frame simulated entity and the second weight of the position change of the same vertex of the simulated entity in the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity.

[0155] In some embodiments, the acquisition module is further configured to:

[0156] A linear model is generated based on the vertex animation data of the second frame simulated entity, the first weight corresponding to the vertex animation data of the second frame simulated entity, the position change of the same vertex of the simulated entity in the vertex animation of the first frame simulated entity and the vertex animation of the second frame simulated entity, the second weight corresponding to the position change of the same vertex of the simulated entity, and the vertex animation data of the third frame simulated entity.

[0157] By fitting the linear model using the least squares method to satisfy preset conditions, the first weight corresponding to the vertex animation data of the second frame simulated entity and the second weight of the position change of the same vertex of the simulated entity in the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity are obtained. The preset condition is that the sum of squared residuals between the vertex animation data of the third frame simulated entity and the corresponding vertex animation prediction data of the third frame simulated entity is minimized.

[0158] In some embodiments, the apparatus further includes:

[0159] The training module is used to acquire the training dataset, which includes multiple training samples and corresponding annotations for each training sample. Each training sample includes vertex animation inertial data of the simulated entity in the third frame, vertex animation data of the simulated entity in the second frame, and vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame. The annotations corresponding to each training sample are the vertex animation data of the actual simulated entity in the third frame.

[0160] The training samples are input into the correction model to be trained, and the correction model to be trained outputs the vertex animation correction data of the simulated entity in the third frame predicted by the training samples.

[0161] The vertex animation correction data of the third frame simulated entity is superimposed on the vertex animation inertial data of the third frame simulated entity to obtain the predicted vertex animation data of the third frame simulated entity.

[0162] Based on the predicted vertex animation data of the simulated entity in the third frame and the actual vertex animation data of the simulated entity in the third frame, the correction model to be trained is trained to obtain a pre-trained correction model.

[0163] In some embodiments, the apparatus further includes:

[0164] The dimensionality reduction module is used to perform dimensionality reduction processing on the training dataset to obtain the dimensionality-reduced data corresponding to the training dataset.

[0165] In some embodiments, the apparatus further includes:

[0166] The splicing module is used to splice the vertex animation inertial data of the third frame simulated entity, the vertex animation data of the second frame simulated entity, and the vertex animation influencing factor data corresponding to the vertex animation of the third frame simulated entity frame by frame to obtain the spliced ​​input data.

[0167] In some embodiments, the apparatus further includes:

[0168] The partitioning module is used to partition the training dataset using a training window of preset length to obtain multiple sets of data windows;

[0169] The modified model to be trained is trained using the training data in each data window to obtain a pre-trained modified model.

[0170] In some embodiments, the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame is at least one of skeletal animation data and environmental parameter data.

[0171] Corresponding to the physical simulation method provided in the embodiments of this application, the embodiments of this application also provide an electronic device. For example... Figure 4 As shown, the electronic device includes: a processor 401; and a memory 402 for storing a program for a physical simulation method. After the electronic device is powered on and the processor runs the program storing the physical simulation method, it performs the following steps:

[0172] Based on the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity, the vertex animation inertia data of the third frame simulated entity is determined; wherein, the vertex animation of the first frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the second frame simulated entity, and the vertex animation of the second frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the third frame simulated entity.

[0173] The vertex animation inertial data of the simulated entity in the third frame, the vertex animation data of the simulated entity in the second frame, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame are input into the pre-trained correction model, and the pre-trained correction model outputs the vertex animation correction data of the simulated entity in the third frame; wherein, the vertex animation influencing factor data is used to characterize the factors that affect the dynamic behavior of the simulated entity.

[0174] Vertex animation data of the third frame simulated entity is generated based on the vertex animation inertial data and the vertex animation correction data of the third frame simulated entity.

[0175] Corresponding to the physical simulation method provided in the embodiments of this application, the embodiments of this application also provide a computer-readable storage medium storing a program for a physical simulation method, which is executed by a processor to perform the following steps:

[0176] Based on the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity, the vertex animation inertia data of the third frame simulated entity is determined; wherein, the vertex animation of the first frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the second frame simulated entity, and the vertex animation of the second frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the third frame simulated entity.

[0177] The vertex animation inertial data of the simulated entity in the third frame, the vertex animation data of the simulated entity in the second frame, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame are input into the pre-trained correction model, and the pre-trained correction model outputs the vertex animation correction data of the simulated entity in the third frame; wherein, the vertex animation influencing factor data is used to characterize the factors that affect the dynamic behavior of the simulated entity.

[0178] Vertex animation data of the third frame simulated entity is generated based on the vertex animation inertial data and the vertex animation correction data of the third frame simulated entity.

[0179] Corresponding to the physical simulation method provided in the embodiments of this application, the embodiments of this application also provide a computer program product, the program product including: a computer program, the computer program being stored in a readable storage medium, at least one processor of an electronic device being able to read the computer program from the readable storage medium, and the at least one processor executing the computer program causing the electronic device to perform the following steps:

[0180] Based on the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity, the vertex animation inertia data of the third frame simulated entity is determined; wherein, the vertex animation of the first frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the second frame simulated entity, and the vertex animation of the second frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the third frame simulated entity.

[0181] The vertex animation inertial data of the simulated entity in the third frame, the vertex animation data of the simulated entity in the second frame, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame are input into the pre-trained correction model, and the pre-trained correction model outputs the vertex animation correction data of the simulated entity in the third frame; wherein, the vertex animation influencing factor data is used to characterize the factors that affect the dynamic behavior of the simulated entity.

[0182] Vertex animation data of the third frame simulated entity is generated based on the vertex animation inertial data and the vertex animation correction data of the third frame simulated entity.

[0183] It should be noted that for a detailed description of the apparatus, electronic device, computer-readable storage medium and computer program product provided in the embodiments of this application, please refer to the relevant description of the method in the embodiments of this application, which will not be repeated here.

[0184] Although this application discloses preferred embodiments as described above, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, the scope of protection of this application should be determined by the scope defined in the claims of this application.

[0185] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.

[0186] The integrated modules implemented as software functional modules described above can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) or a processor to execute some steps of the methods described in the various embodiments of this application.

[0187] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0188] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.

[0189] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0190] The aforementioned storage medium can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.

[0191] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0192] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for physical simulation, characterized in that, The method includes: Based on the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity, the vertex animation inertia data of the third frame simulated entity is determined; wherein, the vertex animation of the first frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the second frame simulated entity, and the vertex animation of the second frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the third frame simulated entity. The vertex animation inertial data of the simulated entity in the third frame, the vertex animation data of the simulated entity in the second frame, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame are input into the pre-trained correction model, and the pre-trained correction model outputs the vertex animation correction data of the simulated entity in the third frame; wherein, the vertex animation influencing factor data is used to characterize the factors that affect the dynamic behavior of the simulated entity. Vertex animation data of the third frame simulated entity is generated based on the vertex animation inertial data and the vertex animation correction data of the third frame simulated entity.

2. The physical simulation method according to claim 1, characterized in that, The determination of vertex animation inertia data for the third frame of the simulated entity based on vertex animation data of the first frame and vertex animation data of the second frame includes: Based on the vertex animation data of the first frame of the simulated entity and the vertex animation data of the second frame of the simulated entity, determine the positional change of the same vertex of the simulated entity in the vertex animation of the first frame of the simulated entity and the vertex animation of the second frame of the simulated entity. Based on the vertex animation data of the simulated entity in the second frame and the position change of the same vertex of the simulated entity, the vertex animation inertial data of the simulated entity in the third frame is obtained.

3. The physical simulation method according to claim 2, characterized in that, The process of obtaining the vertex animation inertia data of the third frame of the simulated entity based on the vertex animation data of the second frame of the simulated entity and the positional change of the same vertices of the simulated entity includes: The vertex animation data of the simulated entity in the second frame is multiplied by the corresponding first weight, and the position change of the same vertex of the simulated entity is multiplied by the corresponding second weight and then added together. The resulting weighted sum is the vertex animation inertial data of the simulated entity in the third frame.

4. The physical simulation method according to claim 3, characterized in that, Before the steps of multiplying the vertex animation data of the simulated entity in the second frame by the corresponding first weight, and multiplying the position change of the same vertex of the simulated entity by the corresponding second weight, and then adding them together, the method further includes: Acquire vertex animation data of multiple third-frame simulated entities, vertex animation data of second-frame simulated entities adjacent to the vertex animation of each third-frame simulated entity, and vertex animation data of first-frame simulated entities adjacent to the vertex animation of the second-frame simulated entities. Based on the vertex animation data of the second frame simulated entity adjacent to the vertex animation of each third frame simulated entity, and the positional change of the same vertex of the simulated entity in the vertex animation data of each first frame simulated entity and the vertex animation data of each second frame simulated entity, multiple vertex animation prediction data of the third frame simulated entity are generated. Minimize the difference between the vertex animation data of each third frame simulated entity and the vertex animation prediction data of the corresponding third frame simulated entity to obtain the first weight corresponding to the vertex animation data of the second frame simulated entity and the second weight of the position change of the same vertex of the simulated entity in the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity.

5. The physical simulation method according to claim 4, characterized in that, Minimizing the difference between the vertex animation data of each third-frame simulated entity and the vertex animation prediction data of the corresponding third-frame simulated entity includes: A linear model is generated based on the vertex animation data of the second frame simulated entity, the first weight corresponding to the vertex animation data of the second frame simulated entity, the position change of the same vertex of the simulated entity in the vertex animation of the first frame simulated entity and the vertex animation of the second frame simulated entity, the second weight corresponding to the position change of the same vertex of the simulated entity, and the vertex animation data of the third frame simulated entity. By fitting the linear model using the least squares method to satisfy preset conditions, the first weight corresponding to the vertex animation data of the second frame simulated entity and the second weight of the position change of the same vertex of the simulated entity in the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity are obtained. The preset condition is that the sum of squared residuals between the vertex animation data of the third frame simulated entity and the corresponding vertex animation prediction data of the third frame simulated entity is minimized.

6. The physical simulation method according to claim 1, characterized in that, Before the step of inputting the vertex animation inertial data of the third frame simulated entity, the vertex animation data of the second frame simulated entity, and the vertex animation influencing factor data corresponding to the vertex animation of the third frame simulated entity into the pre-trained correction model, the method further includes: Obtain a training dataset, which includes multiple training samples and corresponding annotations for each training sample. Each training sample includes vertex animation inertial data of the simulated entity in the third frame, vertex animation data of the simulated entity in the second frame, and vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame. The annotations corresponding to each training sample are the vertex animation data of the simulated entity in the real third frame. The training samples are input into the correction model to be trained, and the correction model to be trained outputs the vertex animation correction data of the simulated entity in the third frame predicted by the training samples. The vertex animation correction data of the third frame simulated entity is superimposed on the vertex animation inertial data of the third frame simulated entity to obtain the predicted vertex animation data of the third frame simulated entity. Based on the predicted vertex animation data of the simulated entity in the third frame and the actual vertex animation data of the simulated entity in the third frame, the correction model to be trained is trained to obtain a pre-trained correction model.

7. The physical simulation method according to claim 6, characterized in that, After obtaining the training dataset, the method further includes: The training dataset is subjected to dimensionality reduction processing to obtain the dimensionality-reduced data corresponding to the training dataset.

8. The physical simulation method according to claim 6, characterized in that, After obtaining the training dataset, the method further includes: The vertex animation inertial data of the simulated entity in the third frame, the vertex animation data of the simulated entity in the second frame, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame are spliced ​​together frame by frame to obtain the spliced ​​input data.

9. The physical simulation method according to claim 6, characterized in that, After obtaining the training dataset, the method further includes: The training dataset is divided into multiple sets of data windows using a training window of a preset length. The modified model to be trained is trained using the training data in each data window to obtain a pre-trained modified model.

10. The physical simulation method according to claim 1, characterized in that, The vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame is at least one of skeletal animation data and environmental parameter data.

11. A device for physical simulation, characterized in that, The device includes: The first determining module is used to determine the vertex animation inertia data of the third frame simulated entity based on the vertex animation data of the first frame simulated entity and the vertex animation data of the second frame simulated entity; wherein, the vertex animation of the first frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the second frame simulated entity, and the vertex animation of the second frame simulated entity is the vertex animation of the previous frame simulated entity adjacent to the vertex animation of the third frame simulated entity. The second determining module is used to input the vertex animation inertial data of the simulated entity in the third frame, the vertex animation data of the simulated entity in the second frame, and the vertex animation influencing factor data corresponding to the vertex animation of the simulated entity in the third frame into a pre-trained correction model, and the pre-trained correction model outputs the vertex animation correction data of the simulated entity in the third frame; wherein, the vertex animation influencing factor data is used to characterize the factors that affect the dynamic behavior of the simulated entity. The generation module is used to generate vertex animation data of the third frame simulated entity based on the vertex animation inertial data and the vertex animation correction data of the third frame simulated entity.

12. An electronic device, characterized in that, include: processor; as well as A memory for storing a data processing program, which, when the electronic device is powered on and runs through the processor, executes the method as described in any one of claims 1-10.

13. A computer-readable storage medium, characterized in that, The system contains a data processing program that is executed by a processor to perform the method as described in any one of claims 1-10.

Citation Information

Patent Citations

  • Virtual clothing prediction method, apparatus and device, and computer readable storage medium

    CN116664733A

  • System and method for simulating hair and cloth using polyhedral-based constraints

    US20110273445A1