Trajectoires simulées

Preview:

Citation preview

MUX104Synthèsed'imageetréalitévirtuelle

TrajectoiressimuléesPierreCubaudcubaud@cnam.frmars2020

Planducours•Dynamiquedupoint•Particules•Nuées•Passageausolide(indéformable)

1. Dynamique du point

Formulefondamentaledeladynamique:

F∑ = ma avec a =

d2x dt 2

d2y dt 2

d2z dt 2

#

$

% % %

&

'

( ( (

=

˙ ̇ x ˙ ̇ y ˙ ̇ z

#

$

% % %

&

'

( ( (

[PAR]

Exempled’unprojectiledanslevide

F∑ =

0−mg

0

$

%

& & &

'

(

) ) )

= m! a =

m˙ ̇ x m˙ ̇ y m˙ ̇ z

$

%

& & &

'

(

) ) ) ⇒

˙ x = v0 cosα˙ y = v0 sinα − gt

˙ z = 0

,

- .

/ .

x = v0t cosα

y = v0t sinα − 12

gt 2

z = 0

,

- .

/ .

avecg=9.81m/s^2

demo

Choix du vecteur Vo et ajout des rebonds :

demo

Leprojectiledansl’air

Résolutionparintégrationnumérique:deEuleràRunge-Kutta

φ

-mgpesanteur

résistancedel’air

F(v)

at =dvdt

an = −v dφdt

dvdφ

= v tanφ +F(v)

mgcosφ#

$ %

&

' ( Equationdifférentielle:

2.Particules

"GenesisEffectfromStarTrekII:TheWrathofKhan»(ByWilliamReeves)Videoclipfrom"ParticleDreams"byKarlSims.

Hypothèses:•lesparticulesn'entrentpasencollisionentreelles•neprojettentdel'ombrequesurlerestedumonde•neréflechissentpaslalumière,sontdessourcesdelumièresponctuelles•duréedeviefinie(aléatoire).Ongénéredes100kpart.dansuneanimation.QuelquesKactifssimultanément

Applications:explosions,feux,...

W. T. Reeves, "Particle Systems - A Technique for Modeling a Class of Fuzzy Objects", Computer Graphics, vol. 17, no. 3, pp 359-376, 1983

Cycle de vie : pour chaque plage temporelle faire : 1.  générer N nouvelles particules 2.  donner des attributs aux nouvelles particules 3.  détruire les particules dont la durée de vie est passée 4.  animer les particules restantes : gestion collision+ombre 5.  (les collisions peuvent être destructives, le hors-champs aussi) 6.  dessiner les particules restantes

[PAR]

N=moyenne+aléa()*plageExempledeloialéatoireàutiliserpouraléa():- uniformedans[-1,+1]- normale(0,1)- loidePoisson- etc...

ATTENTION:plage≠variance(cfFoley-vanDamp.1032,etc.)plutôtécarttype(siloiNormale,maispaspourlesautres)

Générationdesparticules

p(N)

N

Attributsdelaparticule:déterministesoualéatoires- position- vitesse- paramètresdeforme- couleur- transparence- duréedevie(ennombred’images)

en+pourl'animation:- vecteursommedesforces- masse

[PAR]

http://www.cs.wpi.edu/~matt/courses/cs563/talks/psys.html

Exemplesimple:pagewebdeAllenMartin

Particlesarelaidoutinacirculardiscstructureandgivenaninitialupwardsvelocity.Whentheparticle'slifetimeisexpireditisremoved.Iftheparticlecollideswiththegrounditremainsstationary

SimilartoExample1,butparticlesareinitiallyclusterednearasinglepoint.

rque:onpeutfairedu«motionblur»endessinantdestraitsaulieudepoints

In this example the particles are initially clustered in a point similar to Example 2 but particles are constantly being regenerated at the start point. The effect looks very much like a fire or torch burning.

In this example the point where the particles are being regenerated is translated in a circular motion through time. The effect looks like a wick burning.

In this example there are multiple generation points. The generation point are randomly created within a square boundary on the ground at random times during the sequence. The particles are created in a cluster at each generation point and are not regenerated. The result looks like a series of volcanos erupting or bombs exploding

3.Nuées

Différentstypesdegroupesd’objets:

Typedegroupe

Nombred'éléments

Loisphysiques Intelligence

particules trèsgrand nombreusesdsl'env.

aucune=>comportementémergent

bandes=nuées=«boids»

moyen dsl'env.+interne

limitée

individu faible petitnombre grande

C. W. Reynolds, "Flocks, Herds, and Schools: A Distributed Behavioral Model", Computer Graphics, vol. 21, no. 4, pp 25-34, 1987.

VOIRSONSITE!!http://www.red3d.com/cwr/boids

video

Separation: steer to avoid crowding local flockmates

Alignment: steer towards the average heading of local flockmates

Cohesion: steer to move toward the average position of local flockmates

http://www.red3d.com/cwr/boids

a boid's neighborhood

deux forces concurrentes : - la cohésion au sein du groupe - l’évitement de collision (prioritaire)

Exemple de programmation avec Processing :

demo

http://mrl.nyu.edu/~perlin/experiments/polly/follow.html

unautreexemple(aveccode):sitedeKenPERLIN

[PAR]

Esquivedecollision

[PAR]

[PAR]

versl’autonomie

[PAR]

http://ligwww.epfl.ch/

4. Passage au solide indéformable

(re)voir"Gravity"

Anglesd’Euler:

=lacet=tangage

=roulage

Mécaniquedusolideenrotation(Wikipedia)

F=m*a C=I*αeffort=inertie*variation

Alire:wikipedia

Boucledesimulation

Intégration du temps

Détection collisions

Construction de J

Correction positions

Correction vitesses

Affichage

Construction de J

Calcul forces de

contraintes

Calcul forces externes

Calcul forces externes +

ou

Karma(soc.MathEngine)utilisédansRenderware

Moteursphysiques

Uneapplicationludiquemajeure:le«cassebriques»

Docencoreenligneen2019:https://api.unrealengine.com/udk/Two/rsrc/Two/KarmaReference/KarmaUserGuide.pdf

Àvoiraussi

http://www.ode.org/