Cloth Animation with Self-Collision Detection - Semantic Scholar

0 downloads 0 Views 29KB Size Report
Keywords: collision, clothes, human animation, flexible objects, self-collision. 1. ..... the animation requires a very limited control from the animator. In our case ...
Cloth Animation with Self-Collision Detection Benoit Lafleur, Nadia Magnenat Thalmann, and Daniel Thalmann

ABSTRACT This paper addresses the problem of detecting collisions of very flexible objects, such as clothes with almost rigid bodies, such as human bodies. In our method, collision avoidance consists of creating a very thin force field around the obstacle surface to avoid collisions. This force field acts like a shield rejecting the points. This volume is divided into small contiguous non-overlapped cells which completely surround the surface. As soon as a point enters into a cell, a repulsive force is applied. The direction and the magnitude of this force are dependent on the velocities, the normals and the distance between the point and the surface. Particular cases are discussed with the ways of solving them. We also briefly present various approaches for simulating flexible objects and the difficulties, due to the numerical methods of solving the differential equations involved. Finally, we briefly describe the implementation of our software for creating and animating clothes. Keywords: collision, clothes, human animation, flexible objects, self-collision

1. INTRODUCTION Computer Animation has become more and more interdisciplinary and now uses techniques from very different areas such as art, robotics or cinema. For several years, animators have used models with little consideration for the physical laws which drive the real world. Most of the time, animation sequences have showed geometric and rigid objects moving and changing according to simple or complex predefined transformations. These traditional methods have become tedious and even unable to recreate the simplest realistic effects. In the last five years, researchers in Computer Animation have proved that only physics-based animation laws may efficiently simulate the laws of nature. Almost all natural phenomena can be modeled with differential equations. Now the question is: how to find suitable models and stable and efficient numerical methods for solving the equations. The use of these methods not only improves the realism of motion, but also it reduces the work of the animator by introducing automatic motion control. However, the systems are often difficult to control and the constraints which are used tend to make the systems unstable. Moreover, the numerical methods require a lot of CPU time. Fortunately, in Computer Animation we are more interested in the appearance than in a strict simulation of the motion. Consequently, it is possible to accept compromises and heuristic methods can be introduced, which do not change the look of the animation. For several years, our research has dealt with human animation. In particular, we have introduced operators, called JLD operators (Magnenat Thalmann and Thalmann 1987; Magnenat Thalmann et al. 1988) to automatically adapt the human body to the skeleton. However, clothes were simulated as a part of the body with no autonomous motion. Two separate problems have to be solved for cloth animation: the motion of the cloth without collision detection and the collision detection of the cloth with the body and with itself. The first problem was addressed by Weil (1986) and Terzopoulos et al (1987). Kunii and Gotoda (1990) have solved the problem of garment wrinkle formation.

In this paper, we propose a method of collision detection especially efficient for dynamic models. Particular cases are discussed with ways of solving them. We also briefly present various approaches for simulating flexible objects and discuss the difficulties due to the numerical methods for solving the differential equations involved. Finally, we briefly describe the implementation of our software for creating and animating clothes. 2. COLLISION DETECTION FOR FLEXIBLE OBJECTS A flexible or deformable object is different from a rigid object because it cannot be computed from a small set of its points. The flexible object must be divided into small parts and each point submitted to a set of local and global constraints. These constraints create forces which prevent the violation of these constraints. Solving the dynamic system requires finding an equilibrium between all these forces. Collision detection adds extra constraints and requires a specific algorithm. For very flexible objects like clothes, it is necessary to solve self-collisions. Moore and Wilhelms (1988) have described a method to solve collision detection for flexible objects composed of polygons. Van Herzen et al. (1990) developed an algorithm to detect geometric collisions betweeb pairs of time-dependent parametric surfaces. Our method is a modification of the Moore-Wilhelms method for processing dynamic cases like clothes on a body during a walking animation. Let us review this method. Consider two non-parametric objects A and B with triangular facets. We have to detect points of A which come into collision with the facets of B during a certain period of time. The displacement volume of a triangle is limited by the edges and the line segments corresponding to the paths of the three points P0, P 1 and P2 in the directions V0, V1 and V2 (see Fig.1). This volume is compared with the path of the point P in the direction V. The intersection is found by solving the equation: P + V*t = P0 + V1*t + ((P1-P0) + (V1-V0)*t)*u + ((P2-P0) + (V2-V0)*t)*v

(1)

where the left term is the path of the point A and the right term the displacement volume of the triangle of B. The variables u and v define the triangle surface, and the variable t, the time. Vector equation (1) corresponds to three scalar equations in x, y and z with three unknown u, v and t. There is an intersection when 0 ≤ t ≤ tmax, u ≥ 0, v ≥ 0 and u+v ≤ 1.

P0

V0

P V

P1

V2 P2

V1

Fig.1 The point P of object A following the direction V and triangle of object B, built with points Pi following the directions Vi An exact solution of Equation (1) implies that points follow exactly the directions defined by the direction vectors. In a dynamic model, V and Vi correspond to the velocity vectors of points P and Pi. Unfortunately, when the differential equation system is solvec numerically, the velocities at t=0 are not the only parameters involved in the calculation of the new position of the points. Forces modify the velocity direction and magnitudes when t varies from 0 to tmax. In this case, a point may go across a triangle without being detected (see Fig.2). One way of solving this problem is to increase the range of u, v and t when an intersection is considered. However, several intersection triangles are obtained for a point and this makes the calculation of the force more complex. Moreover, there are cases where it is not sufficient to circumvent the problem. It would be possible to perform the intersection test after calculation of the new

positions and repeat again, taking into account forces until there are no more intersections. This is timeconsuming when there are numerous intersections and a infinite loop can even occur if there are a very large number of intersections in a short time. For example, the intersection of a cloth with the human body implies several hundreds of simultaneous collisions.

P

P'

V

triangle T P'' Fig.2 The triangle T is fixed and lies horizontally. The method assumes that the point P moves to P' with a velocity V and no collision is detected. Because of the force F, P moves to P'' and P goes across the triangle T In order to solve these difficulties, we propose a method of collision avoidance consisting of creating a very thin force field around the obstacle surface to avoid collisions. This force field acts like a shield which rejects the points. This volume is divided into small contiguous non-overlapped cells which completely surround the surface as shown in Fig.3. As soon as a point enters into a cell, a force is applied. The direction and the magnitude of this force depend on the velocities, the normals and the distance between the point and the surface. The displacement volume is replaced by a cell built from the points Pi of the triangle and the normals Ni at these points. The velocities V and Vi are only present in the calculation of the repulsion forces.

N0

N1 P1

P0 N2 P2 Fig.3 Cell built using a triangle P0P1P2 and the normals Ni at points Pi The intersection is calculated by solving the following equation: P = P 0 + N 0*w + ((P 1-P0) + (N 1-N0)*w)*u + ((P 2-P0) + (N 2-N0)*w)*v with

(2)

0≤u