CN106204697B - A kind of cloth tearing dynamic simulator system - Google Patents

A kind of cloth tearing dynamic simulator system Download PDF

Info

Publication number
CN106204697B
CN106204697B CN201610552819.8A CN201610552819A CN106204697B CN 106204697 B CN106204697 B CN 106204697B CN 201610552819 A CN201610552819 A CN 201610552819A CN 106204697 B CN106204697 B CN 106204697B
Authority
CN
China
Prior art keywords
cloth
model
rigid body
vertex
point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610552819.8A
Other languages
Chinese (zh)
Other versions
CN106204697A (en
Inventor
唐勇
张豆
刘宇涵
安阳阳
张金钟
严凯丽
李梦琪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yanshan University
Original Assignee
Yanshan University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yanshan University filed Critical Yanshan University
Priority to CN201610552819.8A priority Critical patent/CN106204697B/en
Publication of CN106204697A publication Critical patent/CN106204697A/en
Application granted granted Critical
Publication of CN106204697B publication Critical patent/CN106204697B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The present invention relates to a kind of clothes to tear dynamic simulator system, and the system establishes fabric model using Mass-spring Model, and cloth is made to be decomposed into the tearing that multiple tri patch complete cloth.Be added Half-edge data structure simultaneously in modeling, the position on storage cloth vertex, while with the relationship on vertex and while length and face and vertex relationship and face syntople relevant information.A kind of bounding box distance field based on Euclidean distance is created, for completing collision detection, improves the efficiency of cloth tearing simulation.It creates steel body model and adds acceleration of gravity to rigid body or cloth, rigid body and cloth is made to complete to collide and generate tearing.It the composite can be widely applied to manufacture and design and the cloth Dynamic Simulation in video display amusement.

Description

Cloth tearing dynamic simulation system
Technical Field
The invention relates to the field of computer cloth simulation, in particular to a system for simulating collision between cloth made of different materials and a rigid body.
Background
The real and fast cloth simulation animation technology is a hot point in the field of computer graphics in recent years. The cloth animation simulation is an important component of computer animation, and the animation generated by simulating cloth has great application value in the aspects of design and manufacture, movie and television entertainment and the like.
In real life, the cloth is often subjected to forces in various directions to generate deformation in different states, meanwhile, collision with a rigid body is inevitable, the cloth is a flexible object which is easy to tear, and due to the characteristic of nonlinear change of cloth-like flexible fabrics, simulation of the cloth becomes a great research hotspot and difficulty point of computer graphics.
The times are advancing, the demands of people on the cloth are continuously increased, a novel cloth is generated by four aspects of research and development, design, manufacture and market, finished products are required to be tested and researched for countless times in a lengthy research and development process, a large amount of manpower and material resources are consumed, the form of the new cloth can be quickly presented in a computer through cloth simulation, the quality of the cloth is tested by utilizing the tearing effect generated by collision of the cloth and a regular or irregular rigid body, and the waste of time and raw materials in the research and development process is greatly reduced by using a virtual system.
As early as 1986, AT & T bell laboratories first proposed that a computer could be used to simulate three-dimensional animation of cloth, based on the soft and pliable nature of the cloth. Subsequently, in 1997, the french national information and automation institute, Provot et al, proposed a curvature surface collision detection method based on the triangle normal vector addition principle in the collision simulation of cloth and objects. In 2014, Lu Jia and Zheng Chao put forward a NURBS-based continuum modeling method to simulate cloth, and the defect of a mass point spring model in accurately reproducing the mechanical behavior of a fabric material is overcome. The tearing process of the cloth is caused by the fact that the wires in the cloth are infinitely stretched until the wires break, and the spring in the mass spring model can approximately simulate the property. Therefore, the cloth model is built by utilizing the mass point spring model, so that the cloth can be randomly subjected to form change, and the simulation of the cloth tearing effect is realized more truly.
In the current cloth simulation system, the tearing of the cloth made of various materials is not dynamically shown. Therefore, we propose a new cloth tearing dynamic simulation system.
Disclosure of Invention
The invention aims to provide a cloth tearing dynamic simulation system capable of dynamically displaying the tearing process when cloth collides with a rigid body in real time and generating a simulation animation when the cloth collides with the rigid body
In order to realize the purpose, the following technical scheme is adopted: the system comprises a cloth modeling unit, an information acquisition unit, an optimized cloth model unit, a collision detection unit and a cloth tearing unit;
the cloth modeling unit is used for establishing a cloth model comprising a mass point spring model triangular mesh;
the information acquisition unit acquires and stores the position of a vertex of the cloth model, the relation between an edge and the vertex, the relation between the length of the edge and a surface and the vertex, and the adjacent relation of the surface, and establishes a Half-edge data structure by using the information;
the optimized cloth model unit is used for adding texture maps to the original cloth model, changing illumination parameters and adjusting cloth attributes to complete cloth simulation of specific materials;
the collision detection unit is used for creating a distance field, setting a distance condition of collision response, and detecting the distance between a point of the cloth and the rigid body and a surface at any moment;
the cloth tearing unit is used for controlling the movement of the rigid body or the movement of the cloth, so that the cloth collides with the rigid body and is torn;
the specific simulation process of the system is as follows:
step 1, establishing a cloth model by using a mass point spring model, and decomposing the cloth into a plurality of triangular patches to tear the cloth; adding a Half-edge data structure while modeling, and storing related information of the position of a cloth vertex, the relation between an edge and the vertex, the relation between the length of the edge and a surface and the vertex, and the adjacent relation of the surfaces; determining the size, fineness and texture mapping of the grid;
step 2, adjusting the attributes of the cloth model, wherein the attributes comprise the binding Stiffness of the cloth, the stretching capacity of the cloth, the Damping coefficient of the cloth and the surface Thickness of the cloth, and the simulation of the cloth of a certain material is achieved by adjusting the parameter values of the attributes to complete the simulation of the material of the cloth;
step 3, if the cloth collides with the regular rigid body, no gravity attribute is added to the cloth, and the cloth is fixedly suspended or horizontal; if the cloth collides with an irregular object, the cloth is horizontally placed by adding the gravity property;
step 4, creating a rigid body, and if the rigid body is a regular rigid body, adding gravity acceleration to the rigid body; if the rigid body is irregular, fixing the rigid body into the interface;
step 5, adjusting x, y and z three-dimensional coordinates of the rigid body and the cloth to enable the cloth and the rigid body to be torn;
and 6, establishing a bounding box distance field calculation algorithm based on Euclidean distance to determine and plan a collision range, carrying out collision detection on the cloth and the rigid body by the distance field, and starting collision response to complete tearing simulation when a collision condition is reached.
Further, in the cloth model in step 1, a triangular mesh is used as a geometric carrier of the cloth, mesh vertices are defined as mass points, and mesh edges are defined as structural springs.
Further, in the modeling process of the step 1, distance constraint is added by using a momentum and angular momentum conservation method to constrain the stretching distance range of the cloth; adding collision constraint by using an angle method of solving two adjacent peaks of the cloth, and detecting the collision between the cloth and the object; and solving the position and the speed of the top point of the cloth by adopting a Gauss-Seidel iteration method to complete the establishment of the model of the cloth.
Further, in the step 1, optimizing the model after modeling, introducing a nonlinear spring to solve the super-elasticity phenomenon, replacing engineering strain with Greenland Lagrange strain to obtain the relation between the elastic force F and the spring elongation delta S, as shown in the formula (1),
F=k·(l+l0)2/l0 2·ΔS (1)
where k is the spring constant of the spring, l0And l is the original length of the spring and the length of the deformed spring respectively; reaction of k · (l + l)0)2/l0 2When the elastic coefficient is regarded as being changed, the F and the delta S are in a nonlinear relation with the increase of the elongation, and when the delta S is increased, the larger the amplitude of the F is, so that the overfeeding phenomenon is avoided.
Further, the regular rigid body is a cuboid or a cylinder or a capsule or a sphere; the irregular rigid body is a nail or a sharp knife.
Further, the cloth model is made of meshes, and when the meshes in a certain region change, that is, the length of a mesh edge exceeds a predetermined threshold, it is defined that the cloth is torn.
Tearing a certain point of a mesh of the cloth model, comparing the mass of two vertexes of the edge if the length change of the current edge exceeds a threshold value in the tearing process, further selecting a vertex with larger mass as a splitting vertex, deleting the current edge and the current vertex, adding a new vertex and an edge, changing the mass of the new vertex into half of the original mass, and adding a new surface into a cloth structure; when a cloth model is established, a Half-edge data structure is added to the model, so that the cloth can quickly find the correlation among the top, the edge and the surface in the tearing process, and the tearing simulation is completed.
Further, in step 6, introducing a Half-edge data structure for calculation when the cloth collides with the regular rigid body, wherein the specific algorithm is as follows:
step 6-1-1, wherein the parameter e is represented by the side length between any two points, and Threshold is represented by a preset Threshold, namely, once the side length exceeds the Threshold, the tearing is detected;
step 6-1-2, v1,v2Two sides selected in the collision region are represented, a point A represents a point with the maximum mass in the two sides, and a point B represents a point with the minimum mass in the two sides;
step 6-1-3, connecting the point A, B to obtain a line segment n;
step 6-1-4, using the line segment n as the normal to create the plane face passing through the point A0
6-1-5, judging the positions of the central points of all n triangular surface patches in the whole cloth and the central point of the whole cloth by using a plane equation f(x)Judging whether the facentre is larger than 0 or not, if the facentre is larger than 0, the small triangular patch is positioned on the right side of the whole cloth, and if the facentre is smaller than 0, the small triangular patch is positioned on the left side of the whole cloth;
6-1-6, tearing from the point A and deleting the point A and the edge related to the point A;
step 6-1-7, add two new vertices v3,v4And the mass of the vertex is only half of point a, then vertex v is added3,v4The state of (1) is a non-tearable state;
step 6-1-8, since tearing is started from one point and then a new triangular mesh is generated, a new two edges e need to be added1,r2
And 6-1-9, automatically adding other related structures and Half-edge data structures again into the cloth model to finish tearing operation.
Further, in step 6, for the collision between the cloth and the irregular rigid body, a method for constructing a distance field is adopted for detection, and the calculation algorithm of the bounding box distance field based on the euclidean distance is as follows:
step 6-2-1, firstly, constructing an AABB bounding box by using all vertexes and points within a certain range of a triangular patch in a cloth model:
determining the maximum and minimum vertex coordinates (x) in the mesh model of the clothmax,ymax,zmax) And (x)min,ymin,zmin);
And taking the two vertexes as diagonal vertexes, constructing an AABB bounding box, wherein the lengths of the bounding box along the x axis, the y axis and the z axis are respectively as follows: l isx=|xmax-xmin|,Ly=|ymax-ymin|,Lz=|zmax-zmin|;
In the AABB bounding box, the whole bounding box is divided according to different specific resolutions so as to form a three-dimensional matrix for storing distance information, and the initial value of each point in the three-dimensional matrix is set to be positive infinity, namely the maximum distance;
calculating all vertexes of the object triangular mesh to obtain a nearest division point, and setting the corresponding position of the three-dimensional matrix as zero;
determining an AABB bounding box for each triangular patch;
step 6-2-2, the collision detection process is as follows:
after an AABB bounding box of the cloth is constructed, constructing a distance field information three-dimensional matrix according to different specific resolutions, and initializing;
calculating a prism for all the triangular surface patches, wherein the prism is obtained by respectively moving three vertexes of the triangular surface patches by a certain length gamma according to the positive direction and the negative direction of the normal direction;
determining an AABB bounding box of the prism according to the six vertex coordinates of the prism;
calculating the shortest distance from all the dividing points in the bounding box of the prism to the triangular surface patch;
if the absolute value of the distance is smaller than the absolute value of the distance from the current dividing point to the object model, updating the distance value of the dividing point, and determining the sign of the distance value, wherein if the current dividing point is positioned on the same side of the normal direction of the triangular patch, the sign of the distance is positive, otherwise, the sign of the distance is negative;
step 6-2-3, through the above calculation, the bounding box can be divided into two parts by the plane of the triangular patch: one surface of the three-dimensional object is opposite to the outside of the corresponding object, the other surface of the three-dimensional object is negative to the inside of the corresponding object, and the surface of the whole three-dimensional object is divided into a positive part and a negative part by positive and negative division of all triangular patches.
Compared with the prior art, the invention has the following advantages:
1. the method provides animation simulation of the simulated cloth, can clearly see the effect presented when the cloth made of various materials collides with the regular or irregular rigid body, and can see obvious contrast in the same interface so as to judge the real effect requirement.
2. The distance field technology is introduced into the collision between cloth and an irregular rigid body, so that the rapid collision detection can be carried out.
3. Introducing a Half-edge data structure when the cloth collides with the regular rigid body; distance field detection is introduced when the cloth collides with the irregular rigid body, so that resources and time consumed by detection and calculation are reduced.
Drawings
FIG. 1 is a diagram of a mass spring model.
Figure 2 is a diagram of spring deformation in a mass spring.
FIG. 3 is a diagram showing an example of collision between a ball and a cloth in the present invention.
Figure 4 is a graph showing the tearing of the apex of the mesh of the cloth in the present invention.
FIG. 5 is a flowchart of a tear algorithm for a Half-edge data structure in the present invention.
FIG. 6 is a view of a tear at the apex of the fabric.
FIG. 7 is a rigid body model classification diagram in the present invention.
FIG. 8 is a flow chart of the steps of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings:
the system comprises a cloth modeling unit, an information acquisition unit, an optimized cloth model unit, a collision detection unit and a cloth tearing unit; the back end of the system comprises a cloth mapping database, a rigid body model library and a cloth model library made of various materials.
The cloth modeling unit is used for establishing a cloth model comprising a mass-spring model triangular mesh.
The information acquisition unit acquires and stores the position of the vertex of the cloth model, the relationship between the edge and the vertex, the length of the edge, the relationship between the surface and the vertex and the adjacent relationship between the surfaces, and establishes a Half-edge data structure by using the information.
The optimized cloth model unit is used for adding texture maps to the original cloth model, changing illumination parameters and adjusting cloth attributes to complete cloth simulation of specific materials.
The collision detection unit is used for creating a distance field and setting a distance condition of a collision response, and detecting the distance between the point of the cloth and the rigid body and the surface at any moment.
The cloth tearing unit is used for controlling the movement of the rigid body or the movement of the cloth, so that the cloth collides with the rigid body and is torn.
As shown in fig. 8, the simulation process is as follows:
in the invention, a material distribution model is established by using a mass point spring model, so that the material distribution is decomposed into a plurality of triangular surface patches to tear the material distribution; adding a Half-edge data structure while modeling, and storing related information of the position of a cloth vertex, the relationship between edges and the vertex, the length of the edges, the relationship between surfaces and the vertex and the adjacent relationship of the surfaces; and determines its mesh size, fineness, texture map.
The implementation process of the invention is that a cloth model of required material is established by a cloth modeling system or a preset body of the established cloth model is directly selected from a cloth model library, and then the cloth model enters a system for collision between the cloth and the rigid body to complete collision between the cloth and the rigid body and generate tearing.
The classical particle spring model was first proposed by Provot and the model structure is shown in fig. 1 a. Since the invention will require a fine mesh that is appropriate for the tearing effect, an improved adapted mass-spring model of triangular patches is selected for fabric modeling, the model structure being shown in fig. 1 b. In the model, the top points of the grid are defined as mass points, the edges of the grid are defined as structural springs, the diagonal line between two mass points in the square grid in the classical model is defined as a shear spring, and the connecting line segment of the non-common top points of two adjacent triangles is defined as a bending spring. The biggest difference of two kinds of models is that the different spring types between the mass point when causing deformation for the geometry carrier are different, uses the geometric carrier who regards triangular mesh as the cloth when using the mass point spring model after the improvement to model, and the structure that makes things convenient for the cloth to take place deformation triangle-shaped makes the cloth mesh more stable can not take place the shake simultaneously.
FIG. 2 shows the mass and spring changes in the mass spring model during a cloth tear. FIG. 2a shows that the point common to two adjacent triangular meshes is a mass point when no collision occurs; fig. 2b shows the separation of two adjacent cells upon impact at the beginning of the tear, the tensile properties of the cloth being due to the cloth being a flexible fabric, the model being a representation of the tensile force between two adjacent triangular cells of the cloth by the spring force of the spring. Figure 2c shows that the spring force of the spring, i.e. the tensile force between the two separate mass points, is about to reach its limit. Fig. 2d shows that the spring tension exceeds the threshold and the impact force exceeds the fabric's stretching capacity, i.e. the fabric tears.
And collecting information of the cloth model, wherein the information comprises the position of a vertex, the relation between edges and the vertex, the length of the edges, the relation between surfaces and the vertex and the adjacent relation of the surfaces, and establishing a Half-edge data structure by using the information. Adding distance constraint by using a momentum and angular momentum conservation method to constrain the stretching distance range of the cloth; and (3) adding collision constraint by using an angle method for solving two adjacent peaks of the cloth, and detecting the collision between the cloth and the object.
And (5) solving the position and the speed of the top point of the cloth by a Gauss-Seidel iteration method to complete the establishment of the model of the cloth.
After the cloth model is established, the model needs to be optimized, firstly, the hyperelasticity phenomenon is solved, the hyperelasticity phenomenon is a necessary phenomenon in the cloth simulation process, the non-linear spring is introduced to solve the hyperelasticity phenomenon, the Green Lagrange strain is used for replacing engineering strain to obtain the relation between the elastic force F and the spring elongation delta S, as shown in a formula (1), k is the elastic coefficient of the spring, l is the elastic coefficient of the spring, and0and l is the original length of the spring and the length of the deformed spring respectively:
F=k·(l+l0)2/l0 2·ΔS (1)
wherein k (l + l)0)2/l0 2When the elastic coefficient is regarded as being changed, the F and the delta S are in a nonlinear relation along with the increase of the elongation, and when the delta S is increased, the amplitude of the F is larger, so that the overfeeding phenomenon can be effectively avoided.
The cloth in real life is made of different manufacturing processes and raw materials. Therefore, for the cloth model, the cloth model is optimized by using a rendering method such as illumination, material, texture and the like. And mapping the two-dimensional image onto the three-dimensional cloth model by using a texture mapping method so as to increase the visual effect of the cloth model. After modeling is completed, the model is endowed with the attributes of the cloth, and the original cloth model shows the required cloth material effect by adjusting the softness and the stretching capacity of the cloth and controlling the attributes of the cloth such as the damping coefficient, the surface thickness and the like, so that the simulation of the cloth is completed.
By utilizing the system, a plurality of common cloth model examples are already made, a cloth model library is built and stored in the system, and a plurality of preset cloth model bodies are stored in the cloth model library, such as: cotton cloth, linen, silk, woolen cloth, leather, flannelette, chiffon and the like can be directly dragged for use.
The collision system of the cloth and the rigid body comprises the collision of the cloth by a regular rigid body and the mutual tearing of the cloth and an irregular rigid body.
After the cloth model is built and optimized to a type of cloth, it is set to a piece of cotton, for example. The two corners above the model are fixed to hang the model vertically to the ground. Selecting and creating a rigid body from a rigid body model library of the system, wherein the regular rigid body comprises: a cube, a cylinder, a capsule, a sphere, etc. The ball collides with the cloth as shown in fig. 3a, creating a sphere on the right side of the cloth, giving the sphere a water velocity to the left. Or, as shown in fig. 3b, the cloth is horizontally placed and fixed at four corners of the cloth, a sphere is created above the cloth, and gravity is added to the sphere so that the sphere freely falls down to collide with the cloth. At the moment when the rigid body collides with the cloth, the cloth is torn.
The cloth model is composed of grids, the tearing of the cloth is caused by the fact that the grids in a certain area are changed, and the length of the grid edge exceeds a specified threshold value. If tearing occurs at the point a of the cloth mesh in fig. 4, in the tearing process, when the length change of the current edge exceeds a threshold value, the mass of the two vertexes of the edge is compared, the vertex with larger mass is further selected as the splitting vertex, the current edge and the current vertex are deleted, a new vertex and an edge are added, the mass of the new vertex is changed to be half of the original mass, and a new surface is added into the structure of the cloth. When the cloth model is established, a Half-edge data structure is added to the model, wherein the data structure comprises the position of a vertex, the relation between an edge and the vertex, the length of the edge, the relation between a surface and the vertex and the adjacent relation of the surfaces, and the cloth can quickly find the relation between the top, the edge and the surface in the tearing process so as to complete the tearing simulation.
Introducing a Half-edge data structure in the tearing process, wherein the specific tearing algorithm is as follows:
a flow chart according to this algorithm is shown in fig. 5.
In the step (1), a parameter e is represented as the side length between any two points, and Threshold is represented as a preset Threshold, namely, once the side length exceeds the Threshold, the tearing is detected;
step (2) represents two selected edges v of the collision area1,v2Point a represents the point of maximum quality in the two edges, and point B represents the point of minimum quality in the two edges;
step (3) connecting the points A, B to obtain a line segment n;
step (4) creating a plane face passing through the point A by taking the line segment n as a normal line0
Step (5) is used for judging the positions of the central points of all n triangular surface patches in the whole cloth and the central point of the whole cloth by using a plane equation f(x)Judging whether the facentre is larger than 0 or not, if the facentre is larger than 0, the small triangular patch is positioned on the right side of the whole cloth, and if the facentre is smaller than 0, the small triangular patch is positioned on the left side of the whole cloth;
step (6) tearing is started from the point A, and the point A and the edge related to the point A are deleted;
as shown in FIG. 6, two triangular meshes are represented, torn by vertex A, and then vertex A disappears, resulting in two new vertices v3,v4And two new edges e are generated1,e2
Step (7) adding two new vertexes v3,v4And the mass of the vertex is only half of point a, then vertex v is added3,v4The state of (1) is a non-tearable state;
step (8) since tearing starts from one point and then a new triangle mesh is generated, a new two edges e need to be added1,e2As shown in fig. 6; and (8) finishing the process, and automatically adding other related structures and Half-edge data structures into the cloth model again to finish the tearing operation.
FIG. 6 is only a pictorial representation of two triangular meshes, torn by vertex A and then vanished, resulting in two new vertices v3,v4And two new edges e are generated1,e2
Due to the diversification of the manufacturing process and the raw materials, the fabric has different qualities for different materials. The tearing strength of the cloth refers to a mechanical index for testing the film or the net. The failure mechanism is the applied tensile force required to continue cracking by localized failure. The tear strength of the cloth has a set of test standards. Each fabric has a standard tear strength, for example, 10N is acceptable for woolen fabrics. Therefore, different collision forces are set for different materials of cloth, namely the movement speed added to the regular rigid body is set according to the standard tearing strength of the cloth.
According to the experience of real life, the tearing of the cloth is mostly caused by the hanging or pulling of the irregular rigid body, so that the interaction between the cloth and the sharp irregular rigid body is indispensable to a dynamic system for tearing the cloth. The system comprises the interaction of the nail and the cloth and the interaction of the sharp blade and the cloth. The interaction between the cloth and the irregular rigid body is embodied in that the sharp part of the irregular rigid body can tear the cloth, the irregular rigid body is fixed in the interaction process, and gravity attribute is added to the cloth to enable the cloth to fall on the irregular rigid body and then tear.
For irregular rigid body collision detection, we use a method of constructing a distance field. The distance field is actually a vector field that reflects the shortest distance from any point in space to the surface of a given object. When using distance fields, collision detection between different objects is performed point by point, just in line with the collision rules between irregular rigid bodies and cloth. When the irregular rigid body collides with the cloth, the cloth firstly touches the vertex of the sharp rigid body, then the distance field between the vertex of the surface of one object and the other object is used for detection, and if the distance D (p) < 0, the collision occurs.
Firstly, an appropriate distance field needs to be established, and a mass-spring model is introduced during modeling, namely the cloth is composed of a plurality of triangular patches. Therefore, the shortest distance from the point to the triangular patch is calculated by using an Euclidean distance algorithm to detect the collision between the cloth and the irregular rigid body. The classical euclidean distance formula is shown in equation (2):
the point P, Q is two points in three-dimensional space, and their coordinates are (x) respectively1,y1,z1) And (x)2,y2,z2)。
In the system, the distance from a point P in the three-dimensional space to a triangular patch needs to be calculated. The cloth carries out free falling movement under the action of gravity, so that new positions of the cloth need to be calculated, collision detection is continuously carried out on the new positions, whether the distance D (P) between the triangular surface patch of the cloth and the vertex P of the irregular object is smaller than 0 or not is detected, and if the distance D (P) is smaller than 0, the cloth is torn, and collision response is needed. And after collision is detected, introducing a Half-edge data structure when the system calls cloth modeling, and finishing the tearing effect by using a tearing algorithm.
The system needs to calculate the distance from the vertex P to the triangular patch for multiple times, so that a large amount of memory and time are consumed for collision detection. Based on this problem, a collision range is determined and planned using a euclidean distance based bounding box distance field calculation algorithm to provide efficient collision detection.
Firstly, constructing an AABB bounding box by using all vertexes and points in a certain range of a triangular patch, wherein the algorithm is as follows:
1. determining the maximum and minimum vertex coordinates (x) in the mesh model of the clothmax,ymax,zmax) And (x)min,ymin,zmin);
2. And constructing an AABB bounding box by taking the two vertexes as diagonal vertexes. The length of the bounding box along the x, y and z axes is respectively: l isx=|xmax-xmin|,Ly=|ymax-ymin|,Lz=|zmax-zmin|;
3. In this AABB bounding box, the entire bounding box is divided according to the difference in the specific resolution, thereby constituting a three-dimensional matrix storing distance information. Setting the initial value of each point in the three-dimensional matrix to be positive infinity, namely the maximum distance;
4. calculating all vertexes of the object triangular mesh to obtain a nearest division point, and setting the corresponding position of the three-dimensional matrix as zero;
5. determining an AABB bounding box for each triangular patch;
the collision detection process for constructing the bounding box is briefly described as follows:
1. constructing a distance field information three-dimensional matrix according to different specific resolutions after constructing the AABB bounding box of the cloth, and initializing;
2. calculating a prism for all the triangular surface patches, wherein the prism is obtained by respectively moving three vertexes of the triangular surface patches by a certain length gamma according to the positive direction and the negative direction of the normal direction;
3. determining an AABB bounding box of the prism according to the six vertex coordinates of the prism;
4. calculating the shortest distance from all the dividing points in the bounding box of the prism to the triangular surface patch;
5. if the absolute value of the distance is smaller than the absolute value of the distance from the current dividing point to the object model, the distance value of the dividing point is updated, the sign of the distance value is determined, if the current dividing point is positioned on the same side of the normal direction of the triangular patch, the sign of the distance is positive, otherwise, the sign of the distance is negative.
Through the above calculation, the bounding box can be divided into two parts by the plane of the triangular patch: one surface is the external part of the corresponding object and the other surface is the internal part of the corresponding object. The surface vicinity of the whole three-dimensional object is divided into a positive part and a negative part by positive and negative division of all triangular patches.
The processing of the prism of the triangular surface patch and the bounding box thereof avoids calculating the distance information of the region far away from the irregular rigid body so as to improve the efficiency of collision detection.
The interface display of the system is a visual control panel, and comprises a control panel of a cloth modeling system and a control panel of the collision between cloth and a rigid body. The content in the back-end database of the system is called by utilizing a visual control panel, and the panel mainly comprises the following buttons:
1. the cloth model is provided with option buttons such as cotton cloth, linen, silk, wool fabric, leather, flannelette, chiffon and the like, and is used for selecting preset bodies of various material cloth models in the cloth model library.
2. A rigid body model, as shown in fig. 7, the regular rigid body includes a square or cylinder or a capsule or sphere; the irregular rigid body comprises a nail or a sharp knife.
The above-mentioned embodiments are merely illustrative of the preferred embodiments of the present invention, and do not limit the scope of the present invention, and various modifications and improvements of the technical solution of the present invention by those skilled in the art should fall within the protection scope defined by the claims of the present invention without departing from the spirit of the present invention.

