• 沒有找到結果。

Chapter 1 Introduction

1.3 Thesis Organization

The following chapter is organized as follows. In Chapter 2, we review previous researches on physical model and contact resolution. In Chapter 3, a background for a widely-used simulation pipeline is generally introduced step by step. In Chapter 4, an overview of the physical model used in this thesis is described in detail. Then in Chapter 5, we will describe a collision detection and response scheme for cloth and rigid body and discuss about some drawbacks of traditional methods. The implementation and results will be demonstrated in Chapter 6. And finally conclusion and future work are given in Chapter 6.

Chapter 2

Related Work

A review of previous researches is presented as follows. In section 2.1, there are some researches about basic physical model such as rigid body and deformable cloth.

Then in section 2.2, we will state some previous researches about contact resolution.

And finally in section 2.3, we will present some coupling methods for rigid body and deformable body.

2.1 Physical Model

Rigid body dynamics had been researched for decades and is widely used nowadays [11][19][10][18][16]. Baraff was the first to systematically treat contact problems [2][3][4].

Deformable body dynamics for computer graphic was pioneered by Terzopoulos [31], and then widely discussed ever since. Provot [25] proposed a mass-spring system which constructs deformable surface as a number of particles. The particles are connected to each other with springs as a rectangle grid in order to model various forces such as tensile, shear and bending force. Spring coefficient can be tuned to

unstructured meshes is proposed in [19]. Pascal V. et al.[23] proposed a more accurate way to represent the bending force since bending spring in original model provides not only bending force but also tensile force.

2.2 Contact Resolution

2.2.1 Penalty-based method

On of the first penalty-based method was proposed by Moore et al. [19]. They model contact forces as spring force in computer animation. In addition to use simple linear spring, they modified the spring constant depends on whether motion is approaching or leaving. The relationship is stated as follows:

kleavekapproach, (2.1) while ε is the elasticity of collision so that ε=0 as inelastic collision and ε=1 as perfect elastic collision. Terzopoulos, et al. [31] derived the penalty force from energy potential.

Hirota et al. [12][13] integrate penalty force over the intersecting polygon and combined with an implicit finite element method. These methods are easy to formulate but have problems in assigning meaningful spring constant for penalty force. That is, the force may be too stiff for a drastic response or too weak to resolve contact.

2.2.2 Impulse-based method

Impulse-based methods resolve contact between objects by modifying velocity according to collision impulse. Moore et al.[19] extended penalty method with an algebraic collision resolving problem, which is similar to Newton’s collision law, and handles colliding contacts before applying springs. Moore [19] and Hahn [11] both modeld the interaction by integrating contact force over times such as

J = Fdt

, (2.4) while Mirtich [18] model contact force as collision impulse train, i.e., a sum of delta function approximating the corresponding time integral. These methods are easily formulated and under some circumstances they may guarantee the existence of the solution. However, they treat even continuous contact as a type of impact so that static contact such as one object resting on another are modeled as a series of collision impulse in a very high frequency.

2.2.3 Constraint-based method

To handle collision, velocity-based formulation is usually used in constraint-based method. It considers impulse-momentum law at the point of collision. Stewart and Trinkle [28] make an impulse-based method and the method is now known as Stewart’s method. Anitescu and Potra [1] extended the method to guarantee existence of the solution. Then Sauer and Schömer [26] extended with a linearized contact condition. Stewart and Trinkle [29] suggest using contact tracking to avoid the problem of explicitly determining all potential active contact constraint.

2.3 Coupling

Most papers discussing contact problems are limited within single dynamic system. An early technical report [5] proposed a method to couple different mechanics models. The system is a black box system which constraint force is the interface among different models. O’Brian et al. [20] presented a coupling system between different mechanics models in context of active or passive system with constraint force so that a pre-animated basketball locus can be modified by interacting with a net.

Constraint-based coupling is shown to be general but the calculation of the constraint force may lead to solving large linear system.

Some researches defined a new model to represent both rigid and deformable object so that contact resolution can be unified. Jansson et al.[17] proposed a mass-spring model for modeling both rigid and deformable objects. A spring is created while particles move within a nominal distance in order to push each other away. This method constructs even simple rigid object with nested and large number of spring connections. Moreover, spring constant assignment remains a problem.

