Cloth simulation method and device, electronic equipment, storage medium and program product
By determining and controlling the bone rotation value of the driving source of the character model, and judging and adjusting the fabric model shape, the problem of collision and interpolation in the bone-based fabric simulation is solved, and the accuracy and authenticity of the simulation are improved.
Patent Information
- Application Number
- CN202411823335.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-08
AI Technical Summary
Skeleton-based fabric simulations have collision interweaving problems in video games, such as character clothing penetrating the skin, especially in key joint parts of the character.
By determining the driving source bone of the character model corresponding to the fabric model and controlling its rotation value, the character model makes a preset posture to determine whether the fabric model and the character model collide and intersperse. If a collision occurs, adjust the shape of the fabric model until it is avoided.
It effectively avoids the collision and interlude between fabric models and character models, and improves the accuracy and authenticity of fabric simulation.
Smart Images

Figure CN119783447A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of cloth simulation, and in particular to a cloth simulation method, device, electronic device, storage medium and program product. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.
[0003] Cloth simulation is an important field in computer graphics, which involves using mathematical models and physical rules to simulate the behavior of cloth under various forces (such as gravity, wind). Cloth simulation has a wide range of applications in games, movies and simulation software.
[0004] Since the performance overhead of cloth simulation based on object mesh is relatively high, bone-based cloth simulation is usually used in video games, especially mobile games, because it has the characteristics of lower performance overhead and faster speed.
[0005] However, in the related art, when cloth simulation is performed based on bones, the cloth model and the character model usually collide and intersect, for example, the character's clothes penetrate the character's skin. Summary of the invention
[0006] In view of this, the purpose of the present disclosure is to provide a cloth simulation method, device, electronic device, storage medium and program product, which at least to a certain extent solve one of the technical problems in the related art.
[0007] Based on the above purpose, the first aspect of the exemplary embodiment of the present disclosure provides a cloth simulation method, including:
[0008] Determine the driving source skeleton of the character model corresponding to the cloth model, and determine the current rotation value of the driving source skeleton;
[0009] Determine a preset posture of the character model, and determine a target center rotation value of the driving source skeleton corresponding to the preset posture;
[0010] Controlling the driving source skeleton to rotate from the current rotation value to the target center rotation value, driving the character model to make the preset posture through the driving source skeleton, and determining whether the cloth model collides or intersects with the character model in the preset posture;
[0011] In response to determining that the cloth model collides and intersects with the character model in the preset posture, the shape of the cloth model when the character model is in the preset posture is adjusted until the cloth model does not collide or intersect with the character model in the preset posture.
[0012] Based on the same inventive concept, the second aspect of the exemplary embodiment of the present disclosure provides a cloth simulation device, comprising:
[0013] A driving source skeleton determination module is configured to determine a driving source skeleton of a character model corresponding to the cloth model, and determine a current rotation value of the driving source skeleton;
[0014] A character model posture determination module is configured to determine a preset posture of the character model and determine a target center rotation value of the driving source skeleton corresponding to the preset posture;
[0015] A collision and interspersion judgment module is configured to control the driving source skeleton to rotate from the current rotation value to the target center rotation value, drive the character model to make the preset posture through the driving source skeleton, and determine whether the cloth model collides and intersperses with the character model in the preset posture;
[0016] The cloth model shape adjustment is configured to adjust the shape of the cloth model when the character model is in the preset posture in response to determining that the cloth model collides and intersects with the character model in the preset posture, until the cloth model does not collide or intersect with the character model in the preset posture.
[0017] Based on the same inventive concept, a third aspect of the exemplary embodiment of the present disclosure provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect is implemented.
[0018] Based on the same inventive concept, a fourth aspect of the exemplary embodiments of the present disclosure provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method described in the first aspect.
[0019] Based on the same inventive concept, a fifth aspect of the exemplary embodiments of the present disclosure provides a computer program product, including computer program instructions. When the computer program instructions are executed on a computer, the computer executes the method described in the first aspect.
[0020] From the above, it can be seen that the cloth simulation method, device, electronic device, storage medium and program product provided by the embodiments of the present disclosure include: determining the driving source skeleton of the character model corresponding to the cloth model, and determining the current rotation value of the driving source skeleton; determining the preset posture of the character model, and determining the target center rotation value corresponding to the driving source skeleton and the preset posture; controlling the driving source skeleton to rotate from the current rotation value to the target center rotation value, driving the character model to make the preset posture through the driving source skeleton, and determining whether the cloth model collides and intersperses with the character model in the preset posture; in response to determining that the cloth model collides and intersperses with the character model in the preset posture, adjusting the shape of the cloth model when the character model is in the preset posture, until the cloth model does not collide or intersperse with the character model in the preset posture. Through the present disclosure, collision and interspersion between the cloth model and the character model are avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1a A schematic diagram of cloth simulation based on an object mesh provided for an exemplary embodiment of the present disclosure;
[0023] Figure 1b A schematic diagram of a skeleton-based cloth simulation provided for an exemplary embodiment of the present disclosure;
[0024] Figure 2 A schematic diagram of an application scenario of a cloth simulation method provided by an exemplary embodiment of the present disclosure;
[0025] Figure 3 A schematic flow chart of a cloth simulation method provided for an exemplary embodiment of the present disclosure;
[0026] Figure 4 A schematic diagram of an animation blueprint node provided for an exemplary embodiment of the present disclosure;
[0027] Figure 5 A schematic diagram of another animation blueprint node provided for an exemplary embodiment of the present disclosure;
[0028] Figure 6 A schematic diagram of a configuration interface of a cloth simulation method provided by an exemplary embodiment of the present disclosure;
[0029] Figure 7A schematic diagram of a rotating cone corresponding to a driving source skeleton provided for an exemplary embodiment of the present disclosure;
[0030] Figure 8 A schematic diagram of a collision body provided for an exemplary embodiment of the present disclosure;
[0031] Fig. 9 A schematic structural diagram of a cloth simulation device provided for an exemplary embodiment of the present disclosure;
[0032] Fig.10 A schematic structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] It is understandable that before using the technical solutions disclosed in the embodiments of this application, the type, scope of use, usage scenarios, etc. of the personal information involved in this application should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0034] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present application according to the prompt message.
[0035] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0036] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation method of the present application. Other methods that meet the relevant laws and regulations may also be applied to the implementation method of the present application.
[0037] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0038] In order to make the purpose, technical solutions and advantages of the present disclosure more clear, the principles and spirit of the present disclosure will be described with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0039] It should be understood herein that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.
[0040] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connecting" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly. The article "one" or "a" before an element does not exclude the existence of multiple such elements.
[0041] The principle and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure.
[0042] As mentioned in the background, cloth simulation is an important field in computer graphics, which involves using mathematical models and physical rules to simulate the behavior of cloth under various forces (such as gravity and wind). Cloth simulation has a wide range of applications in games, movies and simulation software.
[0043] Cloth simulation includes cloth simulation based on object mesh and cloth simulation based on bones. Figure 1a , which demonstrates cloth simulation based on object meshes; see Figure 1b , which demonstrates bone-based cloth simulation.
[0044] Cloth simulation based on object mesh is based on the point information of geometric bodies and has high precision. However, due to the high performance overhead of cloth simulation based on object mesh, bone-based cloth simulation is usually used in electronic games, especially mobile games. It has the characteristics of low performance overhead and fast speed, and can meet the frame rate standard of the game.
[0045] However, in the related art, when cloth simulation is performed based on bones, the cloth model and the character model often collide and intersect, for example, the character's clothing penetrates the character's skin, which usually occurs at the character's key joints, such as shoulders and thighs.
[0046] The inventor of the present disclosure has found that the reason why the cloth model and the character model in the above-mentioned related art often collide and intersect is that the collision accuracy is relatively low when using bone-based physical simulation. Because its collision is based on bones, rather than the shape of the object itself. The collision body is generally constrained on the bones, not distributed on the object itself. Therefore, this mode is very easy to intersect in the cloth simulation of the key joints of the character, such as shoulders and thighs.
[0047] In order to solve the above problems, the present disclosure provides a cloth simulation solution, which specifically includes: determining the driving source skeleton of the character model corresponding to the cloth model, and determining the current rotation value of the driving source skeleton; determining the preset posture of the character model, and determining the target center rotation value corresponding to the driving source skeleton and the preset posture; controlling the driving source skeleton to rotate from the current rotation value to the target center rotation value, driving the character model to make the preset posture through the driving source skeleton, and determining whether the cloth model collides and intersperses with the character model in the preset posture; in response to determining that the cloth model collides and intersperses with the character model in the preset posture, adjusting the shape of the cloth model when the character model is in the preset posture, until the cloth model does not collide or intersperse with the character model in the preset posture. Through the present disclosure, collision and interspersion between the cloth model and the character model are avoided.
[0048] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.
[0049] refer to Figure 2 , which is a schematic diagram of an application scenario of the cloth simulation method provided by an exemplary embodiment of the present disclosure.
[0050] This application scenario includes a terminal device 101, a server 102, and a data storage system 103. The terminal device 101, the server 102, and the data storage system 103 may be connected via a wired or wireless communication network to achieve data interaction.
[0051] The terminal device 101 may be an electronic device with data transmission and multimedia input / output functions close to the user side, including but not limited to a desktop computer, a mobile phone, a mobile computer, a tablet computer, a media player, a smart wearable device, a personal digital assistant (PDA) or other electronic devices capable of realizing the above functions. The electronic device may include a processor and a display screen with a touch input function, the display screen is used to present a graphical user interface, the graphical user interface can display an application interface, and the processor is used to process application data, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0052] Server 102 and data storage system 103 can both be independent physical servers, or a server cluster or distributed system composed of multiple physical servers. They can also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0053] In some exemplary embodiments, the cloth simulation method may be run on the terminal device 101 or the server 102 .
[0054] When the cloth simulation method is run on the server 102, the server 102 is used to provide cloth simulation services to the user of the terminal device 101. The terminal device 101 is installed with a client that communicates with the server 102. The user can pre-construct the preset posture of the character model corresponding to the cloth model and specify the driving source skeleton of the character model corresponding to the cloth model through the client. The server 102 determines the driving source skeleton of the character model corresponding to the cloth model, and determines the current rotation value of the driving source skeleton; determines the preset posture of the character model, and determines the target center rotation value of the driving source skeleton corresponding to the preset posture; controls the driving source skeleton to rotate from the current rotation value to the target center rotation value, drives the character model to make the preset posture through the driving source skeleton, and determines whether the cloth model collides and intersects with the character model in the preset posture; in response to determining that the cloth model collides and intersects with the character model in the preset posture, adjusts the shape of the cloth model when the character model is in the preset posture until the cloth model does not collide or intersect with the character model in the preset posture.
[0055] In the above embodiment, the cloth simulation method is described by taking the case where the cloth simulation method is run on the server 102 as an example, however, the present disclosure is not limited thereto, and in some exemplary embodiments, the cloth simulation method may also be run on the terminal device 101.
[0056] When the cloth simulation method is run on the terminal device 101, the terminal device 110 may include a display screen and a processor. The terminal device 110 is installed with a client, and the user can pre-construct the preset posture of the character model corresponding to the cloth model and specify the driving source skeleton of the character model corresponding to the cloth model through the client. The processor determines the driving source skeleton of the character model corresponding to the cloth model, and determines the current rotation value of the driving source skeleton; determines the preset posture of the character model, and determines the target center rotation value corresponding to the preset posture of the driving source skeleton; controls the driving source skeleton to rotate from the current rotation value to the target center rotation value, drives the character model to make the preset posture through the driving source skeleton, and determines whether the cloth model collides and intersects with the character model in the preset posture; in response to determining that the cloth model collides and intersects with the character model in the preset posture, adjusts the shape of the cloth model when the character model is in the preset posture until the cloth model does not collide and intersect with the character model in the preset posture.
[0057] The data storage system 103 stores preset postures of the character model corresponding to the pre-built cloth model.
[0058] Combine the following Figure 2 The cloth simulation method according to the exemplary embodiment of the present disclosure is described by using the application scenario. It should be noted that the above application scenario is only shown to facilitate understanding of the spirit and principle of the present disclosure, and the embodiments of the present disclosure are not limited in this respect. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.
[0059] refer to Figure 3 , which is a flow chart of a cloth simulation method provided by an exemplary embodiment of the present disclosure.
[0060] The cloth simulation method includes the following steps:
[0061] Step S210: determine the driving source skeleton of the character model corresponding to the cloth model, and determine the current rotation value of the driving source skeleton.
[0062] In this exemplary embodiment, the step of determining the driving source skeleton of the character model corresponding to the cloth model includes:
[0063] A root bone of the character model corresponding to the cloth model, which is closest to the cloth model, is determined as the driving source bone.
[0064] During specific implementation, the character model corresponding to the cloth model refers to the character model wearing the cloth model.
[0065] As an example, the character model has the following requirements: the number of bone chains is sufficient; the number of segments (i.e. the number of bones) in each bone chain is sufficient; the bone positions are evenly distributed, and the skinning drive effect is evenly distributed.
[0066] In specific implementation, there are multiple bones in a skeleton chain or skeleton system. The root bone refers to the bone at the top layer of the skeleton chain or skeleton system. It is usually the starting point of the entire skeleton chain or skeleton system. All other bones will be hierarchically connected and organized based on it. It is the key to controlling the movements and postures of the entire character model.
[0067] As an example, the root bones of the character model are such as the thigh bone, upper arm bone, etc. When the cloth model is a skirt or pants model, the root bone of the character model that is closest to the skirt or pants model is the thigh bone, then the thigh bone is used as the driving source bone.
[0068] In the above exemplary embodiments, the driving source skeleton is determined based on the distance between the skeleton and the cloth model. However, the present disclosure is not limited thereto. In some possible implementations, the driving source skeleton can also be obtained by user-defined selection. Specifically:
[0069] During the specific implementation, the implementation of S210 in Unreal Engine (UE for short) is taken as an example for description.
[0070] refer to Figure 4 , pre-write an animation blueprint node AniPoseController, which can be configured to use which bone as the source bone. Connect the written AniPoseController node to the animation blueprint to get the pose driver and configure the source bone.
[0071] Step S220: determine a preset posture of the character model, and determine a target center rotation value of the driving source skeleton corresponding to the preset posture.
[0072] In this exemplary embodiment, determining the preset posture of the character model includes:
[0073] The preset posture of the pre-built character model is obtained.
[0074] In this exemplary embodiment, the method of constructing the preset posture of the character model includes:
[0075] Determine the movement direction corresponding to the driving source bone;
[0076] The driving source skeleton is rotated by a preset angle along at least one of the movement directions, and the character model is driven by the driving source skeleton to make a gesture, thereby obtaining at least one of the preset gestures.
[0077] In the specific implementation, the driving source bone is taken as an example of the thigh bone, and the movement direction includes lifting the leg forward, lifting the leg to the side, and lifting the leg backward. The preset angle can be 90 degrees, and the preset postures include:
[0078] Lift your legs 90 degrees forward, 90 degrees to the side, 90 degrees backward, etc.
[0079] During specific implementation, the preset posture includes the posture of the character model in extreme postures.
[0080] As a specific example, taking the character model as a thigh, the extreme postures of the thigh when moving are:.
[0081] In this exemplary embodiment, determining the target center rotation value corresponding to the driving source skeleton and the preset posture includes:
[0082] The rotation value of the driving source bone when the character model makes the preset posture is used as the target center rotation value.
[0083] During the specific implementation, the implementation of S220 in Unreal Engine (UE for short) is taken as an example for description.
[0084] refer to Figure 5 , pre-write an animation blueprint node AniPoseManager to store different poses. Configure the pose file AniPoseManager to be used, then read all the poses in it and configure the target center rotation value for each pose.
[0085] refer to Figure 6 The pose creation process can be directly implemented in Unreal Engine (UE) such as Unreal.
[0086] During specific implementation, positions where penetration is likely to occur, such as the front of the left leg, the base, the back of the left leg, the front of the right leg, and the back of the right leg, are all configured.
[0087] Among them, edit directly on the skeleton of the character in UE, and then enter the animation blueprint node AniPoseManager. The postures here are all based on the skeleton of the character.
[0088] As a specific example, the posture creation process can also be implemented in digital content creation software (Digital Content Creation, referred to as DCC) such as Maya.
[0089] Among them, make poses in Maya, put them on different frames, export FBX, import UE, and enter the written animation blueprint node AniPoseManager.
[0090] Among them, the character's posture made in DCC software is imported into UE, and the animation blueprint node AniPoseManager is entered. The postures here are all based on the character's skeleton.
[0091] Step S230, controlling the driving source skeleton to rotate from the current rotation value to the target center rotation value, driving the character model to make the preset posture through the driving source skeleton, and determining whether the cloth model collides or intersects with the character model in the preset posture.
[0092] In this exemplary embodiment, controlling the driving source bone to rotate from the current rotation value to the target center rotation value, driving the character model to make the preset posture through the driving source bone, and determining whether the cloth model collides and intersects with the character model in the preset posture, includes:
[0093] Determining a transition posture between a current posture of the character model and the preset posture based on the current rotation value of the driving source skeleton and the target center rotation value;
[0094] Determining a weight value for each of the transition postures;
[0095] Based on the weight values, determining the displacement value and rotation value of each bone in the character model corresponding to each transition posture;
[0096] Based on the displacement value and rotation value of each bone in the character model corresponding to the transitional posture, driving the character model to make the preset posture;
[0097] When the character model makes the preset gesture, it is determined whether the cloth model collides or intersects with the character model in the preset gesture.
[0098] In this exemplary embodiment, determining the weight value of each transition posture includes:
[0099] Based on a preset linear equation, a weight value of each transition posture is determined.
[0100] In the specific implementation, RBF technology is used to realize the function of using one skeleton as an input source to drive multi-pose interpolation in UE.
[0101] The basic mathematical formula of radial basis function is:
[0102]
[0103] in:
[0104] x is a vector of input variables (in this case, the current rotation values of the bones).
[0105] c i is the center point of RBF, i.e., the posture sample point. in Here n refers to multiple pose sample input sources, and the radial basis function looks for differences between multiple input poses. In this case, it is the target rotation position of the driving skeleton, that is, at which position, the corresponding pose action should be restored to the greatest extent.
[0106] r=||x-ci|| represents the distance between the input point and the center point. In this case, it is the rotation difference between the current rotation value of the driving bone and the previous rotation value of the driving center point of multiple postures.
[0107] Interpolation formula for multiple postures:
[0108] Given multiple posture samples (ci, yi), the RBF interpolation function f(x) can be expressed as:
[0109]
[0110] in:
[0111] N is the sample size.
[0112] wi is the weight coefficient corresponding to each posture.
[0113] It is the radial basis function from the input point x to the sample point ci.
[0114] y i refers to the output transformation, which is the input c i The final form or pose of the output pose in the case, that is, the displacement and rotation values of a batch of bones in UE.
[0115] The weights are solved by linear equations.
[0116] In order to determine the weights wi of different postures, the following linear equations need to be solved:
[0117]
[0118] This is a linear algebra problem, and the solution can be achieved using matrix methods.
[0119] According to the above calculation results, the character's skeleton posture is adjusted in time to achieve a smooth animation transition effect. Here, the Gaussian function is introduced as a mathematical solution for smooth transition.
[0120]
[0121] Where: σ is the scale parameter of the function, which controls the width of the function.
[0122] This can achieve a smooth transition effect when driving the bone rotation and switching between different postures or differences.
[0123] In this exemplary embodiment, determining the weight value of each transition posture includes:
[0124] Taking the driving source skeleton as the origin, constructing a rotating cone corresponding to the driving source skeleton;
[0125] Determining a target interval based on the target center rotation value;
[0126] In response to determining that the driving source bone rotates to the center of the target interval within the rotation cone, determining that the weight value is a first weight value;
[0127] In response to determining that the driving source bone has not rotated to the center of the target interval within the rotation cone, the weight value is determined to be a second weight value.
[0128] refer to Figure 7 , configure the radius of cone 701 to control the overlapping area of the rotation range of the driving source bone and the target range. When the driving source bone rotates to the center of the target range, the corresponding posture weight is 100, and the others are 0. By adjusting the target center rotation values of multiple target postures, you can check the character's cloth interlacing until the effect meets the requirements.
[0129] Step S240: In response to determining that the cloth model collides and intersects with the character model in the preset posture, adjusting the shape of the cloth model when the character model is in the preset posture until the cloth model does not collide or intersect with the character model in the preset posture.
[0130] In this exemplary embodiment, in response to determining that the cloth model collides and intersects with the character model in the preset posture, adjusting the shape of the cloth model when the character model is in the preset posture until the cloth model does not collide and intersect with the character model in the preset posture, includes:
[0131] In response to determining that the cloth model collides and intersects with the character model in the preset posture, the cloth model when the character model is in the preset posture is rotated until the cloth model does not collide or intersect with the character model in the preset posture.
[0132] In specific implementation, for each extreme posture of the character model wearing the cloth model, when the cloth model collides and intersects with the character model in this posture, it is important to adjust the shape of the cloth model in this posture by only adjusting its rotation value, not the displacement, to prevent the stretching of the cloth.
[0133] Through the above exemplary embodiments, before calculating collision and physical effects, the solved cloth model can have a form that does not collide or intersect with the character model for extreme motion states, so that when colliding and adding physical effects, the cloth model will not collide or intersect with the character model.
[0134] In this exemplary embodiment, the method further includes:
[0135] Determine the skeleton chain to which the driving source skeleton belongs;
[0136] Add an input influence curve for the bone chain in question.
[0137] When implementing it, configure the influence curve: In the AniPoseController node, you can add an input influence curve for each bone chain. This curve determines the degree of animation influence on each part of the bone chain. The curve value is set to 0 when it is 1, 1 when it is 0, and a smooth transition line in the middle, with a rapid drop at 0 and a slow smooth transition at 1. This means that the root of the cloth (close to the root of the bone chain) will be fully affected by the bone animation, while the tail of the cloth (far away from the root of the bone chain) will be less affected, thus achieving a more natural and realistic physical effect.
[0138] When implementing it, adjust the curve: You can create a curve resource and then set the points on the curve to adjust the influence curve. For example, you can set the curve to pass through points (0,0.2) and (1,1), so that the radius of the ball on the original chain will be scaled according to the y value of the curve, thereby achieving a radius that changes along the curve.
[0139] In this exemplary embodiment, the method further includes:
[0140] Add a collision body to the cloth model.
[0141] refer to Figure 8 , when implementing it, add collision body 801: To prevent cloth from interpenetrating, you can add collision body 801 to the cloth. In the animation blueprint, select the corresponding Kawaii node (if you are using the KawaiiPhysics plug-in), and then set the collision body 801 under the Details panel. You can choose a sphere, capsule, or plane as the collision body 801, and adjust their size, rotation, and position to fit the collision range of the model.
[0142] When implementing it, adding a collision body requires ensuring that the collision ball can lightly touch the edge of the bone chain collision ball under normal circumstances to prevent interlacing. This is mainly accomplished by the above steps. Here, the purpose is to prevent the input impact response from being slow in the case of rapid movement to increase the collision.
[0143] As can be seen from the above, the cloth simulation method provided by the embodiment of the present disclosure includes: determining a driving source skeleton of a character model corresponding to a cloth model, and determining a current rotation value of the driving source skeleton; determining a preset posture of the character model, and determining a target center rotation value of the driving source skeleton corresponding to the preset posture; controlling the driving source skeleton to rotate from the current rotation value to the target center rotation value, driving the character model to make the preset posture through the driving source skeleton, and determining whether the cloth model collides and intersperses with the character model in the preset posture; in response to determining that the cloth model collides and intersperses with the character model in the preset posture, adjusting the shape of the cloth model when the character model is in the preset posture until the cloth model does not collide or intersect with the character model in the preset posture.
[0144] Through the present disclosure, before calculating collision and physical effects, the solved cloth model can have a form that does not collide or intersect with the character model for extreme motion states, so that when colliding and adding physical effects, the cloth model will not collide or intersect with the character model.
[0145] Specifically, through the present disclosure, the cloth simulation effect requirements of some game projects with high performance overhead are met, that is, the solution can be solved fast enough, without interlacing, and with good physical effects.
[0146] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.
[0147] It should be noted that the above describes some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0148] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a cloth simulation device.
[0149] refer to Fig. 9 , which is a structural schematic diagram of a cloth simulation device provided by an exemplary embodiment of the present disclosure.
[0150] Cloth simulation device, including the following modules:
[0151] The driving source skeleton determining module 910 is configured to determine the driving source skeleton of the character model corresponding to the cloth model, and determine the current rotation value of the driving source skeleton;
[0152] The character model posture determination module 920 is configured to determine a preset posture of the character model and determine a target center rotation value of the driving source skeleton corresponding to the preset posture;
[0153] The collision and interlacing judgment module 930 is configured to control the driving source skeleton to rotate from the current rotation value to the target center rotation value, drive the character model to make the preset posture through the driving source skeleton, and determine whether the cloth model collides and interlaces with the character model in the preset posture;
[0154] The cloth model shape adjustment 940 is configured to adjust the shape of the cloth model when the character model is in the preset posture in response to determining that the cloth model collides or intersects with the character model in the preset posture, until the cloth model does not collide or intersect with the character model in the preset posture.
[0155] In some exemplary embodiments, the driving source bone determination module 910 is specifically configured to:
[0156] A root bone of the character model corresponding to the cloth model, which is closest to the cloth model, is determined as the driving source bone.
[0157] In some exemplary embodiments, the character model posture determination module 920 is specifically configured to:
[0158] The preset posture of the pre-built character model is obtained.
[0159] In some exemplary embodiments, the character model posture determination module 920 is specifically configured to:
[0160] Determine the movement direction corresponding to the driving source bone;
[0161] The driving source skeleton is rotated by a preset angle along at least one of the movement directions, and the character model is driven by the driving source skeleton to make a gesture, thereby obtaining at least one of the preset gestures.
[0162] In some exemplary embodiments, the character model posture determination module 920 is specifically configured to:
[0163] The rotation value of the driving source bone when the character model makes the preset posture is used as the target center rotation value.
[0164] In some exemplary embodiments, the collision and interspersing judgment module 930 is specifically configured to:
[0165] Determining a transition posture between a current posture of the character model and the preset posture based on the current rotation value of the driving source skeleton and the target center rotation value;
[0166] Determining a weight value for each of the transition postures;
[0167] Based on the weight values, determining the displacement value and rotation value of each bone in the character model corresponding to each transition posture;
[0168] Based on the displacement value and rotation value of each bone in the character model corresponding to the transitional posture, driving the character model to make the preset posture;
[0169] When the character model makes the preset gesture, it is determined whether the cloth model collides or intersects with the character model in the preset gesture.
[0170] In some exemplary embodiments, the collision and interspersing judgment module 930 is specifically configured to:
[0171] Based on a preset linear equation, a weight value of each transition posture is determined.
[0172] In some exemplary embodiments, the collision and interspersing judgment module 930 is specifically configured to:
[0173] Taking the driving source skeleton as the origin, constructing a rotating cone corresponding to the driving source skeleton;
[0174] Determining a target interval based on the target center rotation value;
[0175] In response to determining that the driving source bone rotates to the center of the target interval within the rotation cone, determining that the weight value is a first weight value;
[0176] In response to determining that the driving source bone has not rotated to the center of the target interval within the rotation cone, the weight value is determined to be a second weight value.
[0177] In some exemplary embodiments, cloth model shape adjustment 940 is specifically configured as follows:
[0178] In response to determining that the cloth model collides and intersects with the character model in the preset posture, the cloth model when the character model is in the preset posture is rotated until the cloth model does not collide or intersect with the character model in the preset posture.
[0179] In some exemplary embodiments, the cloth simulation device further includes an input influence curve adding module (not shown in the figure), which is configured to:
[0180] Determine the skeleton chain to which the driving source skeleton belongs;
[0181] Add an input influence curve for the bone chain in question.
[0182] In some exemplary embodiments, the cloth simulation device further includes a collision body adding module (not shown in the figure), which is configured to:
[0183] Add a collision body to the cloth model.
[0184] For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0185] The device of the above embodiment is used to implement the corresponding cloth simulation method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0186] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the cloth simulation method described in any of the above embodiments is implemented.
[0187] Fig.10 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0188] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0189] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.
[0190] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0191] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0192] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0193] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.
[0194] The electronic device of the above embodiment is used to implement the corresponding cloth simulation method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0195] The memory 1020 stores machine-readable instructions executable by the processor 1010. When the electronic device is running, the processor 1010 communicates with the memory 1020 via the bus 1030, so that the processor 1010 executes the following instructions when running:
[0196] Determine the driving source skeleton of the character model corresponding to the cloth model, and determine the current rotation value of the driving source skeleton;
[0197] Determine a preset posture of the character model, and determine a target center rotation value of the driving source skeleton corresponding to the preset posture;
[0198] Controlling the driving source skeleton to rotate from the current rotation value to the target center rotation value, driving the character model to make the preset posture through the driving source skeleton, and determining whether the cloth model collides or intersects with the character model in the preset posture;
[0199] In response to determining that the cloth model collides and intersects with the character model in the preset posture, the shape of the cloth model when the character model is in the preset posture is adjusted until the cloth model does not collide or intersect with the character model in the preset posture.
[0200] In a possible implementation, in the instructions executed by the processor 1010, determining the driving source skeleton of the character model corresponding to the cloth model includes:
[0201] A root bone of the character model corresponding to the cloth model, which is closest to the cloth model, is determined as the driving source bone.
[0202] In a possible implementation, in the instructions executed by the processor 1010, determining the preset posture of the character model includes:
[0203] The preset posture of the pre-built character model is obtained.
[0204] In a possible implementation manner, in the instructions executed by the processor 1010, the method for constructing the preset posture of the character model includes:
[0205] Determine the movement direction corresponding to the driving source bone;
[0206] The driving source skeleton is rotated by a preset angle along at least one of the movement directions, and the character model is driven by the driving source skeleton to make a gesture, thereby obtaining at least one of the preset gestures.
[0207] In a possible implementation manner, in the instructions executed by the processor 1010, determining the target center rotation value corresponding to the driving source bone and the preset posture includes:
[0208] The rotation value of the driving source bone when the character model makes the preset posture is used as the target center rotation value.
[0209] In a possible implementation manner, in the instructions executed by the processor 1010, controlling the driving source bone to rotate from the current rotation value to the target center rotation value, driving the character model to make the preset posture through the driving source bone, and determining whether the cloth model collides and intersects with the character model in the preset posture, includes:
[0210] Determining a transition posture between a current posture of the character model and the preset posture based on the current rotation value of the driving source skeleton and the target center rotation value;
[0211] Determining a weight value for each of the transition postures;
[0212] Based on the weight values, determining the displacement value and rotation value of each bone in the character model corresponding to each transition posture;
[0213] Based on the displacement value and rotation value of each bone in the character model corresponding to the transitional posture, driving the character model to make the preset posture;
[0214] When the character model makes the preset gesture, it is determined whether the cloth model collides or intersects with the character model in the preset gesture.
[0215] In a possible implementation manner, in the instruction executed by the processor 1010, determining the weight value of each transition posture includes:
[0216] Based on a preset linear equation, a weight value of each transition posture is determined.
[0217] In a possible implementation manner, in the instruction executed by the processor 1010, determining the weight value of each transition posture includes:
[0218] Taking the driving source skeleton as the origin, constructing a rotating cone corresponding to the driving source skeleton;
[0219] Determining a target interval based on the target center rotation value;
[0220] In response to determining that the driving source bone rotates to the center of the target interval within the rotation cone, determining that the weight value is a first weight value;
[0221] In response to determining that the driving source bone has not rotated to the center of the target interval within the rotation cone, the weight value is determined to be a second weight value.
[0222] In a possible implementation manner, in the instructions executed by the processor 1010, in response to determining that the cloth model collides and intersects with the character model in the preset posture, adjusting the shape of the cloth model when the character model is in the preset posture until the cloth model does not collide or intersect with the character model in the preset posture, includes:
[0223] In response to determining that the cloth model collides and intersects with the character model in the preset posture, the cloth model when the character model is in the preset posture is rotated until the cloth model does not collide or intersect with the character model in the preset posture.
[0224] In a possible implementation manner, in the instruction executed by the processor 1010, the method further includes:
[0225] Determine the skeleton chain to which the driving source skeleton belongs;
[0226] Add an input influence curve for the bone chain in question.
[0227] In a possible implementation manner, in the instruction executed by the processor 1010, the method further includes:
[0228] Add a collision body to the cloth model.
[0229] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the cloth simulation method described in any of the above embodiments.
[0230] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0231] The above-mentioned non-transitory computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)), etc.
[0232] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the cloth simulation method described in any embodiment in the above exemplary method part, and have the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0233] Based on the same inventive concept, corresponding to the cloth simulation method described in any of the above embodiments, the present disclosure further provides a computer program product, which includes computer program instructions. In some embodiments, the computer program instructions can be executed by one or more processors of a computer so that the computer and / or the processor execute the cloth simulation method. Corresponding to the execution subject corresponding to each step in each embodiment of the cloth simulation method, the processor that executes the corresponding step can belong to the corresponding execution subject.
[0234] The computer program product of the above embodiment is used to enable the computer and / or the processor to execute the cloth simulation method described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0235] Those skilled in the art will appreciate that the embodiments of the present disclosure may be implemented as a system, method, or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." In addition, in some embodiments, the present disclosure may also be implemented in the form of a computer program product in one or more computer-readable media, which contains computer-readable program code.
[0236] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive examples) of computer-readable storage media may include, for example: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.
[0237] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0238] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0239] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0240] It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine, and these computer program instructions are executed by a computer or other programmable data processing device to produce a device that implements the functions / operations specified in the boxes in the flowchart and / or block diagram.
[0241] These computer program instructions may also be stored in a computer-readable medium that enables a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable medium produce a product that includes an instruction device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.
[0242] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby enabling the instructions executed on the computer or other programmable device to provide a process for implementing the functions / operations specified in the blocks in the flowchart and / or block diagram.
[0243] In addition, although the operations of the disclosed method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted in the flow chart can be performed in a different order. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be decomposed into multiple steps.
[0244] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0245] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0246] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0247] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.
[0248] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0249] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.
[0250] Although the spirit and principle of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included in the spirit and scope of the attached claims. The scope of the attached claims conforms to the broadest interpretation, thereby including all such modifications and equivalent structures and functions.
Claims
1. A cloth simulation method, characterized in that: include: Determine the driving source skeleton of the character model corresponding to the cloth model, and determine the current rotation value of the driving source skeleton; Determine a preset posture of the character model, and determine a target center rotation value of the driving source skeleton corresponding to the preset posture; Controlling the driving source skeleton to rotate from the current rotation value to the target center rotation value, driving the character model to make the preset posture through the driving source skeleton, and determining whether the cloth model collides or intersects with the character model in the preset posture; In response to determining that the cloth model collides and intersects with the character model in the preset posture, the shape of the cloth model when the character model is in the preset posture is adjusted until the cloth model does not collide or intersect with the character model in the preset posture.
2. The method according to claim 1, characterized in that The step of determining the driving source skeleton of the character model corresponding to the cloth model includes: A root bone of the character model corresponding to the cloth model, which is closest to the cloth model, is determined as the driving source bone.
3. The method according to claim 1, characterized in that The step of determining a preset posture of the character model includes: The preset posture of the pre-built character model is obtained.
4. The method according to claim 3, characterized in that: The method for constructing the preset posture of the role model includes: Determine the movement direction corresponding to the driving source bone; The driving source skeleton is rotated by a preset angle along at least one of the movement directions, and the character model is driven by the driving source skeleton to make a gesture, thereby obtaining at least one of the preset gestures.
5. The method according to claim 4, characterized in that The determining of the target center rotation value corresponding to the driving source skeleton and the preset posture includes: The rotation value of the driving source bone when the character model makes the preset posture is used as the target center rotation value.
6. The method according to claim 1, characterized in that The step of controlling the driving source skeleton to rotate from the current rotation value to the target center rotation value, driving the character model to make the preset posture through the driving source skeleton, and determining whether the cloth model collides or intersects with the character model in the preset posture includes: Determining a transition posture between a current posture of the character model and the preset posture based on the current rotation value of the driving source skeleton and the target center rotation value; Determining a weight value for each of the transition postures; Based on the weight values, determining the displacement value and rotation value of each bone in the character model corresponding to each transition posture; Based on the displacement value and rotation value of each bone in the character model corresponding to the transitional posture, driving the character model to make the preset posture; When the character model makes the preset gesture, it is determined whether the cloth model collides or intersects with the character model in the preset gesture.
7. The method according to claim 6, characterized in that Determining the weight value of each transition posture includes: Based on a preset linear equation, a weight value of each transition posture is determined.
8. The method according to claim 6, characterized in that Determining the weight value of each transition posture includes: Taking the driving source skeleton as the origin, constructing a rotating cone corresponding to the driving source skeleton; Determining a target interval based on the target center rotation value; In response to determining that the driving source bone rotates to the center of the target interval within the rotation cone, determining that the weight value is a first weight value; In response to determining that the driving source bone has not rotated to the center of the target interval within the rotation cone, the weight value is determined to be a second weight value.
9. The method according to claim 8, characterized in that In response to determining that the cloth model collides and intersects with the character model in the preset posture, adjusting the shape of the cloth model when the character model is in the preset posture until the cloth model does not collide or intersect with the character model in the preset posture, comprises: In response to determining that the cloth model collides and intersects with the character model in the preset posture, the cloth model when the character model is in the preset posture is rotated until the cloth model does not collide or intersect with the character model in the preset posture.
10. The method according to claim 1, characterized in that The method further comprises: Determine the skeleton chain to which the driving source skeleton belongs; Add an input influence curve for the bone chain in question.
11. The method according to claim 1, characterized in that: The method further comprises: Add a collision volume to the cloth model.
12. A cloth simulation device, characterized in that: include: A driving source skeleton determination module is configured to determine a driving source skeleton of a character model corresponding to the cloth model, and determine a current rotation value of the driving source skeleton; A character model posture determination module is configured to determine a preset posture of the character model and determine a target center rotation value of the driving source skeleton corresponding to the preset posture; A collision and interspersion judgment module is configured to control the driving source skeleton to rotate from the current rotation value to the target center rotation value, drive the character model to make the preset posture through the driving source skeleton, and determine whether the cloth model collides and intersperses with the character model in the preset posture; The cloth model shape adjustment is configured to adjust the shape of the cloth model when the character model is in the preset posture in response to determining that the cloth model collides and intersects with the character model in the preset posture, until the cloth model does not collide or intersect with the character model in the preset posture.
13. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 11 is implemented.
14. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 11.
15. A computer program product, characterized in that The method comprises computer program instructions, and when the computer program instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Three-dimensional virtual object swinging method and device, storage medium and computer equipment
CN108961365A
Cloth calculation method and equipment for clothing model and storage medium
CN114758213A
Real-time action method and device for synchronously driving character animation and physical interaction
CN116883560A
Virtual character posture editing method and device, equipment and storage medium
CN116943195A
Method of determining action redirection data for clavicular joint and related device
CN118521686A