Claims (6)

1. A cloth tearing dynamic simulation system is characterized by comprising a cloth modeling unit, an information acquisition unit, an optimized cloth model unit, a collision detection unit and a cloth tearing unit;
the cloth modeling unit is used for establishing a cloth model comprising a mass point spring model triangular mesh;
the information acquisition unit acquires and stores the position of the vertex of the cloth model, the relation between the edge and the vertex, the relation between the length of the edge and the surface and the vertex, and the adjacent relation of the surface, and establishes the informationHalf-edgeData ofStructure;
the optimized cloth model unit is used for adding texture maps to the original cloth model, changing illumination parameters and adjusting cloth attributes to finish cloth simulation of specific materials;
the collision detection unit is used for creating a distance field, setting a distance condition of collision response, and detecting the distance between a point of the cloth and the rigid body and a surface at any moment;
the cloth tearing unit is used for controlling the movement of the rigid body or the movement of the cloth, so that the cloth collides with the rigid body and is torn;
the specific simulation process of the system is as follows:
step 1, establishing a cloth model by using a mass point spring model, and decomposing the cloth into a plurality of triangular patches to tear the cloth; adding a Half-edge data structure while modeling, and storing related information of the position of a cloth vertex, the relation between an edge and the vertex, the relation between the length of the edge and a surface and the vertex, and the adjacent relation of the surfaces; determining the size, fineness and texture mapping of the grid;
step 2, adjusting the attributes of the cloth model, wherein the attributes comprise the binding Stiffness of the cloth, the stretching capacity of the cloth, the Damping coefficient of the cloth and the surface Thickness of the cloth, and the simulation of the cloth of a certain material is achieved by adjusting the parameter values of the attributes to complete the simulation of the material of the cloth;
step 3, if the cloth collides with the regular rigid body, no gravity attribute is added to the cloth, and the cloth is fixedly suspended or horizontal; if the cloth collides with an irregular object, the cloth is horizontally placed by adding the gravity property;
step 4, creating a rigid body, and if the rigid body is a regular rigid body, adding gravity acceleration to the rigid body; if the rigid body is irregular, fixing the rigid body into the interface;
step 5, adjusting x, y and z three-dimensional coordinates of the rigid body and the cloth to enable the cloth and the rigid body to be torn;
step 6, leading in when the cloth collides with the regular rigid bodyHalf-edgeData structure for storing the structural information of cloth for later tearingQuick query of elements; setting a cloth tearing rule according to a physical principle, and constructing a tearing algorithm; when cloth collides with an irregular rigid body, a bounding box distance field calculation algorithm based on Euclidean distance is established to determine and plan a collision range, the distance field carries out collision detection on the cloth and the rigid body, and collision response is started to complete tearing simulation when a collision condition is reached;
the cloth model is composed of meshes, when the meshes in a certain area change, namely the lengths of the edges of the meshes exceed a specified threshold value, the cloth is defined to be torn, a certain point of the meshes of the cloth model is torn, the mass of two vertexes of the edges is compared when the length change of the current edge exceeds the threshold value in the tearing process, then the vertex with higher mass is selected as the split vertex, the current edge and the current vertex are deleted, a new vertex and an edge are added, the mass of the new vertex is changed to be half of the original mass, and a new surface is added into the structure of the cloth; when establishing cloth model, add modelHalf-edgeThe data structure can enable the cloth to quickly find the association among the top, the edge and the surface in the tearing process so as to complete the tearing simulation;
introduced when cloth collides with regular rigid bodyHalf-edgeAnd (3) calculating a data structure, wherein a specific algorithm is as follows:
step 6-1-1, parametersExpressed as the side length between any two points,a threshold value set in advance, that is, a side length exceeding the threshold value is detected as the occurrence of a tear;
in the step 6-1-2,two edges, points, selected to represent the area of impactOne point representing the maximum mass of the two sides, pointA point representing the minimum quality of the two sides;
step 6-1-3, connecting the pointsGet the line segment
Step 6-1-4, by line segmentCreating a passing point for a normalOf (2) plane
Step 6-1-5, all of the cloth pieces in the whole cloth are judgednThe central point of each triangular patch and the central point of the whole cloth are positioned by using a plane equationDeterminationIf, ifThe tearing triangular patch is located on the right side of the whole cloth, ifThe tearing triangular patch is positioned at the left side of the whole clothA side;
step 6-1-6, by pointTear initiation and deletion pointAnd the edge associated therewith;
step 6-1-7, adding two new verticesAnd the mass of the vertex is only a pointAnd then vertex is addedThe state of (1) is a non-tearable state;
step 6-1-8, since tearing is started from one point and then a new triangular mesh is generated, new two edges need to be added
Step 6-1-9, the cloth model automatically adds other related structures again andHalf-edgeand (5) finishing the tearing operation by a data structure.
2. The cloth tear dynamic simulation system of claim 1, wherein: in the cloth model in step 1, a triangular mesh is used as a geometric carrier of the cloth, the mesh vertex is defined as mass point, and the mesh edge is defined as a structural spring.
3. The cloth tear dynamic simulation system of claim 1, wherein: in the modeling process of the step 1, adding distance constraint by using a momentum and angular momentum conservation method to constrain the stretching distance range of the cloth; adding collision constraint by using an angle method of solving two adjacent peaks of the cloth, and detecting the collision between the cloth and the object; and solving the position and the speed of the top point of the cloth by adopting a Gauss-Seidel iteration method to complete the establishment of the model of the cloth.
4. The cloth tear dynamic simulation system of claim 1, wherein: in step 1, optimizing the model after modeling, introducing a nonlinear spring to solve the superelasticity phenomenon, and replacing engineering strain with Greenland Lagrange strain to obtain elastic forceFAnd spring extension△SThe relationship between them is shown in formula (1),
(1)
wherein,kis the elastic coefficient of the spring and is,lthe length of the spring is the original length of the spring and the length of the deformed spring; will be provided withCoefficient of elasticity regarded as varying, with increasing elongationFAnd△Shas a non-linear relationship with each other when△SWhen the size of the pipe is increased, the pipe is enlarged,Fthe larger the amplification of (a), the more the overfleineed phenomenon is avoided.
5. The cloth tear dynamic simulation system of claim 1, wherein: the regular rigid body is a tetragonal body or a cylinder or a capsule body or a sphere; the irregular rigid body is a nail or a sharp knife.
6. The cloth tear dynamic simulation system of claim 1, wherein: in step 6, for the collision between the cloth and the irregular rigid body, the method for constructing the distance field is adopted for detection, and the calculation algorithm of the bounding box distance field based on the Euclidean distance is as follows:
step 6-2-1, firstly, all vertexes and points in a certain range of a triangular patch in the cloth model are utilized to constructAABBA bounding box:
finding the maximum and minimum vertex coordinates in the mesh model of the cloth (,,) And (a),,);
Constructing a vertex by taking the two vertexes as diagonal vertexesAABBA bounding box, the bounding box edgex、y、zThe length of the shaft is respectively:,,
at the position ofAABBIn the bounding box, the whole bounding box is divided according to different specific resolutions so as to form a storage distance informationThe initial value of each point in the three-dimensional matrix is set to be positive infinity, namely the maximum distance;
calculating all vertexes of the object triangular mesh to obtain a nearest division point, and setting the corresponding position of the three-dimensional matrix as zero;
determining one for each triangular patchAABBA bounding box;
step 6-2-2, the collision detection process is as follows:
in the construction of clothAABBAfter bounding the box, constructing a three-dimensional matrix of distance field information according to different specific resolutions, and initializing;
calculating a prism for all the triangular patches, wherein the prism is moved by a certain length from three vertexes of the triangular patches respectively according to the positive direction and the negative direction of the normal directionγAnd then obtaining;
based on the coordinates of the six vertices of the prism, the prism being trueAABBA bounding box;
calculating the shortest distance from all the dividing points in the bounding box of the prism to the triangular surface patch;
if the absolute value of the distance is smaller than the absolute value of the distance from the current dividing point to the object model, updating the distance value of the dividing point, and determining the sign of the distance value, wherein if the current dividing point is positioned on the same side of the normal direction of the triangular patch, the sign of the distance is positive, otherwise, the sign of the distance is negative;
step 6-2-3, through the above calculation, the bounding box can be divided into two parts by the plane of the triangular patch: one surface of the three-dimensional object is opposite to the outside of the corresponding object, the other surface of the three-dimensional object is negative to the inside of the corresponding object, and the surface of the whole three-dimensional object is divided into a positive part and a negative part by positive and negative division of all triangular patches.
CN201610552819.8A 2016-07-14 2016-07-14 A kind of cloth tearing dynamic simulator system Active CN106204697B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610552819.8A CN106204697B (en) 2016-07-14 2016-07-14 A kind of cloth tearing dynamic simulator system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610552819.8A CN106204697B (en) 2016-07-14 2016-07-14 A kind of cloth tearing dynamic simulator system