Pauly [24] proposed a quasi-rigid object which deforms while contact and preserve their basic shape afterward. Galoppo et al. [30] simulate contact between deformable bodies with high-resolution geometry with Dynamic Deformation Textures which enable a heterogeneous object with different stiffness. However, these models require new definition for object while traditional rigid and mass-spring-based deformable object still widely and efficiently used. And also these methods cannot present a deformable surface such as cloth.

Chapter 3 Background

Rather than only moving a single object, interaction among objects makes physics simulation more interesting. During objects moving along, collision occurs.

The contact should be detected and then resolved to guarantee no visual penetration since objects do not penetrate each other in reality. In the most popular physics-based simulation pipeline, there are three main simulation steps as described in Fig 3.1. First, move each object with their mechanics. Then trace every object to detect if collision happens. Finally if objects actually contact each other, resolve contact with moderate response.

Figure 3.1: Simulation pipeline

There are two main categories of physical model: rigid body models and deformable body models. Most of time contact issues are discussed individually for different physical models.

3.1 Rigid Body and Deformable Body

Rigid body motion theory is well-established and widely-used today. The main idea is regarding ideal object with stiff and non-deformable material. Due to this assumption, rigid body motion can be simply figured. If a force applied on an object without any deformation, it only changes the velocity of the center of mass, including translation and angular velocity. This property makes motion simulation relatively simple even for complex object. Nevertheless, this also makes contact resolution extra-hard to handle because of the stiffness of rigid body. The reaction produce after collision can be sensitive since collision time is extremely short. Furthermore, most of objects in real world have a little deformation while collision occurs. An famous rigid body model, Stanford bunny, is shown in Fig 3.2.

Figure 3.2:Stanford bunny as a rigid body [27]

Beside rigid body, deformable body which is able to change in geometry is another choice. While there are plenty of models for deformable object, only cloth simulation is discussed in this section because of its special properties.

Cloth is a thin, elastic and highly deformable surface without volume. It moves and deforms according to its structure and the physical laws. Its physically based models can further be classified into two categories: energy-based techniques and

force-based techniques. Energy-based techniques calculate the energy of the whole cloth from a set of equations and determine the shape of the cloth by moving the points to achieve a minimum energy situation, such as Finite Element Method (FEM).

Force-based techniques represent the force among points as differential equations and perform a numerical integration to obtain the point positions at each time step, such as mass-spring system. In general energy-based techniques are used to produce static simulation while force-based techniques are used in dynamic simulation. Fig 3.3 shows a cloth model proposed in [7].

Figure 3.3:Cloth model

In most of simulation, objects are usually treated as either rigid or deformable body. In some researches, a semi-deformable object is presented but it requires more complicate representation and may cost more computational time.

3.2 Collision

While most of the physic simulations are not for a single but multiple objects, multi-object interaction is an important issue. During the course of physics-based animation, objects come in contact to each other. The contact should be resolved, either by repulsing or sliding off each other. In order to respond to collision, the collision information such as contact region and contact time is necessary to be gathered. This is the main issue for collision detection. Collision detection can be regarded as a purely geometrical problem.

Many methods are proposed to solve this problem for either rigid body or deformable body. No matter what method is applied, collision detection is often a bottleneck for physic simulation. Hubbard [15] introduced a concept of broad-phase and narrow-phase collision detection. Broad-phase collision detection aims to perform a coarse test which prunes unnecessary test pair to reduce computational cost.

And narrow-phase collision detection deals with the actual pair-wise test. For example, broad-phase collision detection methods, such as Bounding Volume Hierarchy and spatial division methods like Octree, KB-Tree, BSP-Tree and spatial hashing method, largely reduce unnecessary testing. And narrow-phase collision detection methods, such as intersection testing between triangles, distance field, layered depth image algorithm, provide actual contact information.

3.3 Contact Resolution

While detecting collision, some useful information such as intersection region and penetration depth can be gathered. With this information, objects can be separated one to another. Basic concept to resolve contact is to change velocity and position of each object, or to apply some force to keep away from each other. There are three main methods to respond to collision: penalty-based method, constraint-based method and impulse-based method.

