time-dependent shapes (i). introductionintroduction in physical simulation collisions occur when two...
TRANSCRIPT
Time-dependent Time-dependent Shapes (I)Shapes (I)
IntroductionIntroductionIntroductionIntroductionIn physical simulation collisions occur when two In physical simulation collisions occur when two objects move through space and hit one anotherobjects move through space and hit one anotherWhenever two objects attempt to inter-penetrate Whenever two objects attempt to inter-penetrate each other, it is called as a each other, it is called as a collisioncollision. The related . The related issue is issue is responseresponse to collisions once they are detected to collisions once they are detectedA straightforward method of collision detection A straightforward method of collision detection involves the solution of a sequence of static involves the solution of a sequence of static problems one per time stepproblems one per time step ballmovie2.aviballmovie2.avi
What is a Motion?What is a Motion?
Definition of an Object’s Definition of an Object’s ConfigurationConfiguration
The The configurationconfiguration of an object is a of an object is a specification of the positions of all the specification of the positions of all the points in this object relative to a fixed points in this object relative to a fixed coordinate systemcoordinate system
Usually it is expressed as a “vector” of Usually it is expressed as a “vector” of position and orientation parametersposition and orientation parameters
qq11 qq22
qq33
qqnn
q=(qq=(q11,…,q,…,qnn))
Rigid Object ExampleRigid Object Example
xx
yy
reference pointreference point
robotrobotreference directionreference direction
workspaceworkspace
Object’s configuration is: q = (x,y,Object’s configuration is: q = (x,y,))
In a 3-D workspace q would be of the form (x,y,z,In a 3-D workspace q would be of the form (x,y,z,))
Disc Robot in 2-D Disc Robot in 2-D WorkspaceWorkspace
C-Obstacle for C-Obstacle for Articulated RobotArticulated Robot
Collision detectionCollision detection
Illustration of a time-Illustration of a time-dependent shape dependent shape
Collision detection for particles
Collision detection for particles
Consideration of a problem of nonoverlapping arrangements of D-dimensional spheres, D = 1,2,3, confined to a “rectangular” region d of size L1xL2x...xLD leads to search of an interaction time of particlesLet the center positions of the N spheres in d be denoted by
the set of vectors r1...rN. For two spheres with the diameters a1 and a2, interaction time t is the least positive real solution of the equation
At2 + 2Bt +C =0,
which is derived from |r +vt|2 = (a0t)2, where a0 = a1 + a2
Collision detection for polygons
Collision detection for polygons
A correct test must consider edges and trianglesHowever, in many cases merely testing points versus triangles produces acceptable resultsPolygon-polygon collision detection is performed by testing for the penetration of each vertex point of one polygon through the plane of the other and by checking that no two edges intersect
Collision detection for polygons
Collision detection for polygons
Figure illustrates path point and triangle intersection
This technique is used to detect collision between flexible surfaces. Two cases are considered depending on whether the surface polygon is fixed or moving
Collision detection for polygons
Collision detection for polygons
When the surface polygon is fixed [a triangle with vertices (P0,P1,P2)], the parametric vector equation is given by
P + (P’ - P)t = P0 + (P1 - P0)u + (P2 - P0)v, where P and P’ are the beginning and ending position of the point, u and v are the parametric variables for the plane defined by the triangle and t is a time variable for the simulation step By solving this system for t, u,v one determines whether the point has intersected the triangle during the time step by checking the conditions 0 t 1, u 0, and u + v 1
Collision detection for polygons
Collision detection for polygons
When the surface polygon is moving, moving, the following parametric vector equation is setup:
P + V t = P0 + V0t +((P1 - P0) + (V1 - V0)t)u + ((P2 - P0) +
(V2 - V0)t)v,
where P is the point with velocity V per time step, V0, V1, V2 are the respective velocities of the points P0, P1, P2
If we eliminate u and v from the three component equations, we get a fifth order polynomial in t, which can be solved numerically. Each value of t thus arrived at is used to get values for u and v by back substitution, and then the standard 0 t 1, u 0, and u + v 1 conditions are used to determine whether a collision has occurred.
Collision detection for convex polyhedra
Collision detection for convex polyhedra
The two polyhedra are assumed to be convex ones; concave polyhedra can be decomposed into collections of convex onesThe method for detecting collisions is based on the Cyrus-Beck clipping algorithm
The two-dimensional Cyrus-beck algorithm tells whether a point is inside a convex polygon. It takes the dot product of each side’s outward normal vector (n) with a vector from some point (v) on the side to the point in question (p)
Collision detection for time Collision detection for time dependent shapesdependent shapes
Most algorithms described in the literature Most algorithms described in the literature deal with rigid bodies and are based on some deal with rigid bodies and are based on some kind of hierarchical representations. The kind of hierarchical representations. The alternative approach is based on the idea of alternative approach is based on the idea of “sensor particles”“sensor particles”
Collision detection based on a particles Collision detection based on a particles paradigm between complex geometric objects paradigm between complex geometric objects represented by polygonal models and represented by polygonal models and undergoing rigid motions is discussed undergoing rigid motions is discussed
Quite interesting that almost the same Quite interesting that almost the same approach can be used in geometry modeling – approach can be used in geometry modeling – mesh generation and inhancement mesh generation and inhancement
Examples of particles Examples of particles distributiondistribution
(a) The model of Rocker Arm (a) The model of Rocker Arm with randomly distributed with randomly distributed particlesparticles
(b) Final distribution of (b) Final distribution of particles on the model of particles on the model of Rocker ArmRocker Arm
(c) The Dragon model with (c) The Dragon model with randomly distributed particlesrandomly distributed particles
(d) Final distribution of (d) Final distribution of particles on the Dragon modelparticles on the Dragon model
Sensor particlesSensor particles
Sensor particles are interacting Sensor particles are interacting particles distributed on a surface particles distributed on a surface
Two types of particles that interact Two types of particles that interact in a special way are used for in a special way are used for determining the minimum distance determining the minimum distance between two models between two models
AssumptionsAssumptions Each model has a surface that is for the Each model has a surface that is for the
most part plainmost part plain Face's adjacency information is available, Face's adjacency information is available,
i.e., there is a list of neighbor faces for each i.e., there is a list of neighbor faces for each model point, or it can easily be created model point, or it can easily be created
Adjacency information does not change Adjacency information does not change during deformation, which means that during deformation, which means that bodies do not change their topology bodies do not change their topology
The model remains plain for the most part The model remains plain for the most part and the number of convex parts does not and the number of convex parts does not increase greatly during deformation increase greatly during deformation
Particle Interaction Particle Interaction Radial attractive and Radial attractive and
repulsive forces act repulsive forces act on particleson particles
Unlike the law for Unlike the law for electric charges, the electric charges, the laws for repulsive and laws for repulsive and attractive forces can attractive forces can be differentbe different
RReffeff is the effective is the effective radius of attractionradius of attraction
Particle Interaction Particle Interaction (cont)(cont)
A) Initial A) Initial positionposition
B) After one B) After one simulation simulation stepstep
C) After one C) After one interaction interaction stepstep
Particles MovementParticles Movement
In the simplest case, particles can be In the simplest case, particles can be located only at vertices. In this case, we located only at vertices. In this case, we can easily calculate the potential of forces can easily calculate the potential of forces in every neighboring vertex and move a in every neighboring vertex and move a particle to the vertex where the potential particle to the vertex where the potential has the minimum value has the minimum value
This technique can be generalized for This technique can be generalized for cases when the particle can be located on cases when the particle can be located on edges and facesedges and faces
Collision Query Collision Query
At every collision query we turn on an At every collision query we turn on an interaction between particles and wait for the interaction between particles and wait for the particle system to relaxparticle system to relax
Two numbers, Nmax and Nmin, are used to Two numbers, Nmax and Nmin, are used to control a particle system to reach almost control a particle system to reach almost relaxed state. Nmax is the maximum total relaxed state. Nmax is the maximum total number of interaction steps and Nmin is the number of interaction steps and Nmin is the minimum number of moving particles. minimum number of moving particles. Therefore, we wait until either the number of Therefore, we wait until either the number of particles moved in interaction step is less then particles moved in interaction step is less then Nmin or the number of interaction steps Nmin or the number of interaction steps becomes equal to Nmaxbecomes equal to Nmax
Collision Query (cont)Collision Query (cont)
The values of Nmin and Nmax depend on The values of Nmin and Nmax depend on the model's geometry and number of the model's geometry and number of particles n. Nmax should be particles n. Nmax should be approximately equal to the number of approximately equal to the number of vertices between particles placed on the vertices between particles placed on the model. Experiments show that about 10% model. Experiments show that about 10% of particles, in average, are placed near of particles, in average, are placed near equilibrium position. By this means Nmin equilibrium position. By this means Nmin should be about 10 times smaller then should be about 10 times smaller then number of particles nnumber of particles n
Collision Query (cont)Collision Query (cont)
The complexity of performing collision query is The complexity of performing collision query is O(nO(n22). Since the number of particles n is ). Since the number of particles n is essentially smaller than the number of essentially smaller than the number of polygons, this complexity allows us to perform polygons, this complexity allows us to perform fast collision queries even for models with a fast collision queries even for models with a large number of polygonslarge number of polygons
Performance can also be noticeably improved, Performance can also be noticeably improved, by using caching on the initial steps. If by using caching on the initial steps. If positional relationship changes slowly, the positional relationship changes slowly, the influence of distant particles remains almost influence of distant particles remains almost constant. Thus we can efficiently cache this constant. Thus we can efficiently cache this influenceinfluence
Results Results Illustration of particle distribution.Illustration of particle distribution. Benchmarks. Collision detection between two Benchmarks. Collision detection between two
polygonal models of letters "W", defined by polygonal models of letters "W", defined by 11920 polygons, with 5 particles on each 11920 polygons, with 5 particles on each model. The average time needed to perform model. The average time needed to perform a collision detection query on active interval a collision detection query on active interval (queries nos. 950-1984) was 12.67 ms., and (queries nos. 950-1984) was 12.67 ms., and the maximum time was 47 ms.; average time the maximum time was 47 ms.; average time during the "warming" steps (queries nos. 1-during the "warming" steps (queries nos. 1-49) was 12.06 ms., maximum time was 47 49) was 12.06 ms., maximum time was 47 ms. alsoms. also
Results (cont)Results (cont)
Illustration of Illustration of collision collision detection detection between two between two models models undergoing undergoing deformationsdeformations
collision_and_csrcollision_and_csrbf1.mpgbf1.mpg
Motion of Rigid Bodies Motion of Rigid Bodies Under External Forces and Under External Forces and
TorquesTorques The general motion of a rigid body can be The general motion of a rigid body can be
decomposed decomposed • into a linear motion of a point mass equal to that of into a linear motion of a point mass equal to that of
the body located at the center of mass of the body the body located at the center of mass of the body under an external force andunder an external force and
• a rotational motion about the center of mass under a rotational motion about the center of mass under an external torque.an external torque.
• scrunchies_2160_comp.aviscrunchies_2160_comp.avi
Motion of Rigid Bodies Motion of Rigid Bodies Under External Forces and Under External Forces and
TorquesTorques The linear motion under a force The linear motion under a force FF can be can be
calculated by solving the set of coupled calculated by solving the set of coupled differential equationsdifferential equations
VV = = FF/m,/m,XX = = V, V,where m is the mass of the object, X is the where m is the mass of the object, X is the
positionpositionvector, and V is the linear velocityvector, and V is the linear velocity
Motion of Rigid Bodies Motion of Rigid Bodies Under External Forces and Under External Forces and
TorquesTorques Euler EquationsEuler Equations If we choose principal axes as the body fixed axes we get a set of If we choose principal axes as the body fixed axes we get a set of
simplified coupled first order differential equations for the angular velocity simplified coupled first order differential equations for the angular velocity WW, known as the Euler equations:, known as the Euler equations:
IIx x WWx +(x +(IIz -z -IIy)y)WWzzWWy = y = NNxx
IIy y WWy +(y +(IIx -x -IIz)z)WWxxWWz = z = NNyy
IIz z WWz +(z +(IIy -y -IIx)x)WWyyWWx = x = NNzz The The x,y,zx,y,z are the directions of the principal axes, are the directions of the principal axes, II is the moment of inertia is the moment of inertia
tensor of the body. It is important to realize that for any arbitrary shaped tensor of the body. It is important to realize that for any arbitrary shaped objects, one can find principal axes and the principal moments of inertia.objects, one can find principal axes and the principal moments of inertia.
Motion of Rigid Bodies Motion of Rigid Bodies Under External Forces and Under External Forces and
TorquesTorques Euler EquationsEuler Equations These along with These along with
TTx = x = WWxxTTy = y = WWyyTTz = z = WWzz
where where TTss are the orientations in the principal are the orientations in the principal axes coordinate, form a set which can be solved by axes coordinate, form a set which can be solved by a numerical technique such as Rung-Kutta method.a numerical technique such as Rung-Kutta method.
Motion of Rigid Bodies Motion of Rigid Bodies Under External Forces and Under External Forces and
TorquesTorques Impact DynamicsImpact Dynamics When two bodies collide and When two bodies collide and
the contact area of one of the the contact area of one of the bodies is locally planar, one bodies is locally planar, one can define the normal can define the normal NN to to the tangent surface the tangent surface
Calculate the Calculate the linear linear momentummomentum pp = = mmvv
And theAnd the torque torque = r = rF, F, wherewhere F F is the force acting is the force acting on the centre of mass on the centre of mass
Penalty-based Multibody Penalty-based Multibody AnimationAnimation
In penalty-based multibody animation, a In penalty-based multibody animation, a spring-damper systemspring-damper system is used for penalizing is used for penalizing penetrations.penetrations.
A spring-damper system behaves like a A spring-damper system behaves like a harmonic oscilator in classical mechanics. harmonic oscilator in classical mechanics.
Spring-damper models are even found in Spring-damper models are even found in biomechanical muscle models.biomechanical muscle models.
Penalty-based Multibody Penalty-based Multibody AnimationAnimation
The basicsThe basics• The motion of a single rigid body is The motion of a single rigid body is
described in the Newton-Euler equations.described in the Newton-Euler equations.• The center of mass is given by The center of mass is given by rr, the , the
orientation is given by the quaternion orientation is given by the quaternion qq and the linear and angular velocities are and the linear and angular velocities are given by given by vv and and
• One needs to find the values of the force One needs to find the values of the force FF and torque and torque at a given instant in time at a given instant in time in order to perform the numerical in order to perform the numerical integration.integration.
Penalty-based Multibody Penalty-based Multibody AnimationAnimation
The basicsThe basics• In order to compute, In order to compute,
the contact forces the contact forces springs are inserted at springs are inserted at all penetrations as all penetrations as shown in Figureshown in Figure
• The springs will try to The springs will try to remove the remove the penetrationspenetrations
• The springs penalize The springs penalize penetrationspenetrations
Penalty-based Multibody Penalty-based Multibody AnimationAnimation
The basicsThe basics• The contact force from each point of The contact force from each point of
contact is thus computed as a spring contact is thus computed as a spring force.force.
• Call the exernal contributionsCall the exernal contributions f fext and and ext and the and the ii’th spring force ’th spring force ffspring and and spring . .
• Now the total force an torque are Now the total force an torque are computed ascomputed as
• In case of gravity being the only external In case of gravity being the only external force, we have force, we have ffext = = mmgg, , ext = 0. = 0.
Penalty-based Multibody Penalty-based Multibody AnimationAnimation
The basicsThe basics The simulation loop of the penalty The simulation loop of the penalty
method can be summarized asmethod can be summarized as• Detect contact pointsDetect contact points• Compute and accumulate spring Compute and accumulate spring
forcesforces• Integrate equations of motion Integrate equations of motion
forward in timeforward in time There are, however, several There are, however, several
difficulties associated with it difficulties associated with it
Penalty-based Multibody Penalty-based Multibody AnimationAnimation
The basicsThe basics• First of all it is not trivial to First of all it is not trivial to
compute satisfactory contact compute satisfactory contact normals or penetrating depths (lack normals or penetrating depths (lack of global knowledje).of global knowledje).
Penalty-based Multibody Penalty-based Multibody AnimationAnimation
The basicsThe basics• Some contact points Some contact points
like the face-face case like the face-face case appearing in a box appearing in a box stack is difficult to stack is difficult to handle.handle.
• To alleviate this To alleviate this problem, researches problem, researches have tried to sample have tried to sample the entire contact the entire contact region with contact region with contact points.points.
Penalty-based Multibody Penalty-based Multibody AnimationAnimation
Modeling FrictionModeling Friction• Friction is very imporatnt to seem physically Friction is very imporatnt to seem physically
plausible fo r a human observer.plausible fo r a human observer.• It seems reasonable to use a spring-damper It seems reasonable to use a spring-damper
system for system for friction forcefriction force..• At first point of contact, an anchor point, At first point of contact, an anchor point, aa, is , is
used.used.• The friction is determined by the spring force The friction is determined by the spring force
stemming from the zero-length spring with stemming from the zero-length spring with spring coefficient spring coefficient kk between the anchor point between the anchor point and the current positionand the current position p p of the contact of the contact point.point.
FFfriction friction = = kk((aa – – pp).).
Penalty-based Multibody Penalty-based Multibody AnimationAnimation
Modeling FrictionModeling Friction• The general idea is illustrated in The general idea is illustrated in
FigureFigure• During the simulation we keep an During the simulation we keep an
eye on whether the following eye on whether the following condition holdscondition holds
FFfrictionfriction FFnormalnormal..• Here Here is the coefficient of friction. is the coefficient of friction.
FFnormalnormal is the normal force. is the normal force.• If the condition is fulfilled we have If the condition is fulfilled we have
static friction and we do nothing.static friction and we do nothing.• On the other hand we have On the other hand we have
dynamic friction.dynamic friction.