Publications (2)

Publication Number Publication Date
CN106204697A CN106204697A (en) 2016-12-07
CN106204697B true CN106204697B (en) 2019-05-28

Family

ID=57477293

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610552819.8A Active CN106204697B (en) 2016-07-14 2016-07-14 A kind of cloth tearing dynamic simulator system

Country Status (1)

Country Link
CN (1) CN106204697B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10713400B2 (en) 2017-04-23 2020-07-14 Cmlabs Simulations Inc. System and method for executing a simulation of a constrained multi-body system
CN107930124B (en) * 2017-10-26 2020-07-10 广州市雷军游乐设备有限公司 Method and device for matching movement between doll models, terminal equipment and storage medium
CN110136271A (en) * 2018-02-08 2019-08-16 真玫智能科技(深圳)有限公司 A kind of method and device of cloth people collision
CN112164121B (en) * 2020-09-30 2021-11-23 北京完美赤金科技有限公司 Tearing effect graph generation method and device, storage medium and electronic device
CN112434356B (en) * 2020-10-16 2024-06-14 杭州群核信息技术有限公司 Modeling method and system based on half model
CN113244622B (en) * 2021-06-22 2022-11-08 腾讯科技(深圳)有限公司 Collision data processing method and device, storage medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1430184A (en) * 2001-12-29 2003-07-16 田捷 Simplified method of realizing three dimensional network model using half of data structure
CA2289413C (en) * 1999-11-15 2004-06-22 Public Technologies Multimedia, Inc. System and method for displaying selected garments on a computer-simulated mannequin
CN102324108A (en) * 2011-09-30 2012-01-18 北京航空航天大学 Non-stretch cloth simulation oriented mass-spring model constraint method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2289413C (en) * 1999-11-15 2004-06-22 Public Technologies Multimedia, Inc. System and method for displaying selected garments on a computer-simulated mannequin
CN1430184A (en) * 2001-12-29 2003-07-16 田捷 Simplified method of realizing three dimensional network model using half of data structure
CN102324108A (en) * 2011-09-30 2012-01-18 北京航空航天大学 Non-stretch cloth simulation oriented mass-spring model constraint method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
自适应椭球包围盒改进织物碰撞检测方法;唐勇 等;《计算机辅助设计与图形学学报》;20131015;第25卷(第10期);1589-1596