In real world, rigid bodies do not penetrate each other because contact force will separate them. Penalty-based methods simply treat this force as a spring. Spring system can behavior as a harmonic oscillator under Hooks Law or defined as exponential spring [15]. When collision happens, add a compressed spring between objects and the spring force pushes each object until contact resolved. This method is fast, easy to implement, however, have potential drawback: it is hard to assign physically meaningful spring constant. Moreover, too large constant leads to over reaction while too small constant results in more penetration.

While penalty-based methods apply to deformable unclosed surface such as cloth, penalty force often occurred before contact since cloth does not actually have

“inner side”. This penalty method that creates a spring force while two elements are close enough and pushes against each other is often called repulsive force.

Constraint-based methods resolve contact by adding a constraint to move the penetrated objects away. These methods resemble physicists’ view of world. They set

determine the final velocity. That is, the constraint forces the objects changing in position, velocity or force to fulfill the purpose. For example, if two objects penetrated to each other, the velocity each object is then forced to change by constraint in order to separate. The change of velocity implies impulse and contact force which can be solved by a linear equation Fc =KΔv, while K is a square matrix determined by the different integrator. This method is more physically correct.

However, the calculation of contact force requires integration method. The complexity may vary by using different integration method. For example, implicit integration method can be in high dimension for object like cloth.

Impulse-based methods treats even continuous contact as a type of impact +

= +

=

tt Fdt Pt Pt

J (3.1)

and use a coefficient of restitution to determine the post-impact velocity of the object [11][19][10][18]. This approach is easier to formulate, but could require a large number of iterations to resolve the resulting impact sequences especially when multipoint collision happens. Although it’s notable for its ability to correctly stops all collisions, but computational cost can be extremely high for multipoint contact. And moreover, it has its own problems when trying to simulate resting contact with complex models and the wobbling problem remains and iteration is generally necessary to remove all collisions.

Chapter 4

Overview of System

Our system couples the main physic-based models: rigid body and cloth. In this chapter, we will discuss about the property of these models in detail. Moreover, we take advantage of some current data structure for collision detection and response in order to facilitate the methods used in next chapter.

4.1 Rigid Object

4.1.1 Data Representation

Rigid objects are mostly the simplest model to represent in computer graphic. It can be analyzed with a set of parameters

{

M,I,pv,vv,Ov

}

. M is the total mass of the

Ixy =

(xy)dm (4.4) Ixz =

(xz)dm (4.5) Iyz =

(yz)dm (4.6) For a simple uniformly-dense sphere with radius of r, inertia tensor can be derived as

2 is the velocity of the center of mass. O is the orientation of the object along the rotation center, often represented with quaternion ⎟⎟⎠

⎜⎜ ⎞ rotation angle and u is a unit length rotation axis, and then a 3×3 rotation matrix can be derived from this quaternion. Usually the rotation center is the mass center. ωv is angular velocity. A typical rigid body is shown in Fig 4.1 with parameters.

Figure 4.1: Rigid body with mass center at pv and a force acted on pv a

If a force F acts on a rigid object at pv , it can be decomposed into the sub-force a which acts to center of mass and the sub-force which acts to orientation. That is, force parallels to rˆ , where rˆ is a vector pointing to the center of the mass (i.e.

r

And force perpendicular to rˆ changes the angular velocity and orientation, O and ωv. The force can be contact force, constraint force or friction. And by equations (4.7)(4.8)(4.9), the motion of rigid body can be easily computed.

4.1.2 Data Structure for Collision

There are plenty of data structures to solve collision detection problem for rigid body. One of the methods called Distance Field is very suitable for the collision between rigid and deformable-object collision detection and is able to efficiently provide sufficient collision information in run-time.

This method defines space around rigid body with an implicit field function:

R R

D: 3 → so that every point in space is assigned a signed distance value which is the shortest distance to move inside or outside the object. To illustrate, such field can easily be defined for a spherical object with center of (x, y, z) and radius of R as D(p)=R

( p

x

x )

2+

( p

y

y )

2+

( p

z

z )

2, (4.10) where D<0 if p is inside sphere, D>0 if p is outside and D=0 if p is on the surface (Fig 4.2).

Figure 4.3: Distance map in [30]

While most of model are too complicated to represent with a formula, a mapping method called “Distance Map” were proposed. As shown in Fig 4.3, it discretizes space into subspaces and then maps the pre-computed distance value to each subspace unit. Usually space is subdivided into Uniform 3D grids or Octree/ BSP Tree/

KD-Tree for memory-saving purpose. Despite resolution problem, memory cost and pre-computational time, this method is quit suitable for collision detection problem to resolve contact of a particle of deformable object from a rigid object while a particle

can be easily removed from penetration with simply mapping function. And moreover not to mention the benefit from its independently testing with potential to implement in parallelism algorithm that is quit efficient in recent SIMD graphic hardware.

Therefore, a 3D cubic volume texture can represent as a basic bounding volume for rigid object and distance information such as signed distance and normal vector can be stored within texels.

4.2 Cloth Object

4.2.1 Data Representation

There are two main methods to represent a physic model for cloth: discrete model and continuous models. Continuous model method such as finite element method produces an equilibration state for cloth by minimizing energy for every element. This method requires solving non-linear system with large computational time so that is not suited for time-critical runtime simulation but actually able to produces accurate physical model. As long as we require efficiency, a discrete model, mass-spring system, is adopted.

Mass-spring system analyzes physics of cloth as a number of mass particles connected with springs so that springs keep particle moving limitedly under cloth’s original structure from dispersion. Provot [25] proposed a mass-spring system for textiles using a rectangular mesh in which particles are connected with structural springs, diagonal springs and interleaving springs.

As shown in Fig 4.4, structural springs (Fig 4.4 (a)) are created between each pair of horizontal and vertical particle neighbors to resist stretching and compression of the cloth with very high spring coefficients; shearing springs (Fig 4.4 (b)) are used to make sure that cloth does not shear and spring coefficients are usually set lesser than those of structural springs; and finally bending springs (Fig 4.4 (c)) are created for preventing sharp ridges from cloth while folded. OpenTissue system [22]

proposed a more general structure for unstructured mesh such as ordinary mesh. It constructs structural springs with first neighbors of each particle, and connects second, third, or more further neighbors as shearing and bending force as following Fig 4.5.

Figure 4.4: Structural, shearing, bending springs for rectangular cloth

Figure 4.5: OpenTissue spring structure

Every spring force is governed by Hooks Law

4.2.2 Data Structure For Collision

To avoid full collision test for every particle and rigid object, a broad-phase collision detection strategy is required in order to reduce unnecessary testing pair. One major and efficient strategy is Bounding Volume Hierarchy. Among many bounding volume hierarchy strategies such as OBB, it appears that axis-aligned bounding box hierarchy performs better than other bounding volumes method for a highly deformable object such as cloth. It is because of its facility and efficiency in updating hierarchies.

Compare to original testing complexity of n, by applying AABB the complexity can be reduced to O(n) for bottom-up updating and O(log(n)) for testing. Although total complexity remains O(n) in the worst case, it is still useful if testing process is much more complicated than update process. Moreover, updating time can be reduced by canceling updating sometime and enlarge the BVH under the assumption of

Beside BVH, repulsion force is usually applied before penetration occurred. The repulsion region can be a spherical area around a particle or a given thickness for each triangle. Jansson et al. [17] treated such repulsion as spring force around particles.

When two particles move within a nominal distance, a spring is created to push each other away (Fig 4.6, Fig 4.7). With delicate spring constant, this repulsive force can exactly prevent objects from being collided, though constant assignment can be an important issue. Bridon et al. mentioned in [7] that repulsion can reduce the number of collision but cannot guarantee no penetration so that advanced geometric collision method is required.

Figure 4.6: Repulsion region for every particle

Figure 4.7: Spring applied while particles move within nominal distance

However, in this thesis repulsion is used for a collision alleviation method which will be described in detail in chapter 5. To combine this area with bounding volume, bounding boxes can be enlarge a little to cover this repulsion area so that bounding box can also used to detect the repulsion region intersection.

相關文件