Method, device and equipment for motion simulation of rope model and storage medium
By setting virtual joints without pose binding on the rope model and introducing pose constraints, the problem of motion simulation of rope models with fixed ends is solved, and efficient and realistic motion simulation effects are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2026-01-23
- Publication Date
- 2026-06-09
AI Technical Summary
Existing technologies struggle to simulate the motion of rope models that are fixed at both ends, and traditional rigid body mechanics models cannot effectively simulate their motion.
Multiple virtual joints without pose binding are set on the rope model. Through pose prediction and constraint correction, an iterative inter-frame prediction mechanism is adopted to break the hierarchical dependency limitation of skeletal animation, reduce the amount of computation and improve computational efficiency.
It improves the realism and stability of the rope model's motion, reduces the amount of computation and computation time, ensures that the motion conforms to the laws of physics, and enhances the simulation effect.
Smart Images

Figure CN122176129A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device and storage medium for simulating the motion of a rope model. Background Technology
[0002] With the continuous development of science and technology, 3D simulation technology in various fields is increasingly pursuing accuracy and realism in simulating the real world. For example, in the fields of character animation, visual effects, and video generation, there are high requirements for the realism of the simulated 3D models, that is, it is hoped that these 3D models can present motion trajectories that conform to the laws of real physics as much as possible.
[0003] Taking 3D character animation as an example, in order to create more exquisite and realistic character models, creators often overlay certain elements on the character's clothing, and a major category of these elements is rope-type accessories. For example... Figure 1A As shown, rope-type accessories on a character model's clothing typically need to sway in sync with the character's movement to make the animation as vivid as possible. To achieve this effect, it's necessary to perform physical simulations on the rope-type accessories (hereinafter referred to as rope models) to simulate their motion.
[0004] In related technologies, motion simulation of rope models is mostly based on rigid body mechanics models. These methods usually model the rope as a joint chain connecting multiple mass points (also known as rigid body elements), and calculate the torque borne by each joint in motion based on Newtonian mechanics, and then solve the position of each joint in motion stage step by step.
[0005] However, this method can only be used for motion simulation of rope models that are fixed at one end and move freely at the other end. For rope models that are fixed at both ends, this method cannot be effective.
[0006] Therefore, there is an urgent need for a new motion simulation method for rope models to achieve motion simulation for rope models that are fixed at both ends. Summary of the Invention
[0007] This application provides a method, apparatus, device, and storage medium for simulating the motion of a rope model, which can be used to achieve motion simulation of a rope model that is fixed at both ends.
[0008] Firstly, a motion simulation method for a rope model is provided, including: Multiple virtual joints are defined and set on a rope model; wherein, the two ends of the rope model are fixed to the target model; no pose binding relationship is set between any two virtual joints; Pose prediction is performed on a rope model across multiple consecutive animation frames; each prediction includes: Based on the motion description information corresponding to the rope model in the previous animation frame, pose prediction is performed on the multiple virtual joints on the rope model in the current animation frame to obtain an initial prediction result; wherein, the motion description information includes: pose change data of each virtual joint; Based on the pose constraints set for the multiple virtual joints, the initial prediction result is corrected to obtain the target prediction result corresponding to the current animation frame; wherein, the pose constraints are used to constrain the relative pose relationships between the multiple virtual joints. Based on the target prediction result corresponding to the current animation frame, and combined with the target prediction result obtained in the previous animation frame, the motion description information of the rope model in the current animation frame is obtained; wherein, during the initial prediction, both the motion description information and the target prediction result of the previous animation frame use preset data.
[0009] Secondly, a motion simulation device for a rope model is provided, comprising: A determination module is used to determine multiple virtual joints set on a rope model; wherein, the two ends of the rope model are fixed to the target model; and no pose binding relationship is set between any two virtual joints. The prediction module is used to predict the pose of a rope model across multiple consecutive animation frames; each prediction includes: The prediction module is further configured to: perform pose prediction on the multiple virtual joints on the rope model in the current animation frame based on the motion description information corresponding to the rope model in the previous animation frame, and obtain an initial prediction result; wherein, the motion description information includes: pose change data of each virtual joint; The prediction module is further configured to: correct the initial prediction result based on the pose constraints set for the plurality of virtual joints, and obtain the target prediction result corresponding to the current animation frame; wherein, the pose constraints are used to constrain the relative pose relationships between the plurality of virtual joints; The prediction module is further configured to: obtain motion description information of the rope model in the current animation frame based on the target prediction result corresponding to the current animation frame and in combination with the target prediction result obtained in the previous animation frame; wherein, during the initial prediction, both the motion description information and the target prediction result of the previous animation frame use preset data.
[0010] Optionally, each of the virtual joints is provided with a joint identifier for unique identification; the joint identifiers of the multiple virtual joints are set sequentially with one end of the rope model as the starting point. The prediction module is used to correct the initial prediction result based on the pose constraints set for the multiple virtual joints, and to obtain the target prediction result corresponding to the current animation frame. Specifically, it is used for: Based on the position constraints for the multiple virtual joints included in the pose constraints, and combined with the joint identifiers corresponding to each of the multiple virtual joints, the initial prediction result is spatially corrected to obtain the intermediate prediction result corresponding to the current animation frame. Based on the rotational constraints for the multiple virtual joints included in the pose constraints, and combined with the joint identifiers corresponding to each of the multiple virtual joints, the intermediate prediction results are subjected to rotational posture correction to obtain the target prediction results.
[0011] Optionally, the prediction module is used to perform spatial position correction on the initial prediction result based on the position constraints for the plurality of virtual joints included in the pose constraints, combined with the joint identifiers corresponding to each of the plurality of virtual joints, to obtain the intermediate prediction result corresponding to the current animation frame, including: Based on the distance constraint between each pair of adjacent virtual joints in the position constraint conditions, and combined with the joint identifier of each virtual joint, the distance between each pair of adjacent virtual joints is corrected sequentially in the initial prediction result until the correction is completed, and the initial prediction result after distance correction is obtained. Based on the bending constraint conditions between every three consecutive virtual joints in the position constraints, and combined with the joint identifier of each virtual joint, the bending degree of every three consecutive virtual joints is corrected sequentially in the initial prediction result after distance correction, until the correction is completed, and the intermediate prediction result is obtained.
[0012] Optionally, the prediction module, based on the distance constraint between each pair of adjacent virtual joints in the position constraints and in conjunction with the joint identifier of each virtual joint, performs distance correction sequentially on each pair of adjacent virtual joints in the initial prediction result. Specifically, this is done by: Two correction routes are set, starting from the virtual joints at both ends of the rope model and ending at the virtual joints within a preset distance around the midpoint of the rope model. For each correction route, the following operations are performed: Starting from the starting point of the correction route, based on the distance constraints between every two adjacent virtual joints and combined with the previously obtained distance correction results, the distance constraints of every two adjacent virtual joints are solved sequentially; wherein, during the initial distance correction, the previously obtained distance correction results are determined based on the initial prediction results; After solving the distance constraint for each pair of adjacent virtual joints, the distance of the two adjacent virtual joints is corrected based on the distance solution obtained in the initial prediction result.
[0013] Optionally, the prediction module is further configured to: When the number of virtual joints within a preset distance around the midpoint of the rope model is 2, the distance constraint between the two virtual nodes within the preset distance around the midpoint of the rope model is used to solve the distance constraint for the two virtual joints. Based on the obtained distance solution, the distance correction results obtained in the previous time for each of the two virtual joints are corrected in the initial prediction results. When the number of virtual joints within a preset distance around the midpoint of the rope model is 1, the two distance solutions associated with a virtual joint within a preset distance around the midpoint of the rope model are weighted and fused. Based on the fused distance solution, the distance of the virtual joint is corrected in the initial prediction result.
[0014] Optionally, the prediction module is used to perform curvature correction on every three consecutive virtual joints in the initial prediction result after distance correction, based on the bending constraint conditions between every three consecutive virtual joints in the position constraint conditions and in combination with the joint identifier of each virtual joint. Specifically, it is used to: Two correction routes are set, starting from the virtual joints at both ends of the rope model and ending at the virtual joints within a preset distance around the midpoint of the rope model. For each correction route, the following operations are performed: Starting from the beginning of the correction path, based on the bending constraint conditions between every three consecutive virtual joints and combined with the bending correction result obtained in the previous step, the bending constraint is solved sequentially for every three consecutive virtual joints; wherein, during the initial bending correction, the bending correction result obtained in the previous step is determined based on the initial prediction result. After solving the curvature constraint for each of the three consecutive virtual joints, the curvature of the three consecutive virtual joints is corrected based on the obtained curvature solution results in the initial prediction results.
[0015] Optionally, the prediction module is further configured to: When the number of virtual joints within a preset distance around the midpoint of the rope model is 2, the two bending solution results associated with the two virtual nodes within the preset distance around the midpoint of the rope model are weighted and fused. Based on the obtained fused bending solution results, the bending degree of the two virtual joints is corrected in the initial prediction result. When the number of virtual joints within a preset distance around the midpoint of the rope model is 1, the three bending solution results associated with a virtual node within a preset distance around the midpoint of the rope model are weighted and fused. Based on the obtained fused bending solution results, the bending degree of the virtual joint is corrected in the initial prediction result.
[0016] Optionally, when the prediction module performs rotational attitude correction on the intermediate prediction result based on the rotational constraints for the plurality of virtual joints included in the pose constraints, and in conjunction with the joint identifiers corresponding to each of the plurality of virtual joints, it is specifically used for: At least one virtual joint is assigned as a reference joint for each virtual joint; wherein, for each virtual joint and its corresponding reference joint, the following operations are performed: The animation positions generated for the virtual joint and the reference joint using skeletal animation technology are determined, and the direction in which the animation position of the virtual joint points to the animation position of the reference joint is taken as the animation direction. In the intermediate prediction results, determine the physical positions of the virtual joint and the reference joint respectively, and point the physical position of the virtual joint to the direction of the animation physics of the reference joint as the physical direction; Based on the rotational constraints, and combining the animation direction with the physical direction, the virtual joint is subjected to rotational posture correction in the intermediate prediction results.
[0017] Optionally, the prediction module is used to assign at least one virtual joint as a reference joint for each of the virtual joints, including: At least one virtual joint adjacent to the virtual joint is used as the reference joint; or, Obtain the parent joint corresponding to the virtual joint, and use the parent joint as the reference joint; wherein, the parent joint is a virtual joint on the target model.
[0018] Thirdly, a computer program product is provided, including a computer program that, when executed by a processor, implements the method described in the first aspect.
[0019] Fourthly, a computer device is provided, comprising: Memory, used to store computer programs; A processor is configured to invoke a computer program stored in the memory and execute the method described in the first aspect according to the obtained computer program.
[0020] Fifthly, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program for causing a computer to perform the method as described in the first aspect.
[0021] In the motion simulation method for the rope model provided in this application embodiment, by setting multiple virtual joints without pose binding relationships on the rope model, the hierarchical dependency limitation of traditional skeletal animation is broken. The pose prediction of mutually independent virtual joints avoids the motion coupling and error propagation problems caused by the skeletal chain structure. At the same time, since the pose prediction of mutually independent virtual joints does not need to consider the constraints of the upper joints on the lower joints in the chain structure, the amount of computation required for the pose prediction process and the computation time consumed are greatly reduced, thus improving the computational efficiency of pose prediction.
[0022] Furthermore, this method introduces corresponding pose constraints. After the initial prediction based on motion description information, the corresponding pose constraints are used to correct each virtual joint, which significantly improves the realism and stability of the rope model's motion in multiple consecutive animation frames. While ensuring the visual effect of the rope model's motion in the animation frames, it also ensures that the rope model's motion does not violate the laws of physics too much, thus improving the simulation effect of the rope model's motion.
[0023] On the other hand, an iterative inter-frame prediction mechanism is adopted, which uses the prediction result of the current frame as the initial state of the next frame, forming a closed-loop optimization. This ensures the spatiotemporal continuity of the animation sequence and reduces the sensitivity to initial state errors. Attached Figure Description
[0024] Figure 1A This is a schematic diagram illustrating the application of a rope model under related technologies. Figure 1B This application provides a schematic diagram illustrating an application scenario for motion simulation of a rope model. Figure 2 A schematic flowchart illustrating the motion simulation of a rope model provided in an embodiment of this application; Figure 3 A schematic diagram of a rope model provided in an embodiment of this application; Figure 4 This is a schematic diagram of the connection structure of a rope model provided in an embodiment of this application; Figure 5 This is a schematic diagram of the connection structure of another rope model provided in an embodiment of this application; Figure 6 A flowchart illustrating a method for obtaining target prediction results provided in an embodiment of this application; Figure 7A schematic diagram illustrating the principle of obtaining intermediate prediction results according to an embodiment of this application; Figure 8 A schematic diagram illustrating the principle of joint markings on a rope model provided in this application embodiment; Figure 9 A schematic diagram illustrating the principle of a correction route provided in an embodiment of this application; Figure 10 A schematic diagram illustrating the principle of a distance constraint condition provided in an embodiment of this application; Figure 11 A schematic diagram illustrating the sequence of a distance correction process provided in an embodiment of this application; Figure 12 A schematic diagram of a virtual joint on an odd-numbered rope model provided in an embodiment of this application; Figure 13 A schematic diagram of a virtual joint on an even-numbered rope model provided in an embodiment of this application; Figure 14 A schematic diagram illustrating a bending constraint condition between virtual joints provided in an embodiment of this application; Figure 15 A schematic diagram of bending constraint conditions between multiple virtual joints on a rope model provided in this application embodiment; Figure 16 A schematic diagram illustrating the principle of a bending constraint condition provided in an embodiment of this application; Figure 17 A schematic diagram illustrating the sequence of a bending correction process provided in an embodiment of this application; Figure 18 A schematic diagram of a virtual joint on another odd-numbered rope model provided in this application embodiment; Figure 19 A schematic diagram of a virtual joint on another even-numbered rope model provided in this application embodiment; Figure 20 A schematic diagram illustrating the principle of the difference between the animated position and the physical position of the rope model provided in the embodiments of this application; Figure 21 A schematic diagram illustrating the differences between a virtual joint and a reference joint provided in an embodiment of this application; Figure 22 This application provides a schematic diagram of a reference joint selection corresponding to a virtual joint in an embodiment of the present application. Figure 23 This is a schematic diagram of another virtual joint selection corresponding to an embodiment of the present application; Figure 24 A schematic diagram illustrating the principle of motion simulation of a rope model provided in an embodiment of this application; Figure 25A schematic diagram of the structure of a motion simulation device for a rope model provided in an embodiment of this application; Figure 26 A schematic diagram of the structure of another rope model motion simulation device provided in this application embodiment. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0026] The following explanations of some terms used in the embodiments of this application are provided to facilitate understanding by those skilled in the art.
[0027] (1) Skeletal Animation: Skeletal animation is an animation technique that drives the deformation of a model (i.e., skinning) through a hierarchical skeletal structure. Its core lies in constructing a tree-like hierarchical system composed of bones, with the root bone usually located at the model's center of gravity. The transformations of child bones inherit and superimpose the transformation matrices of the parent bones, thereby simulating the linkage effect of biological joints. Animators set parameters such as rotation and translation of bones in keyframes and use interpolation algorithms to generate smooth transitions. Each vertex on the skin can be affected by multiple bones with specific weights (the sum of the weights is 1). The final position of the vertex is dynamically determined by calculating the weighted blending value of the transformation matrices of each bone. This not only eliminates the problem of cracks at joints when the model moves, but also significantly improves the realism of the animation and storage efficiency.
[0028] (2) Bones and joints: Skeleton and joints are the core elements constituting the character animation skeleton system. Joints are the connection points or rotation centers in the skeleton, defining the relative positions and hierarchical relationships between bones, and are usually considered as the origin of the skeletal spatial coordinate system. Bones are considered as line segments or directed line segments connecting two joints, representing the transformation relationship between joints, and their spatial orientation and length are determined by the joints. The entire skeleton is usually organized in a tree-like hierarchical structure with parent-child hierarchical relationships. Transformations of parent joints / bones (such as rotation and translation) will cause all its child joints / bones to move synchronously, thus creating a linkage effect.
[0029] The virtual joint mentioned in the embodiments of this application refers to the joint structure in the skeleton used in three-dimensional simulation.
[0030] (3) The pose of the virtual joint: In the embodiments of this application, the pose of the virtual joint includes position coordinates and rotation coordinates. These two data together are called pose. The physical quantity of pose describes the precise parameters of the position, orientation and scaling state of each joint in the skeleton system relative to a specific reference frame at a specific moment. It defines the instantaneous static posture of the skeleton in space.
[0031] (4) Position-Based Dynamics (PBD): The PBD algorithm is a widely used physics simulation method in computer graphics. Its core idea is to bypass traditional force-based dynamics calculations (i.e., not directly integrating forces to obtain acceleration and velocity), and instead directly define and solve geometric constraints to correct particle positions, thereby simulating physical effects. This method first updates the particle velocity and position based on external forces (such as gravity). Then, it constructs constraint functions (such as distance constraints, volume constraints, or shape matching constraints) to describe the geometric relationships that particles should satisfy. An iterative projection algorithm is used to continuously approximate the constraint satisfaction conditions with the system state, and finally, the corrected positions are used to update the velocity in reverse.
[0032] (5) Quaternion interpolation: Quaternion interpolation is a method for smoothly transitioning between two rotations in a three-dimensional rotational space, widely used in game animation, robot control, and computer graphics. Specifically, quaternion interpolation is a mathematical method for smoothly transitioning attitude points representing rotations on a three-dimensional sphere (S3) composed of unit quaternions. Its core lies in maintaining the constancy of angular velocity and minimizing the path during the interpolation process. The main methods include spherical linear interpolation (Slerp) and spherical quadrilateral interpolation (Squad).
[0033] (6) Star-shaped distribution: A star topology refers to a radial layout in which each node is directly connected to a central node via an independent link.
[0034] It should be noted that the embodiments of this application involve operations such as obtaining motion description information of the previous animation frame and the previous correction result. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0035] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0036] The following is a brief introduction to the application areas of motion simulation of the rope model provided in the embodiments of this application.
[0037] With the continuous development of science and technology, 3D simulation technology in various fields is increasingly pursuing accuracy and realism in simulating the real world. For example, in the fields of character animation, visual effects, and video generation, there are high requirements for the realism of the simulated 3D models, that is, it is hoped that these 3D models can present motion trajectories that conform to the laws of real physics as much as possible.
[0038] Taking 3D character animation as an example, in order to create more exquisite and realistic character models, creators often overlay certain elements on the character's clothing, and a major category of these elements is rope-type accessories. For example... Figure 1A As shown, rope-type accessories on a character model's clothing typically need to sway in sync with the character's movement to make the animation as vivid as possible. To achieve this effect, it's necessary to perform physical simulations on the rope-type accessories (hereinafter referred to as rope models) to simulate their motion.
[0039] In related technologies, motion simulation of rope models is mostly based on rigid body mechanics models. These methods usually model the rope as a joint chain connecting multiple mass points (also known as rigid body elements), and calculate the torque borne by each joint in motion based on Newtonian mechanics, and then solve the position of each joint in motion stage step by step.
[0040] However, this method can only be used for motion simulation of rope models that are fixed at one end and move freely at the other end. For rope models that are fixed at both ends, this method cannot be effective.
[0041] In view of this, embodiments of this application provide a motion simulation method for a rope model, wherein the method proposes: First, multiple virtual joints are defined on the rope model. The two ends of the rope model are fixed to the target model, and no pose binding relationship is set between any two virtual joints. Thus, for the multiple virtual joints on the rope model, there will be no parent-child joints among them, that is, no corresponding bones are set to connect the multiple virtual joints on the rope model.
[0042] Based on this model, when predicting the pose of the rope model across multiple consecutive animation frames, each prediction can perform the following operation: Based on the motion description information corresponding to the rope model in the previous animation frame, pose prediction is performed on multiple virtual joints of the rope model in the current animation frame to obtain an initial prediction result. The motion description information includes the pose change data of each virtual joint. Thus, by using the motion description information corresponding to the previous animation frame to predict the pose of the rope model in the current animation frame, the corresponding initial prediction result can be obtained. This initial prediction result can describe the approximate position of the rope model in the current animation frame, so that the approximate position can be corrected subsequently based on various constraints.
[0043] Next, based on the pose constraints set for multiple virtual joints, the initial prediction results are corrected accordingly to obtain the target prediction results for this animation frame. The pose constraints are used to constrain the relative pose relationships between multiple virtual joints, thereby enabling fine adjustment of the position of each virtual joint to obtain the corresponding target prediction results.
[0044] After obtaining the target prediction result, the motion description information of the rope model in the current animation frame can be obtained based on the target prediction result obtained in the previous animation frame, in order to prepare for the prediction of the next animation frame. In this continuous prediction process, the motion description information and target prediction result of the previous animation frame are both based on preset data during the initial prediction.
[0045] Thus, in the motion simulation method of the rope model provided in this application embodiment, by setting multiple virtual joints without pose binding relationships on the rope model, the hierarchical dependency limitation of traditional skeletal animation is broken. The pose prediction of mutually independent virtual joints avoids the motion coupling and error propagation problems caused by the skeletal chain structure. At the same time, since the pose prediction of mutually independent virtual joints does not need to consider the constraints of the upper joints on the lower joints in the chain structure, the amount of computation required for the pose prediction process and the computation time consumed are greatly reduced, thus improving the computational efficiency of pose prediction.
[0046] Furthermore, this method introduces corresponding pose constraints. After the initial prediction based on motion description information, the corresponding pose constraints are used to correct each virtual joint, which significantly improves the realism and stability of the rope model's motion in multiple consecutive animation frames. While ensuring the visual effect of the rope model's motion in the animation frames, it also ensures that the rope model's motion does not violate the laws of physics too much, thus improving the simulation effect of the rope model's motion.
[0047] On the other hand, an iterative inter-frame prediction mechanism is adopted, which uses the prediction result of the current frame as the initial state of the next frame, forming a closed-loop optimization. This ensures the spatiotemporal continuity of the animation sequence and reduces the sensitivity to initial state errors.
[0048] The following describes the application scenarios of motion simulation for the rope model provided in this application.
[0049] Please refer to Figure 1B This is a schematic diagram illustrating an application scenario for motion simulation of the rope model provided in this application. The application scenario includes a server 101 and a client 102, which can communicate with each other. The communication method can be wired, such as through a network cable or serial cable; or wireless, such as through Bluetooth or Wi-Fi. No specific limitation is imposed.
[0050] Client 102 generally refers to devices capable of displaying multiple consecutive animation frames, receiving operation commands for a target model, etc., such as terminal devices, computer devices, third-party applications accessible by terminal devices or web pages accessible by terminal devices, etc. Server 101 generally refers to devices capable of performing motion simulation of a rope model or maintaining motion simulation of a target model, such as terminal devices or servers, etc. Terminal devices include, but are not limited to, mobile phones, computers, smart medical devices, smart home appliances, vehicle terminals, or aircraft, etc. Servers include, but are not limited to, cloud servers, local servers, or associated third-party servers, etc.
[0051] Both server 101 and client 102 can use cloud computing to reduce the use of local computing resources; similarly, they can also use cloud storage to reduce the use of local storage resources.
[0052] As one embodiment, the server 101 and the client 102 can be the same device, or they can be different devices, or they can be different devices with some modules shared, etc., and there are no specific restrictions.
[0053] It should be noted that, Figure 1BThe server 101 and client 102 shown can each act as the execution subject of the motion simulation method for the rope model provided in this application. For example, the server 101 can run a system capable of performing motion simulation on the rope model. Then, in this system, the motion simulation method for the rope model provided in this application embodiment is executed to perform corresponding pose prediction on the rope model with multiple virtual joints, and obtain the target prediction result of the rope model in each animation frame. In this way, the motion trajectory of the rope model in multiple consecutive animation frames is presented on the display device.
[0054] Before detailing the specific implementation steps of the motion simulation method for the rope model provided in this application, we will first introduce several possible application scenarios of this method.
[0055] The simulation method for the rope model provided in this application is applicable to various fields that require animation playback because it is a motion simulation of the rope model and presents the motion simulation results on multiple consecutive animation frames.
[0056] For example, in the gaming field, when a user interacts with any character model, such as Figure 1A The rope model fixed to the character model shown will swing with the movement of the character model. Therefore, the motion simulation method of the rope model provided in this application embodiment can be used to predict the movement position of the rope model on the character model in real time in each animation frame when the user operates the character model to move, thereby improving the vividness of the character model.
[0057] For example, in the field of 3D animation, when there are rope-type ornaments or rope models fixed at both ends in the animation, the motion simulation method of the rope model provided in the embodiments of this application can be used to calculate the corresponding motion trajectory of the rope model in the animation segment, so that the corresponding motion trajectory of the rope model can be presented more realistically in the animation segment containing the rope model.
[0058] For example, in the field of special effects animation, when it is necessary to add special effects to rope-type objects, the motion simulation method of the rope model provided in the embodiments of this application can also be used to present the motion of the rope model in the special effects segment. In the special effects segment, the motion trajectory of the rope model is calculated, and thus a smoother rope motion is presented in the special effects segment.
[0059] It should be noted that the above description of the application scenarios of the motion simulation method for the rope model of this application is only for illustrative purposes and not for limitation. In practical applications, this application does not limit the specific application scenarios of this method.
[0060] The following is based on Figure 1B This document provides a detailed description of the motion simulation of the rope model provided in the embodiments of this application. Please refer to [link / reference]. Figure 2 This is a schematic flowchart illustrating the motion simulation of a rope model according to an embodiment of this application. It should be noted that, for the motion simulation of the rope model provided in this embodiment, the executing entity can be a computer device, and the specific form of the computer device can be as follows: Figure 1B The application does not restrict the client 102 or server 101 shown.
[0061] like Figure 2 As shown, the specific implementation steps of this method are as follows: S21, determine multiple virtual joints set on the rope model, wherein the two ends of the rope model are fixed on the target model, and no pose binding relationship is set between any two virtual joints.
[0062] In implementing the motion simulation method for the rope model provided in this application embodiment, the first step is to determine the multiple virtual joints set for the rope model. As mentioned earlier, in this application embodiment, virtual joints refer to a core element in skeletal animation technology—the joints at both ends of a skeleton. For skeletal animation technology, once the pose information of the joints at both ends of a skeleton is determined, the pose of the corresponding skeleton can be determined based on these two joints. Therefore, pose prediction is typically performed on the joints in skeletal animation to clarify the pose of the skeleton set for the model.
[0063] In this embodiment, the structure between the bones and virtual joints of the rope model uses a star-shaped connection structure. To clarify the specific application of this connection structure, an example will be provided below: like Figure 3 As shown, suppose there is a character model with a necklace ornament fixed at both ends to the shoulders. This necklace ornament can be modeled with a corresponding rope model. Specifically, the two ends of the rope model are fixed to the shoulders of the character model, which is the target model. Optionally, the two ends of the rope model can be set with two virtual joints, which are the fixing points between the rope model and the character model.
[0064] For this naturally drooping rope model, a series of virtual joints can be set accordingly (in... Figure 3 (with dashed circular markers in the image). These virtual joints are evenly distributed on the rope model and are not subject to any pose binding relationship with each other. That is, no two virtual joints on the rope model are parent and child to each other, and no corresponding skeletons are set between any two virtual joints on the rope model.
[0065] Instead, multiple virtual joints on the rope model can use one or more virtual joints on the target model as their corresponding parent joints to form corresponding skeletal connections.
[0066] like Figure 4 As shown, assuming all virtual joints on the rope model use a virtual joint on the target model as their parent joint, then the connection pattern of the bones corresponding to the rope model is a central star-shaped connection. For example... Figure 5 As shown, assuming that all virtual joints on the rope model take two virtual joints on the target model as their parent joints, then the connection method of the bones corresponding to the rope model is a star-shaped connection with two centers.
[0067] Therefore, for virtual joints on the rope model, there is no pose binding relationship between any two virtual joints. That is, each virtual joint can determine its own relatively independent pose information.
[0068] To distinguish each virtual joint on the rope model, in one possible implementation, each virtual joint on the rope model can be uniquely identified by a joint identifier, and these joint identifiers are sequentially set starting from one end of the rope model. For example... Figure 4 and Figure 5 As shown, regardless of whether these rope models correspond to one parent joint or two parent joints, the setting of their respective joint identifiers is based solely on their order on the rope model. For example, starting from the left end, a number identifier starting from 0 can be set for each virtual joint on the rope model in sequence.
[0069] Thus, after determining the virtual joints on the rope model, pose prediction is needed for the rope model across multiple consecutive animation frames. This process requires predicting the pose information of the rope model in each animation frame. Therefore, the following operations can be performed each time a prediction is made: S22, Based on the motion description information corresponding to the rope model in the previous animation frame, perform pose prediction on multiple virtual joints on the rope model in the current animation frame to obtain initial prediction results; wherein, the motion description information includes: pose change data of each virtual joint.
[0070] For virtual joint pose prediction, in the initial prediction process, the motion description information in the previous animation frame can be used to predict the pose in the current animation frame. The motion description information includes the pose change data of each joint. This pose change data can be the pose information of each virtual joint in the previous animation frame, such as position coordinates, rotation attitude, etc. It can also include the external force information of the rope model in the previous animation frame, such as gravity, wind force, or traction force caused by the movement of the target model, etc.
[0071] Based on this motion description information, the poses of each virtual joint on the rope model in this animation frame can be preliminarily predicted according to the motion trend of the rope model, thus obtaining the initial prediction results.
[0072] For example, in the initial prediction process, an explicit Euler integral can be used to obtain the corresponding initial prediction result, wherein the formula corresponding to the explicit Euler integral is: (Formula 1) in, This indicates the initial prediction result corresponding to this animation frame. This indicates the target prediction result corresponding to the last animation frame. This part represents inertia, in which, That's the speed of the last animation frame. It is the time difference between two frames. This indicates the distance an object will travel in this frame if it maintains a constant linear motion. This part represents the accelerated motion caused by external forces.
[0073] In summary, Formula 1 means that the new position of the rope model in the current animation frame is the sum of its old position in the previous animation frame, the position due to inertial movement, and the displacement caused by external force.
[0074] After confirming the initial prediction results, you can proceed with the following steps: S23, based on the pose constraints set for multiple virtual joints, the initial prediction result is corrected to obtain the target prediction result corresponding to the current animation frame; wherein, the pose constraints are used to constrain the relative pose relationship between multiple virtual joints.
[0075] After confirming the initial prediction results, it is necessary to continue to correct these initial prediction results based on the set pose constraints in order to accurately determine the pose information of the rope model in this animation frame and thus obtain the target prediction results.
[0076] Among them, the pose constraints are set for the relative pose relationships between multiple virtual joints on the rope model. In other words, the relative pose relationships between multiple virtual joints on the rope model need to meet certain conditions, and these conditions are used to determine the precise pose of each virtual joint.
[0077] Optionally, pose constraints may include constraints on the relative positions between virtual joints, such as distance constraints between any two adjacent virtual joints, bending constraints between any three consecutive virtual joints, and collision constraints between virtual joints. On the other hand, pose constraints may also include constraints on the rotational orientations between virtual joints, used to constrain the rotational orientations of different virtual joints.
[0078] After correcting the initial prediction result based on the above pose constraints to obtain the target prediction result, the following operation can be performed: S24. Based on the target prediction result corresponding to this animation frame, and combined with the target prediction result obtained in the previous animation frame, obtain the motion description information of the rope model in this animation frame.
[0079] After determining the target prediction result for this animation frame, the motion description information of the rope model in this animation frame can be obtained based on this target prediction result and the target prediction result obtained in the previous animation frame.
[0080] Taking speed information as an example, after determining the position information of the rope model in the current animation frame, the actual speed reflected in the time period from the previous animation frame to the current animation frame can be determined based on the difference between the position in the current animation frame and the position in the previous animation frame.
[0081] In this way, based on the target prediction results of two animation frames, the motion description information corresponding to the current animation frame can be obtained, so that the prediction of the next animation frame can be based on this information.
[0082] It should be noted that when initially predicting the pose of the rope model, both the motion description information from the previous animation frame and the target prediction result can use preset data to achieve the initial pose prediction. The preset data can be specific values set by the user based on the motion situation; this application does not impose any restrictions on this.
[0083] In the motion simulation method for the rope model provided in this application embodiment, by setting multiple virtual joints without pose binding relationships on the rope model, the hierarchical dependency limitation of traditional skeletal animation is broken. The pose prediction of mutually independent virtual joints avoids the motion coupling and error propagation problems caused by the skeletal chain structure. At the same time, since the pose prediction of mutually independent virtual joints does not need to consider the constraints of the upper joints on the lower joints in the chain structure, the amount of computation required for the pose prediction process and the computation time consumed are greatly reduced, thus improving the computational efficiency of pose prediction.
[0084] Furthermore, this method introduces corresponding pose constraints. After the initial prediction based on motion description information, the corresponding pose constraints are used to correct each virtual joint, which significantly improves the realism and stability of the rope model's motion in multiple consecutive animation frames. While ensuring the visual effect of the rope model's motion in the animation frames, it also ensures that the rope model's motion does not violate the laws of physics too much, thus improving the simulation effect of the rope model's motion.
[0085] On the other hand, an iterative inter-frame prediction mechanism is adopted, which uses the prediction result of the current frame as the initial state of the next frame, forming a closed-loop optimization. This ensures the spatiotemporal continuity of the animation sequence and reduces the sensitivity to initial state errors.
[0086] The overall process of the motion simulation method for the rope model provided in the embodiments of this application has been described above. It should be understood that in the implementation of the above scheme, some possible implementation methods can be further adopted to perform some of the steps. Therefore, these possible implementation methods will be described below.
[0087] In one possible implementation, when performing step S23 above to obtain the target prediction result corresponding to the current animation frame, such as... Figure 6 As shown, the following operations can be performed: S231, based on the position constraints for multiple virtual joints included in the pose constraints, and combined with the joint identifiers corresponding to each of the multiple virtual joints, the initial prediction result is spatially corrected to obtain the intermediate prediction result corresponding to the current animation frame.
[0088] This step uses the position constraints set for spatial position in the pose constraints, combined with the joint identifiers corresponding to each of the multiple virtual joints, to perform corresponding spatial position correction on the initial prediction results, thereby obtaining the intermediate prediction results corresponding to multiple virtual joints in this animation frame in the spatial position part.
[0089] Position constraints can include various levels of constraints to constrain multiple virtual joints. For example, these position constraints may include position (P) constraints on the position of virtual joints, distance (D) constraints on the distance between two virtual joints, bending (B) constraints on the bending degree between three virtual joints, and so on.
[0090] After iteratively solving these constraints, the results can be used as corrections to the initial prediction results, superimposed on them for adjustment, thus obtaining the corresponding intermediate prediction results. For the position constraint, distance constraint, and curvature constraint, the order in which they are solved can be arbitrary. For example, they can be solved in the order of position constraint-distance constraint-curvature constraint, or in the order of distance constraint-position constraint-curvature constraint, etc. This application does not impose any restrictions on this.
[0091] Regarding the solution order within each of these three types of constraints, there can be different solution orders depending on the type of constraint.
[0092] In one possible implementation, the position constraints set for the multiple virtual joints on the rope model are constraints set individually for the position coordinates of each virtual joint. Therefore, each virtual joint can be solved independently. That is, the internal solution order of the position constraints can be set arbitrarily, and this application does not impose any restrictions on this.
[0093] The distance and curvature constraints set for multiple virtual joints on the rope model can be solved and corrected in the following way: On the one hand, regarding distance constraints, since they are constraints set for the distance between every two adjacent virtual joints, the solution for distance constraints can be based on the following method: Based on the distance constraint between each pair of adjacent virtual joints in the position constraint, and combined with the joint identifier of each virtual joint, the distance between each pair of adjacent virtual joints is corrected sequentially in the initial prediction result until the correction is completed, and the initial prediction result after distance correction is obtained.
[0094] On the other hand, regarding the curvature constraint, since it is a constraint condition set between every three consecutive virtual joints, the solution for the curvature constraint can be based on the following method: Based on the bending constraint between every three consecutive virtual joints in the position constraint, and combined with the joint identifier of each virtual joint, the bending degree of every three consecutive virtual joints is corrected sequentially in the initial prediction result after distance correction, until the correction is completed, and intermediate prediction results are obtained.
[0095] In the above process, such as Figure 7 As shown, due to the limitations of the description, the initial prediction result is first corrected for distance, and then the curvature is corrected to obtain the intermediate prediction result. However, as mentioned above, there is no specific order for distance constraints and curvature constraints. In practical applications, the initial prediction result can be corrected for curvature first, and then the distance can be corrected to obtain the intermediate prediction result. The order of these two corrections can be determined based on actual usage requirements, and this application does not impose any restrictions on this.
[0096] Having clarified the execution order of the two steps mentioned above, the specific execution method for each step will be described below. It should be noted that, for clarity, the following description will follow the order of first performing distance correction, then curvature correction.
[0097] First, for distance correction, the execution steps are as follows: based on the distance constraint between each two adjacent virtual joints in the position constraint, combined with the joint identifier of each virtual joint, in the initial prediction result, the distance between each two adjacent virtual joints is corrected in turn until the correction is completed, and the initial prediction result after distance correction is obtained.
[0098] In this process, for each pair of adjacent virtual joints, there is a corresponding distance constraint, which can be used to correct the distance between these two virtual joints. And in the process of correcting the distance for multiple virtual joints, such as... Figure 8 As shown, the correction process can be based on the order of the joint labels of multiple virtual joints on the rope model. Starting from the starting point of the rope, distance correction is performed on each pair of virtual joints in sequence until the correction is completed after processing along the rope model. Then, distance correction can be performed on each virtual joint to obtain the initial prediction result after distance correction.
[0099] In one possible implementation, for a rope model with both ends fixed to the target model, the distance correction for the virtual nodes on the rope model can also be performed in the following way: Two correction routes are set, starting from the virtual joints at both ends of the rope model and ending at virtual joints within a preset distance around the midpoint of the rope model. For example... Figure 9As shown, for a rope model with both ends fixed to the target model, the two corresponding correction routes can be from the left end point to the center point and from the right end point to the center point.
[0100] For each calibration route, distance correction can be performed sequentially based on the joint identifiers of the virtual joints on that calibration route. There is no need to distinguish the order between these two calibration routes.
[0101] Therefore, for each correction route, the following operation can be performed: Starting from the beginning of the correction path, based on the distance constraints between every two adjacent virtual joints and combined with the distance correction results obtained in the previous step, the distance constraints of every two adjacent virtual joints are solved sequentially. Then, in this process, after solving the distance constraints for every two adjacent virtual joints, the distance of the two adjacent virtual joints is corrected in the initial prediction results based on the distance solution results obtained in this step.
[0102] Specifically, during the distance correction process, such as Figure 10 As shown, for each pair of adjacent virtual joints, the corresponding distance constraints can be solved based on their respective distance constraints and the previously obtained distance correction results, and then correction can be performed. During the initial distance correction, the previously obtained distance correction results are determined based on the initial prediction results.
[0103] The process of solving and correcting distance constraints can be carried out using the Gauss-Seidel iterative method. Each time, the distance constraints are solved for a pair of virtual joints, and the pair of virtual joints is corrected immediately after the solution. In this way, after obtaining the distance correction result of the pair of virtual joints, the distance constraints of the next pair of virtual joints are solved and corrected based on the result of the distance correction.
[0104] For example, such as Figure 11 As shown, assuming that on the correction route, the two pairs of virtual joints consisting of the three virtual joints labeled 1, 2, and 3 need to be distance corrected, then firstly, the distance constraint of the (1,2) pair of virtual joints will be solved. After obtaining the distance solution result of the (1,2) pair of virtual joints, the distance of the (1,2) pair of virtual joints will be corrected immediately based on the distance solution result, thus obtaining the distance corrected (1,2') virtual joint. At this time, since the two ends of the rope model are fixed on the target model, the virtual joint labeled 1 will not be subject to the corresponding distance correction.
[0105] Next, the distance constraint of the virtual joint pair (2,3) is solved to obtain the distance solution result of the virtual joint pair (2,3). Since the distance correction of the virtual joint (1,2) was already performed in the previous distance correction process, the data used when solving the distance constraint of the virtual joint pair (2,3) is the distance-corrected data of the virtual joint with joint label 2. Therefore, the distance constraint solution at this time is actually the distance constraint solution of the virtual joint pair (2',3). After obtaining the distance solution result of the virtual joint pair (2',3), the distance of the virtual joint pair (2',3) is immediately corrected based on the distance solution result to obtain the distance-corrected virtual joint (2',3').
[0106] Similarly, for each virtual joint on the correction route, the distance constraints can be solved and corrected sequentially in the manner indicated by the joint identifiers using the methods described above.
[0107] The above are the methods that can be used to perform distance correction on a single correction route. For another correction route on the rope model, the same method can be used to perform distance correction to achieve distance correction on the entire rope model.
[0108] In this approach, the virtual joints on the rope model are divided into two correction routes for corresponding distance correction. Starting from the two endpoints of the rope model fixed on the target model, the distance correction is performed sequentially. This ensures that the motion state of the rope model remains symmetrical within a certain range, avoiding identifiable motion simulation errors. At the same time, the distance correction is performed sequentially based on the order of each virtual node, avoiding the problem of excessive distance correction errors and ensuring the stability of the distance correction process.
[0109] Furthermore, due to the odd or even number of virtual joints on the rope model, the endpoints of the two correction routes on the rope model will differ. To clarify the specific handling of the endpoints of the correction routes when the number of virtual joints is odd and even, the following will introduce these two cases separately.
[0110] In one possible implementation, the concept of a preset distance around the midpoint of the rope model can be defined as: at most two virtual joints on either side of the midpoint that are closest to it. Thus, depending on the number of virtual joints, the preset distance around the midpoint of the rope model can be divided into two cases: one virtual joint and two virtual joints.
[0111] like Figure 12As shown, when the number of virtual joints on the rope model is odd, the number of virtual joints within a preset distance around the midpoint of the rope model is 1. At this time, the joint identifier of the virtual joint on the rope model can be represented as: 0, 12, ..., n, n+1, ..., 2n. Then, the virtual joint within a preset distance around the midpoint of the rope model is the virtual joint with the joint identifier n.
[0112] like Figure 13 As shown, when the number of virtual joints on the rope model is even, the number of virtual joints within a preset distance around the midpoint of the rope model is 2. At this time, the joint identifiers of the virtual joints on the rope model can be represented as: 0, 12, ..., n, -1n, ..., 2n-1. Then, the virtual joints within a preset distance around the midpoint of the rope model are the virtual joints with joint identifier n-1 and the virtual joints with joint identifier n.
[0113] Thus, when the number of virtual joints within a preset distance around the midpoint of the rope model is 1, the correction sequence for the distance correction process of the rope model can be performed as follows: Figure 12 As shown, that is: In a calibration path, these constraints are solved sequentially in the order of (0,1), (1,2),..., (n-2, n-1), and the relevant virtual nodes are calibrated immediately after each constraint is solved.
[0114] In another correction path, these constraints are solved sequentially in the order of (2n, 2n-1), (2n-1, 2n-2), ..., (n+2, n+1), and the relevant virtual nodes are corrected immediately after each constraint is solved.
[0115] Thus, for a virtual joint with joint label n, there are two distance constraints that involve the virtual joint with joint label n, namely: (n-1,n) and (n,n+1).
[0116] Therefore, when performing distance correction on the virtual joint with joint identifier n, the following operation can be performed: The two distance solutions associated with a virtual joint within a preset distance from the midpoint of the rope model are weighted and fused. Based on the fused distance solution, a distance correction is performed on a virtual joint in the initial prediction result.
[0117] Thus, after solving the distance constraints (n-1,n) and (n,n+1) respectively, and obtaining their respective distance solutions, the two distance solutions can be weighted and averaged, and then the distance of the virtual joint with joint label n can be corrected in the initial prediction result.
[0118] Furthermore, while performing distance correction on the virtual joint with joint label n, since the distance solution also includes the distance solution for virtual joints with joint labels n-1 and n+1, after solving the distance constraints (n-1, n) and (n, n+1) respectively, the virtual joints with joint labels n-1 and n+1 can be corrected again based on the obtained distance solution for the virtual joints with joint labels n-1 and n+1, until the final distance correction result for the virtual joints with joint labels n-1 and n+1 is obtained.
[0119] On the other hand, when the number of virtual joints within a preset distance around the midpoint of the rope model is 2, the correction sequence for the distance correction process of the rope model can be performed as follows: Figure 13 As shown, that is: In a calibration path, these constraints are solved sequentially in the order of (0,1), (1,2),..., (n-2, n-1), and the relevant virtual nodes are calibrated immediately after each constraint is solved.
[0120] In another correction path, these constraints are solved sequentially in the order of (2n,2n-1), (2n-1,2n-2),...,(n+1,n), and then the relevant virtual nodes are corrected immediately after each constraint is solved.
[0121] Thus, after completing the distance correction on these two correction routes, there is still a distance constraint between the pair of virtual joints (n-1,n), which has not yet been solved and corrected.
[0122] Therefore, when performing distance correction on virtual joints labeled n-1 and n, the following operation can also be performed: Based on the distance constraint between two virtual nodes within a preset distance around the midpoint of the rope model, the distance constraint of the two virtual joints is solved. Based on the obtained distance solution, the distance correction results of the two virtual joints corresponding to the previous distance correction results are corrected in the initial prediction results.
[0123] Thus, the distance constraint condition between the pair of virtual joints (n-1,n) is solved again. Then, based on the obtained distance solution result, the distance correction result obtained in the previous time for each of the two virtual joints can be corrected in the initial prediction result. In this way, all distance constraint conditions on the rope model are solved and calculated, and the corresponding distance correction is performed, thereby realizing the distance correction of the entire rope model in this animation frame.
[0124] In this approach, based on the parity of the number of virtual joints, the distance correction for virtual joints is divided into two processing methods: odd number and even number. Corresponding processing measures are provided for each type, ensuring that the distance correction processing of all types of rope models can be treated in a matching manner, thereby improving the accuracy of the distance correction process.
[0125] The above describes the distance correction process. In addition to correcting the distance of multiple virtual nodes, it is also necessary to correct their curvature. Therefore, the following will introduce the curvature correction process.
[0126] For curvature correction, the execution steps are as follows: based on the curvature constraint conditions between every three consecutive virtual joints in the position constraint conditions, combined with the joint identifier of each virtual joint, in the initial prediction results after distance correction, the curvature correction is performed on every three consecutive virtual joints in sequence until the correction is completed, and the intermediate prediction results are obtained.
[0127] In this process, a bending constraint condition corresponds to every three consecutive virtual joints. For example... Figure 14 As shown, the bending constraint condition is a constraint on the included angle between the line segments connecting any two adjacent virtual joints in three consecutive virtual joints.
[0128] In the process of correcting the curvature of multiple virtual joints, such as Figure 15 As shown, the correction process can be based on the order of the joint labels of multiple virtual joints on the rope model. Starting from the starting point of the rope, the curvature of each group of virtual joints is corrected sequentially until the correction is completed along the rope model. Then, each virtual joint can be corrected once to obtain the initial prediction result after curvature correction, which is the intermediate prediction result.
[0129] In one possible implementation, for a rope model with both ends fixed to the target model, the curvature correction for the virtual nodes on the rope model can also be performed in the following manner: Two correction routes are set, starting from the virtual joints at both ends of the rope model and ending at the virtual joints within a preset curvature around the midpoint of the rope model. For example... Figure 9 As shown, for a rope model with both ends fixed to the target model, the two corresponding correction routes can be from the left end point to the center point and from the right end point to the center point.
[0130] For each correction route, the curvature can be corrected sequentially based on the joint identifiers of the virtual joints on that correction route. There is no need to distinguish the order between these two correction routes.
[0131] Therefore, for each correction route, the following operation can be performed: Starting from the beginning of the correction path, based on the bending constraint conditions between every three consecutive virtual joints and combined with the bending correction results obtained in the previous step, the bending constraint is solved for every three consecutive virtual joints in sequence. Then, in this process, after solving the bending constraint for every three consecutive virtual joints, the bending correction is performed on the three consecutive virtual joints in the initial prediction results based on the bending solution results obtained in this step.
[0132] Specifically, during the process of performing curvature correction, such as Figure 16 As shown, for every three consecutive virtual joints, the corresponding bending constraint can be solved based on its bending constraint conditions and the previously obtained bending correction result, and then correction can be performed. During the initial bending correction, the previously obtained bending correction result is determined based on the initial prediction result.
[0133] The process of solving and correcting the curvature constraint can also be carried out using the Gauss-Seidel iterative method. Each time, the curvature constraint is solved for a set of virtual joints, and the set of virtual joints is corrected immediately after the solution. In this way, after obtaining the curvature correction result of this set of virtual joints, the curvature constraint is solved and corrected for the next set of virtual joints based on the result of the curvature correction.
[0134] For example, such as Figure 17 As shown, assuming that on the correction path, the two pairs of virtual joints consisting of the three virtual joints labeled 1, 2, 3, and 4 need to bend, then firstly, the bend constraint of the virtual joint group (1,2,3) will be solved. After obtaining the bend solution result of the virtual joint group (1,2,3), the bend of the virtual joint group (1,2,3) will be corrected immediately based on the bend solution result, thus obtaining the bend-corrected virtual joint (1,2',3'). At this time, since the two ends of the rope model are fixed to the target model, the virtual joint labeled 1 will not be corrected accordingly.
[0135] Next, the bending constraint of the virtual joint group (2,3,4) is solved to obtain the bending solution result of the virtual joint group (2,3,4). Since the bending of the virtual joint (1,2,3) has already been corrected in the previous bending correction process, the data used when solving the bending constraint of the virtual joint group (2,3,4) is the bending correction data of the virtual joints with joint labels 2 and 3. Therefore, the bending constraint solution at this time is actually the bending constraint solution of the virtual joint group (2',3',4). After obtaining the bending solution result of the virtual joint group (2',3',4), the bending is immediately corrected based on the bending solution result of the virtual joint group (2',3',4) to obtain the bending corrected virtual joint (2',3',4').
[0136] Similarly, for each virtual joint on the correction path, the curvature constraint can be solved and corrected sequentially in the manner indicated by the joint identifier using the above method.
[0137] The above are the methods that can be used to perform curvature correction on a single correction route. For another correction route on the rope model, the same method can be used to perform curvature correction, so as to achieve curvature correction on the entire rope model.
[0138] In this approach, the virtual joints on the rope model are divided into two correction routes for corresponding curvature correction. Starting from the two endpoints of the rope model fixed to the target model, sequential curvature correction is performed. This first ensures that the motion state of the rope model can maintain symmetry within a certain range, avoiding identifiable motion simulation errors. At the same time, curvature correction is performed sequentially based on the order of each virtual node, avoiding the problem of excessive curvature correction error and ensuring the stability of the curvature correction process.
[0139] Furthermore, due to the odd or even number of virtual joints on the rope model, the endpoints of the two correction routes on the rope model will differ. To clarify the specific handling of the endpoints of the correction routes when the number of virtual joints is odd and even, the following will introduce these two cases separately.
[0140] In one possible implementation, based on the number of virtual joints, the number of virtual joints within a preset distance around a point in the rope model can be divided into two cases: one with a quantity of 1 and two with a quantity of 2. The specific distribution of these two cases can be referenced... Figure 12 and Figure 13 The contents of this application will not be repeated here.
[0141] Thus, when the number of virtual joints within the preset curvature around the midpoint of the rope model is 1, the correction sequence for the curvature correction process of the rope model can be performed as follows: Figure 18 As shown, that is: In a calibration path, these constraints are solved sequentially in the order of (0,1,2), (1,2,3),..., (n-3,n-2,n-1), and the relevant virtual nodes are calibrated immediately after each constraint is solved.
[0142] In another correction path, these constraints are solved sequentially in the order of (2n, 2n-1, 2n-2), (2n-1, 2n-2, 2n-3), ..., (n+3, n+2, n+1), and the relevant virtual nodes are corrected immediately after each constraint is solved.
[0143] Thus, for a virtual joint with joint label n, there are three bending constraints involving the virtual joint with joint label n: (n-2, n-1, n), (n-1, n, n+1), and (n, n+1, n+2).
[0144] Therefore, when correcting the curvature of a virtual joint labeled n, the following operation can be performed: The three bending solutions associated with a virtual node within a preset distance from the midpoint of the rope model are weighted and fused. Based on the fused bending solution, the bending degree of a virtual joint is corrected in the initial prediction result.
[0145] Thus, after solving the three bending constraints (n-2,n-1,n), (n-1,n,n+1), and (n,n+1,n+2) respectively, and obtaining their respective bending solutions, the three bending solutions can be weighted and averaged, and then the bending degree of the virtual joint labeled n can be corrected in the initial prediction results.
[0146] Furthermore, after solving for the bending of these three constraints, three bending results are generated for the virtual joint labeled n, two bending results for the joints labeled n-1 and n+1, and one bending result for the joints labeled n-2 and n+2. After correcting the bending of the virtual joint labeled n, further bending correction can be performed on the virtual joints labeled n-1, n+1, n-2, and n+2. In this process, for virtual joints with two bending results, the bending correction also requires weighted averaging of the two results before applying the bending correction to the corresponding virtual joint.
[0147] On the other hand, when the number of virtual joints within the preset curvature of the midpoint of the rope model is 2, the correction sequence for the curvature correction process of the rope model can be performed as follows: Figure 19 As shown, that is: In a calibration path, these constraints are solved sequentially in the order of (0,1,2), (1,2,3),..., (n-3,n-2,n-1), and the relevant virtual nodes are calibrated immediately after each constraint is solved.
[0148] In another correction path, these constraints are solved sequentially in the order of (2n-1,2n-2,2n-3), (2n-2,2n-3, 2n-4), ...,(n+2,n+1,n), and the relevant virtual nodes are corrected immediately after each constraint is solved.
[0149] Thus, for virtual joints labeled n-1 and n, there are two bending constraints that involve virtual joints labeled n-1 and n, namely: (n-2, n-1, n) and (n-1, n, n+1).
[0150] Therefore, when correcting the curvature of virtual joints labeled n-1 and n, the following operation can also be performed: The two bending solution results associated with two virtual nodes within a preset distance from the midpoint of the rope model are weighted and fused. Based on the obtained fused bending solution results, the bending degree of the two virtual joints is corrected in the initial prediction results.
[0151] Thus, for the two virtual joints labeled n-1 and n, since they are each associated with two bending solution results, these two bending solution results can be weighted and fused. Then, based on the obtained fused bending solution results, the bending degree of the two virtual joints can be corrected in the initial prediction results. This achieves the solution calculation of all bending constraints on the rope model and the corresponding bending degree correction, thereby realizing the bending degree correction of the entire rope model in this animation frame.
[0152] Furthermore, after performing bending solutions for these two constraints, two bending solution results are generated for joints labeled n-1 and n, and one bending solution result for joints labeled n-2 and n+1. After correcting the bending of the virtual joints labeled n-1 and n, the bending can be corrected again based on the bending solution result for the virtual joints labeled n-2 and n+1.
[0153] In this approach, based on the parity of the number of virtual joints, the curvature correction for virtual joints is divided into two processing methods: odd number and even number. Corresponding processing measures are provided for each type, ensuring that the curvature correction processing of all types of rope models can be treated in a matching manner, thereby improving the accuracy of the curvature correction process.
[0154] In the above method, by solving and correcting the distance constraint and the bending constraint separately, the correction processing based on the position constraint is achieved for multiple virtual joints on the rope model, thereby obtaining the corresponding intermediate prediction results. Thus, based on the various constraints included in the position constraint, the initial prediction results are corrected, further improving the accuracy of the physical position represented by the intermediate prediction results.
[0155] The intermediate prediction result represents the precise physical position of each virtual joint in the current animation frame. However, confirming the pose information requires not only determining the physical position of the virtual joints but also their corresponding rotational orientation. Therefore, to obtain the target prediction result, the following operations need to be performed: S232, based on the rotation constraints for multiple virtual joints included in the pose constraints, and combined with the joint identifiers corresponding to each of the multiple virtual joints, the intermediate prediction results are rotated and the target prediction results are obtained.
[0156] This step uses rotation constraints set for rotational posture in pose constraints. Based on these rotation constraints, and combined with the joint identifiers corresponding to each of the multiple virtual joints, the initial prediction results are corrected for rotational posture. This information about rotational posture is then superimposed on the intermediate prediction results to obtain the target prediction results corresponding to the multiple virtual joints in this animation frame.
[0157] In this context, rotational constraints refer to constraints on the rotational orientation between two virtual joints. Unlike positional constraints, the two virtual joints in rotational constraints are not arbitrary constraints between two adjacent virtual joints. Instead, a reference joint is set for each virtual joint, and the orientation of the virtual joint is constrained by the direction between the reference joint and the virtual joint.
[0158] Therefore, in one possible implementation, the process of performing rotational attitude correction on the intermediate prediction results can also be carried out in the following manner: At least one virtual joint is assigned as a reference joint for each virtual joint; thus, for each virtual joint, there will be at least one corresponding virtual joint as a reference joint to correct the rotational attitude of the virtual joint. To clarify the specific implementation of each correction process, the following will use a single virtual joint and its corresponding reference joint as an example to describe the process.
[0159] First, determine the animation positions generated for the virtual joint and the reference joint using skeletal animation technology, and use the direction from the animation position of the virtual joint to the animation position of the reference joint as the animation direction.
[0160] It should be clarified that the motion simulation method for the rope model provided in this application embodiment is a position correction operation based on skeletal animation technology. In this process, such as... Figure 20 As shown, based on the multiple skeletal joints already set on the rope model, skeletal animation technology, starting from the continuity of the animation, first predicts the position information of the rope model in the current animation frame, and then obtains the animation positions of the virtual joints corresponding to each model on the rope model and other models included in the animation frame. Then, the pose prediction method of the rope model provided in this embodiment predicts the position of the rope model in the current animation frame from the perspective of physical motion, and obtains the physical position corresponding to each virtual joint on the rope model.
[0161] Thus, after the intermediate prediction results are obtained, for the rope model, each virtual joint actually corresponds to two positions: the animation position corresponding to the skeletal animation technology and the physical position in the intermediate prediction results.
[0162] Therefore, the following operations can also be performed for these two positions: Determine the animation and physical positions of the reference joints, as well as the animation and physical positions of the virtual joints; Then, as Figure 21 As shown, the direction in which the animation position of the virtual joint points to the animation position of the reference joint is used as the animation direction; the direction in which the physical position of the virtual joint points to the animation physical direction of the reference joint is used as the physical direction.
[0163] Thus, based on rotational constraints and by combining animation direction and physical direction, the rotational posture of virtual joints can be corrected in the intermediate prediction results.
[0164] Specifically, the rotational posture correction process can be performed as follows: based on the obtained animation direction and physical direction, determine the minimum rotation from the animation direction to the physical direction. Since the physical position is calculated based on the various constraints corresponding to each virtual joint on the rope model, this physical position is more physically realistic than the animation position provided by skeletal animation.
[0165] Therefore, in order to present a more physically accurate rope motion in this animation frame, the rotational posture presented by the physical position can be used to correct the rotational posture in the skeletal animation. Thus, it is necessary to determine the minimum rotation from the animation direction to the physical direction as a rotation correction. This rotation correction is then used to correct the rotational posture determined by the skeletal animation technique for the virtual joint, making it similar to the rotational posture presented by the physical position.
[0166] For example, the minimum rotation from the animation direction to the physical direction can be calculated using the function tool in skeletal animation technology: FQuat::FindBetweenVectors(), or other calculation tools can be used, which is not limited in this application.
[0167] In this way, rotational posture correction can be performed based on a virtual joint and its corresponding reference joint, thereby obtaining all the pose information corresponding to the virtual joint.
[0168] The rotational attitude correction operations for other virtual joints can be performed in the same way. In this way, after the rotational attitude correction operations for all virtual joints are completed, the final target prediction result can be obtained.
[0169] In this method, the physical positions of the virtual joints and reference joints obtained from the intermediate prediction results are used to determine the corresponding physical directions. This is used to adjust the rotational posture of the animation positions corresponding to the virtual joints, so that the rotational posture of each virtual joint in the animation frame can better conform to the rotational posture under the physical laws. This ensures that the motion trajectory of the rope model in the animation frame can better conform to the physical laws, thereby improving the realism of the motion simulation of the rope model.
[0170] The above describes the rotational attitude correction process between a virtual joint and a reference joint. The reference joint can be selected in several different ways: In one possible implementation, the selection of a reference joint corresponding to a virtual joint can be done in the following ways: like Figure 22As shown, at least one virtual joint adjacent to a virtual joint in the multiple virtual joints on the rope model is used as the corresponding reference joint.
[0171] Specifically, the selection of adjacent virtual joints can be divided into three different methods. Assuming the virtual joint is the i-th virtual joint on the rope model, then the selection of the reference joint for this i-th virtual joint can be: 1. The (i-1)th virtual joint is used as the reference joint; 2. The (i+1)th virtual joint is used as a reference joint; 3. The (i-1)th virtual joint and the (i+1)th virtual joint are used as reference joints.
[0172] When the (i-1)th virtual joint is selected as the reference joint, the rotational posture of the i-th virtual joint can be corrected based on the rotational correction between the (i-1)th virtual joint and the i-th virtual joint, corresponding to the physical direction, thus obtaining its corresponding pose information. At this point, for a virtual joint with a joint identifier of 0, a virtual joint with a joint identifier of 1 can be selected as its corresponding reference joint.
[0173] When the (i+1)th virtual joint is selected as the reference joint, the rotational posture of the i-th virtual joint can be corrected based on the rotational correction between the (i+1)th virtual joint and the i-th virtual joint, corresponding to the animation direction and physical direction, thus obtaining its corresponding pose information. At this point, for the last virtual joint identified by its joint identifier, the preceding virtual joint can be selected as its corresponding reference joint.
[0174] When the (i-1)th and (i+1)th virtual joints are selected as reference joints, corresponding rotational corrections can be determined based on these two reference joints. Then, using quaternion interpolation, the average value of these two rotational corrections is calculated. Based on this averaged rotational correction, the virtual joint's rotational attitude is corrected to obtain its corresponding pose information. For the (i-1)th or (i+1)th virtual joint that exceeds the range of the rope model, its rotational correction can be set to 0 for subsequent rotational attitude correction.
[0175] The above describes how to use adjacent virtual joints of a virtual joint as reference joints. In addition, reference joints can also be selected in the following ways: like Figure 23 As shown, the parent joint corresponding to the virtual joint is obtained, and the parent joint is used as the reference joint; where the parent joint is a virtual joint on the target model.
[0176] As mentioned earlier, each virtual joint on the rope model corresponds to a parent joint, such as... Figure 4 and Figure 5 As shown, it can be the same virtual joint on the target model or different virtual joints on the target model; this application does not impose any restrictions on this.
[0177] As for the reference joint of the virtual joint, after selecting its own parent joint as the reference joint, the virtual joint can also be rotated and its posture corrected based on the rotational correction between the animation direction and the physical direction between the virtual joint and the parent joint, thereby obtaining its corresponding pose information.
[0178] The above method introduces the selection of reference joints for virtual joints, providing a variety of different reference joint selection methods. This makes the rotational attitude correction of virtual joints in this application more flexible, adaptable to more types of rope models, and improves the applicability of this solution.
[0179] Thus, by combining steps S231 and S232, the initial prediction results are corrected for spatial position and rotational attitude, respectively, thereby obtaining the target prediction results corresponding to each virtual joint in the rope model in this animation frame.
[0180] In this approach, the initial prediction results are double-corrected based on spatial position correction and rotational attitude correction. From the perspective of physical motion laws, the motion trajectory of the rope model presented in the animation frame is corrected, thereby improving the simulation degree and realism of the rope model's motion trajectory in multiple consecutive animation frames.
[0181] The above describes various possible implementation methods for the motion simulation method of the rope model provided in the embodiments of this application. It should be understood that in practical applications, when applying the above-described motion simulation method of the rope model, various possible implementation methods can be combined. To facilitate understanding of the meaning of combined implementation, an example will be used to describe the process below.
[0182] like Figure 24 As shown, in a game application, if a character model jumps after receiving a movement command from the user, a rope-like ornament placed around the character model's neck needs to swing accordingly to enhance the character's liveliness. In the multiple animation frames presented by the game application, the motion simulation of the rope model corresponding to the rope ornament is required. This rope model can be fixed at both ends to the character model's shoulders, forming a rope model with fixed ends.
[0183] On this rope model, multiple virtual joints can be further set. These virtual joints are not linked by pose bindings; instead, a virtual joint is selected on the character model as the parent joint of all the virtual joints, allowing each virtual joint and its parent joint to form their own virtual skeleton. Furthermore, for the multiple virtual joints on the rope model, a corresponding joint identifier can be assigned to each virtual joint sequentially, starting from one end of the rope model, to uniquely distinguish different virtual joints. For example, the virtual joints on the rope model can be identified as virtual joints from 0 to m, where m = 2 when the number of virtual joints is odd. Let m = 2 when the number of virtual joints is even. n-1.
[0184] In this way, each time the position of the rope model in an animation frame is predicted, the following operation can be performed based on the above-mentioned basic content: based on the motion description information of the rope model in the previous animation frame, the pose prediction of multiple virtual joints on the rope model in the current animation frame is performed to obtain the initial prediction result.
[0185] Once the initial prediction result is determined, it can be corrected based on preset pose constraints. These constraints include positional and rotational constraints for the rope model. First, the initial prediction result is corrected based on the positional constraints to obtain intermediate prediction results. Then, the intermediate prediction results are corrected based on the rotational constraints to obtain the target prediction result corresponding to the pose of the rope model in this animation frame.
[0186] In this correction process, the positional constraints include distance constraints and bending constraints. These two constraints are not sequential and can be corrected in any order. However, for each constraint, the correction process for each virtual joint must be carried out in a certain order, that is, starting from both ends of the rope model, corrections are made sequentially towards the vicinity of the midpoint of the rope model, so as to achieve the initial correction of the virtual joints in the entire rope model.
[0187] Then, when correcting based on rotational constraints, a corresponding reference joint is assigned to each virtual joint on the rope model, and the rotational attitude of the virtual joint is corrected by the orientation between the virtual joint and the reference joint.
[0188] In this way, after obtaining the target prediction result for this animation frame, the motion description information of this animation frame can be determined based on the target prediction result of this frame and the target prediction result of the previous frame, providing an information basis for the pose prediction of the next animation frame.
[0189] Based on the same inventive concept, this application provides a motion simulation device for a rope model, capable of realizing the functions of the aforementioned motion simulation method for rope models. Please refer to... Figure 25 The device includes a determining module 251 and a predicting module 252, wherein: The determination module is used to determine multiple virtual joints set on the rope model; wherein, the two ends of the rope model are fixed to the target model; no pose binding relationship is set between any two virtual joints; Prediction module 252 is used to predict the pose of a rope model in multiple consecutive animation frames; wherein each prediction includes: The prediction module 252 is also used to: predict the pose of multiple virtual joints on the rope model in the current animation frame based on the motion description information corresponding to the rope model in the previous animation frame, and obtain an initial prediction result; wherein, the motion description information includes: pose change data of each skeletal joint; The prediction module 252 is also used to: correct the initial prediction result based on the pose constraints set for multiple virtual joints, and obtain the target prediction result corresponding to the current animation frame; wherein, the pose constraints are used to constrain the relative pose relationship between multiple virtual joints. The prediction module 252 is also used to: obtain the motion description information of the rope model in the current animation frame based on the target prediction result corresponding to the current animation frame and the target prediction result obtained in the previous animation frame; wherein, during the initial prediction, the motion description information and target prediction result of the previous animation frame both use preset data.
[0190] Optionally, each virtual joint is assigned a unique joint identifier; the joint identifiers for multiple virtual joints are set sequentially, starting from one end of the rope model. When the prediction module 252 corrects the initial prediction result based on the pose constraints set for multiple virtual joints to obtain the target prediction result corresponding to the current animation frame, it is specifically used for: Based on the position constraints for multiple virtual joints included in the pose constraints, and combined with the joint identifiers corresponding to each of the multiple virtual joints, the initial prediction results are spatially corrected to obtain the intermediate prediction results corresponding to the current animation frame. Based on the rotational constraints for multiple virtual joints included in the pose constraints, and combined with the joint identifiers corresponding to each of the multiple virtual joints, the intermediate prediction results are corrected for rotational orientation to obtain the target prediction results.
[0191] Optionally, the prediction module 252 is used to perform spatial position correction on the initial prediction result based on the position constraints for multiple virtual joints included in the pose constraints, combined with the joint identifiers corresponding to each of the multiple virtual joints, to obtain the intermediate prediction result corresponding to the current animation frame, including: Based on the distance constraint between each pair of adjacent virtual joints in the position constraint, and combined with the joint identifier of each virtual joint, the distance between each pair of adjacent virtual joints is corrected sequentially in the initial prediction result until the correction is completed, and the initial prediction result after distance correction is obtained. Based on the bending constraint between every three consecutive virtual joints in the position constraint, and combined with the joint identifier of each virtual joint, the bending degree of every three consecutive virtual joints is corrected sequentially in the initial prediction result after distance correction, until the correction is completed, and intermediate prediction results are obtained.
[0192] Optionally, the prediction module 252 is used to perform distance correction on each pair of adjacent virtual joints in the initial prediction result based on the distance constraint between each pair of adjacent virtual joints in the position constraint conditions, combined with the joint identifier of each virtual joint. Specifically, it is used for: Two correction routes are set, starting from the virtual joints at both ends of the rope model and ending at the virtual joints within a preset distance around the midpoint of the rope model. For each correction route, the following operations are performed: Starting from the beginning of the correction path, based on the distance constraints between every two adjacent virtual joints and combined with the distance correction results obtained in the previous step, the distance constraints of every two adjacent virtual joints are solved sequentially; where, during the initial distance correction, the distance correction results obtained in the previous step are determined based on the initial prediction results. After solving the distance constraint for each pair of adjacent virtual joints, the distance between the two adjacent virtual joints is corrected in the initial prediction result based on the distance solution obtained in this study.
[0193] Optionally, the prediction module 252 is also used for: When the number of virtual joints within a preset distance around the midpoint of the rope model is 2, the distance constraint between the two virtual nodes within the preset distance around the midpoint of the rope model is used to solve the distance constraint for the two virtual joints. Based on the obtained distance solution, the distance correction results of the two virtual joints are corrected in the initial prediction results. When the number of virtual joints within a preset distance around the midpoint of the rope model is 1, the two distance solutions associated with a virtual joint within a preset distance around the midpoint of the rope model are weighted and fused. Based on the fused distance solution, a distance correction is performed on a virtual joint in the initial prediction result.
[0194] Optionally, the prediction module 252 is used to perform curvature correction on every three consecutive virtual joints in the initial prediction result after distance correction, based on the bending constraint conditions between every three consecutive virtual joints in the position constraint conditions and in combination with the joint identifier of each virtual joint. Specifically, it is used for: Two correction routes are set, starting from the virtual joints at both ends of the rope model and ending at the virtual joints within a preset distance around the midpoint of the rope model. For each correction route, the following operations are performed: Starting from the beginning of the correction path, based on the bending constraint conditions between every three consecutive virtual joints and combined with the bending correction results obtained in the previous step, the bending constraint is solved for every three consecutive virtual joints in sequence; where, in the initial bending correction, the bending correction results obtained in the previous step are determined based on the initial prediction results. After solving the bending constraint for each of the three consecutive virtual joints, the bending correction is performed on the three consecutive virtual joints in the initial prediction results based on the bending solution obtained in this study.
[0195] Optionally, the prediction module 252 is also used for: When the number of virtual joints within a preset distance around the midpoint of the rope model is 2, the two bending solution results associated with the two virtual nodes within a preset distance around the midpoint of the rope model are weighted and fused. Based on the obtained fused bending solution results, the bending degree of the two virtual joints is corrected in the initial prediction results. When the number of virtual joints within a preset distance around the midpoint of the rope model is 1, the three bending solution results associated with a virtual node within a preset distance around the midpoint of the rope model are weighted and fused. Based on the obtained fused bending solution results, the bending degree of a virtual joint is corrected in the initial prediction results.
[0196] Optionally, the prediction module 252 is used to perform rotational attitude correction on the intermediate prediction results based on the rotational constraints for multiple virtual joints included in the pose constraints, combined with the joint identifiers corresponding to each of the multiple virtual joints. Specifically, it is used for: Assign at least one virtual joint as a reference joint for each virtual joint; wherein, for each virtual joint and its corresponding reference joint, perform the following operations: The animation positions generated for the virtual joint and the reference joint using skeletal animation technology are determined, and the direction in which the animation position of the virtual joint points to the animation position of the reference joint is used as the animation direction. In the intermediate prediction results, determine the physical positions of the virtual joints and the reference joints respectively, and point the physical position of the virtual joints to the direction of the animation physics of the reference joints as the physical direction; Based on rotational constraints, and combining animation and physical directions, rotational posture correction is performed on the virtual joints in the intermediate prediction results.
[0197] Optionally, the prediction module 252 is used to assign at least one virtual joint as a reference joint for each virtual joint, including: At least one virtual joint adjacent to the virtual joint is used as a reference joint; or, Obtain the parent joint corresponding to the virtual joint and use the parent joint as the reference joint; where the parent joint is a virtual joint on the target model.
[0198] Please refer to Figure 26 This application provides a computer device 2600, which can be used for computer devices 2600. Figure 1B The client 102 or server 101 in the system. The current and historical versions of the data storage program and the application software corresponding to the data storage program can be installed on the computer device 2600, which includes a processor 2680 and a memory 2620. In some embodiments, the computer device 2600 may include a display unit 2640, which includes a display panel 2641 for displaying a user-interactive interface, etc.
[0199] In one possible embodiment, the display panel 2641 may be configured in the form of a liquid crystal display (LCD) or an organic light-emitting diode (OLED).
[0200] The processor 2680 is used to read a computer program and then execute the methods defined by the computer program. For example, the processor 2680 reads a data storage program or file, thereby running the data storage program on the computer device 2600 and displaying the corresponding interface on the display unit 2640. The processor 2680 may include one or more general-purpose processors, and may also include one or more digital signal processors (DSPs) for performing related operations to implement the technical solutions provided in the embodiments of this application.
[0201] The memory 2620 generally includes main memory and secondary storage. Main memory can be random access memory (RAM), read-only memory (ROM), and cache, etc. Secondary storage can be hard disk, optical disk, USB flash drive, floppy disk, or tape drive, etc. The memory 2620 is used to store computer programs and other data. The computer programs include applications corresponding to each client, and other data may include data generated after the operating system or applications are run, including system data (e.g., operating system configuration parameters) and user data. In this embodiment, the computer program is stored in the memory 2620, and the processor 2680 executes the computer program in the memory 2620 to implement any of the methods described in the preceding figures.
[0202] The aforementioned display unit 2640 is used to receive input digital information, character information, or contact touch operations / non-contact gestures, and to generate signal inputs related to user settings and function control of the computer device 2600. Specifically, in this embodiment, the display unit 2640 may include a display panel 2641. The display panel 2641, for example, is a touch screen, which can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or on the display panel 2641), and drive corresponding connection devices according to a pre-set program.
[0203] In one possible embodiment, the display panel 2641 may include two parts: a touch detection device and a touch controller. The touch detection device detects the touch position of the object being used and detects the signal generated by the touch operation, and transmits the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 2680. It can also receive and execute commands sent by the processor 2680.
[0204] The display panel 2641 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the display unit 2640, in some embodiments, the computer device 2600 may also include an input unit 2630. The input unit 2630 may include an image input device 2631 and other input devices 2632, wherein the other input devices may include, but are not limited to, one or more of the following: a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick.
[0205] In addition to the above, the computer device 2600 may also include a power supply 2690 for powering other modules, an audio circuit 2660, a near-field communication module 2670, and an RF circuit 2610. The computer device 2600 may also include one or more sensors 2650, such as an accelerometer, a light sensor, a pressure sensor, etc. The audio circuit 2660 specifically includes a speaker 2661 and a microphone 2662, etc. For example, the computer device 2600 can use the microphone 2662 to collect the user's voice and perform corresponding operations.
[0206] As one embodiment, the number of processors 2680 can be one or more, and the processors 2680 and memory 2620 can be coupled together or relatively independent.
[0207] As one example, Figure 26 The processor 2680 in the middle can be used to implement, for example Figure 25 The confirmation module 251 and the prediction module 252 are included.
[0208] As one example, Figure 26 The processor 2680 in the document can be used to implement the functions of the server or terminal devices discussed above.
[0209] In some possible implementations, the various aspects of motion simulation of the rope model provided in this application can also be implemented in the form of a computer program product, which includes a computer program that, when run on a computer device, causes the computer device to perform the steps described above in the various exemplary embodiments of this application.
[0210] Computer program products may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, RAM, ROM, erasable programmable read-only memory (EPROM) or flash memory, optical fiber, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0211] Alternatively, if the integrated units of the present invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of software products, for example, through computer program products stored in a storage medium, including computer programs, to cause a computer device to execute all or part of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0212] The computer program product of the embodiments of this application can be a CD-ROM and include a computer program, and can run on a computer device. However, the computer program product of this application is not limited thereto. In this application, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with a command execution system, apparatus, or device.
[0213] Computer programs for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The computer program can execute entirely on a computer device, partially on a computer device, as a standalone software package, partially on a computer device and partially on a remote computer device, or entirely on a remote computer device. In cases involving remote computer devices, the remote computer device can be connected to the computer device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer device (e.g., via the Internet using an Internet service provider).
[0214] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.
[0215] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0216] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0217] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by a computer program. These computer programs can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that instructions executable by the processor of the computer or other programmable data processing apparatus create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.
[0218] These computer programs may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the computer program stored in the computer-readable storage medium produces an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.
[0219] These computer programs may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.
[0220] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A motion simulation method for a rope model, characterized in that, The method includes: Multiple virtual joints are defined and set on a rope model; wherein, the two ends of the rope model are fixed to the target model; no pose binding relationship is set between any two virtual joints; Pose prediction is performed on a rope model across multiple consecutive animation frames; each prediction includes: Based on the motion description information corresponding to the rope model in the previous animation frame, pose prediction is performed on the multiple virtual joints on the rope model in the current animation frame to obtain an initial prediction result; wherein, the motion description information includes: pose change data of each virtual joint; Based on the pose constraints set for the multiple virtual joints, the initial prediction result is corrected to obtain the target prediction result corresponding to the current animation frame; wherein, the pose constraints are used to constrain the relative pose relationships between the multiple virtual joints. Based on the target prediction result corresponding to the current animation frame, and combined with the target prediction result obtained in the previous animation frame, the motion description information of the rope model in the current animation frame is obtained; wherein, during the initial prediction, both the motion description information and the target prediction result of the previous animation frame use preset data.
2. The method as described in claim 1, characterized in that, Each virtual joint is assigned a unique joint identifier; the joint identifiers for each of the multiple virtual joints are sequentially assigned starting from one end of the rope model. The step of correcting the initial prediction result based on the pose constraints set for the multiple virtual joints to obtain the target prediction result corresponding to the current animation frame includes: Based on the position constraints for the multiple virtual joints included in the pose constraints, and combined with the joint identifiers corresponding to each of the multiple virtual joints, the initial prediction result is spatially corrected to obtain the intermediate prediction result corresponding to the current animation frame. Based on the rotational constraints for the multiple virtual joints included in the pose constraints, and combined with the joint identifiers corresponding to each of the multiple virtual joints, the intermediate prediction results are subjected to rotational posture correction to obtain the target prediction results.
3. The method as described in claim 2, characterized in that, The method involves adjusting the spatial position of the initial prediction result based on the position constraints for the multiple virtual joints included in the pose constraints, combined with the joint identifiers corresponding to each of the multiple virtual joints, to obtain the intermediate prediction result corresponding to the current animation frame. This includes: Based on the distance constraint between each pair of adjacent virtual joints in the position constraint conditions, and combined with the joint identifier of each virtual joint, the distance between each pair of adjacent virtual joints is corrected sequentially in the initial prediction result until the correction is completed, and the initial prediction result after distance correction is obtained. Based on the bending constraint conditions between every three consecutive virtual joints in the position constraints, and combined with the joint identifier of each virtual joint, the bending degree of every three consecutive virtual joints is corrected sequentially in the initial prediction result after distance correction, until the correction is completed, and the intermediate prediction result is obtained.
4. The method as described in claim 3, characterized in that, Based on the distance constraint between each pair of adjacent virtual joints in the position constraint conditions, and combined with the joint identifier of each virtual joint, the distance correction is performed sequentially on each pair of adjacent virtual joints in the initial prediction result, including: Two correction routes are set, starting from the virtual joints at both ends of the rope model and ending at the virtual joints within a preset distance around the midpoint of the rope model. For each correction route, the following operations are performed: Starting from the starting point of the correction route, based on the distance constraints between every two adjacent virtual joints and combined with the previously obtained distance correction results, the distance constraints of every two adjacent virtual joints are solved sequentially; wherein, during the initial distance correction, the previously obtained distance correction results are determined based on the initial prediction results; After solving the distance constraint for each pair of adjacent virtual joints, the distance of the two adjacent virtual joints is corrected based on the distance solution obtained in the initial prediction result.
5. The method as described in claim 4, characterized in that, The method further includes: When the number of virtual joints within a preset distance around the midpoint of the rope model is 2, the distance constraint between the two virtual nodes within the preset distance around the midpoint of the rope model is used to solve the distance constraint for the two virtual joints. Based on the obtained distance solution, the distance correction results obtained in the previous time for each of the two virtual joints are corrected in the initial prediction results. When the number of virtual joints within a preset distance around the midpoint of the rope model is 1, the two distance solutions associated with a virtual joint within a preset distance around the midpoint of the rope model are weighted and fused. Based on the fused distance solution, the distance of the virtual joint is corrected in the initial prediction result.
6. The method as described in claim 3, characterized in that, Based on the bending constraint conditions between every three consecutive virtual joints in the position constraint conditions, and combined with the joint identifier of each virtual joint, the bending degree of every three consecutive virtual joints is corrected sequentially in the initial prediction result after distance correction, including: Two correction routes are set, starting from the virtual joints at both ends of the rope model and ending at the virtual joints within a preset distance around the midpoint of the rope model. For each correction route, the following operations are performed: Starting from the beginning of the correction path, based on the bending constraint conditions between every three consecutive virtual joints and combined with the bending correction result obtained in the previous step, the bending constraint is solved sequentially for every three consecutive virtual joints; wherein, during the initial bending correction, the bending correction result obtained in the previous step is determined based on the initial prediction result. After solving the curvature constraint for each of the three consecutive virtual joints, the curvature of the three consecutive virtual joints is corrected based on the obtained curvature solution results in the initial prediction results.
7. The method as described in claim 6, characterized in that, The method further includes: When the number of virtual joints within a preset distance around the midpoint of the rope model is 2, the two bending solution results associated with the two virtual nodes within the preset distance around the midpoint of the rope model are weighted and fused. Based on the obtained fused bending solution results, the bending degree of the two virtual joints is corrected in the initial prediction result. When the number of virtual joints within a preset distance around the midpoint of the rope model is 1, the three bending solution results associated with a virtual node within a preset distance around the midpoint of the rope model are weighted and fused. Based on the obtained fused bending solution results, the bending degree of the virtual joint is corrected in the initial prediction result.
8. The method according to any one of claims 2-7, characterized in that, The rotational posture correction of the intermediate prediction results based on the rotational constraints for the plurality of virtual joints included in the pose constraints, combined with the joint identifiers corresponding to each of the plurality of virtual joints, includes: At least one virtual joint is assigned as a reference joint for each virtual joint; wherein, for each virtual joint and its corresponding reference joint, the following operations are performed: The animation positions generated for the virtual joint and the reference joint using skeletal animation technology are determined, and the direction in which the animation position of the virtual joint points to the animation position of the reference joint is taken as the animation direction. In the intermediate prediction results, determine the physical positions of the virtual joint and the reference joint respectively, and point the physical position of the virtual joint to the direction of the animation physics of the reference joint as the physical direction; Based on the rotational constraints, and combining the animation direction with the physical direction, the virtual joint is subjected to rotational posture correction in the intermediate prediction results.
9. The method as described in claim 8, characterized in that, Assigning at least one virtual joint as a reference joint for each of the virtual joints includes: At least one virtual joint adjacent to the virtual joint is used as the reference joint; or, Obtain the parent joint corresponding to the virtual joint, and use the parent joint as the reference joint; wherein, the parent joint is a virtual joint on the target model.
10. A motion simulation device for a rope model, characterized in that, The device includes: A determination module is used to determine multiple virtual joints set on a rope model; wherein, the two ends of the rope model are fixed to the target model; and no pose binding relationship is set between any two virtual joints. The prediction module is used to predict the pose of a rope model across multiple consecutive animation frames; each prediction includes: The prediction module is further configured to: perform pose prediction on the multiple virtual joints on the rope model in the current animation frame based on the motion description information corresponding to the rope model in the previous animation frame, and obtain an initial prediction result; wherein, the motion description information includes: pose change data of each virtual joint; The prediction module is further configured to: correct the initial prediction result based on the pose constraints set for the plurality of virtual joints, and obtain the target prediction result corresponding to the current animation frame; wherein, the pose constraints are used to constrain the relative pose relationships between the plurality of virtual joints; The prediction module is further configured to: obtain motion description information of the rope model in the current animation frame based on the target prediction result corresponding to the current animation frame and in combination with the target prediction result obtained in the previous animation frame; wherein, during the initial prediction, both the motion description information and the target prediction result of the previous animation frame use preset data.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the method as described in any one of claims 1 to 9.
12. A computer device, characterized in that, include: Memory, used to store computer programs; A processor is configured to invoke a computer program stored in the memory and execute the method as described in any one of claims 1 to 9 according to the obtained computer program.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that causes a computer to perform the method as described in any one of claims 1 to 9.