Also Published As

Publication number Publication date
CN106204697A (en) 2016-12-07

Similar Documents

Publication Publication Date Title
CN106204697B (en) A kind of cloth tearing dynamic simulator system
US11250187B2 (en) Computer implemented method,system and computer program product for simulating the behavior of a woven fabric at yarn level
US9378593B2 (en) Garment simulation using thread and data level parallelism
CN107590853A (en) A kind of high validity methods of exhibiting of architecture ensemble earthquake
CN104239601B (en) Simulation of a combination of fabric pieces
Lu et al. Dynamic cloth simulation by isogeometric analysis
Koh et al. A simple physics model to animate human hair modeled in 2D strips in real time
CN104881557A (en) Method for dynamically simulating human body and clothing in computer
CN106354959A (en) Three-dimensional garment and human model collision detection method and device
CN109002630B (en) Rapid simulation method for super-elastic material
CN112862942B (en) Physical special effect simulation method, device, electronic equipment and storage medium
CN113191018B (en) Cloth simulation method and system, electronic equipment and storage medium
CN114299200A (en) Cloth animation processing method and device, electronic equipment and storage medium
Souza et al. Fast simulation of cloth tearing
JP4115205B2 (en) Three-dimensional shape display method, three-dimensional shape display device, program for executing the method, and recording medium
Zhou et al. Shear buckling and dynamic bending in cloth simulation
CN111192367B (en) Method and device for simulating collision deformation of deformable object in real time
Cao et al. Research of fast cloth simulation based on mass-spring model
Boxerman Speeding up cloth simulation
Liu et al. Phusis cloth: A physics engine for real-time character cloth animation
Gu et al. Constraint solving order in position based dynamics
Zhang et al. A new self-collision detection method for cloth simulation
Sivaraja et al. CLOTH SIMULATION USING AN ENHANCED CATMULL-CLARK SUBDIVISION SCHEME AND COLLISION DETECTION IN A VIRTUAL ENVIRONMENT
Phillips Tearable Cloth
Wang et al. Optimization of Fabric Deformation Based on Wind Field Simulation Based by Bernoulli Equation

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant