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ϒ8!?aqr;0Aڋ`L#(6*W'1y_UMiR35^RYu/畅ֶp{g6^;kVmL(BAǩfU²s#v]1K]."7cĆ3Z$8cAvH\dc\GT\&u,8)e;,lQ_'1鈗QKi%]&1v庾"KCV 9^G/N
nFҞTAP20e^9RA>*fv
}a ːռ rB"r@2 Yǥ!gII,+eAN#
NG+bſ~mXS60ߛm
:Aɷ,\#KW"ΈCj}r6袕%ΣUk
g6]:+87m[ZqPspaubW& e~)3T=s}&H{hpOM?af#K?X8ɺ~J\0Tʍ TP8ZW)P72t0B8xTjA>mnRޘf6D*XeA̲3ISbARJߡ^!E&{~;g&3
j@eO#g`k/ўǹ
>}`i܄;~ysG0?J֯
+?ABCDE/B$(Jd0F`B$%*t'/.;F`B$9B{ 1 S?s+`B$IID:_`B$Nr{K[ 1`B$J#(2`B$2 tN`B$v0Ƀ)Z
I+
G`B$uʎK 2k37`B$jo&ear(:!`B$(*z@%`B$3.`$`$`$`$`B$P8ZW)P72t0?1`c$ h@huʚ;2Nʚ;g4=d=ds{(m
ppp@<4!d!d@`gʚ;<4dddd@`gʚ;<4BdBd@`ʚ;ph___PPT2001D<4X?8, $cs533dwinter2005O8, $cs533dwinter2005=bVNoteszProblems with assignment 1?
Issues with Windows + Visual C++& &""gNumerical Implementation 1Get candidate x(t+"t)
Check to see if x(t+"t) is inside object (interference)
If so
Get normal n at t+"t
Get new velocity v from collision response formulas and average v
Replay x(t+"t)=x(t)+"tv&ToTohRobustness?If a particle penetrates an object at end of candidate time step, we fix that
But new position (after collision processing) could penetrate another object!
Maybe this is finelet it go until next time step
But then collision formulas are on shaky ground&
Switch to repulsion impulse if x(t) and x(t+"t) both penetrate
Find "vN proportional to final penetration depth, apply friction as usualD>J>
BDAiMaking it more robustOther alternative:
After collision, check if new x(t+"t) also penetrates
If so, assume a 2nd collision happened during the time step: process that one
Check again, repeat until no penetration
To avoid infinite loop make sure you lose kinetic energy (don t take perfectly elastic bounces, at least not after first time through)
Let s write that down: &LLjNumerical Implementation 2Get candidate x(t+"t)
While x(t+"t) is inside object (interference)
Get normal n at t+"t
Get new velocity v from collision response formulas and average v
Replay x(t+"t)=x(t) + "t v
Now can guarantee that if we start outside objects, we end up outside objects<DsNDsNkMicroCollisionsvThese are microcollision algorithms
Contact is modeled as a sequence of small collisions
We re replacing a continuous contact force with a sequence of collision impulses
Is this a good idea?
[block on incline example]
More philosophical question: how can contact possibly begin without fully inelastic collision?j\Q_\Q_lImproving MicroCollisionsReally need to treat contact and collision differently, even if we use the same friction formulas
Idea:
Collision occurs at start of time step
Contact occurs during whole duration of time step&hYhYmNumerical Implementation 3PStart at x(t) with velocity v(t), get candidate position x(t+"t)
Check if x(t+"t) penetrates object
If so, process elastic collision using v(t) from start of step, not average velocity
Replay from x(t) with modified v(t)
Could add "t"v to x(t+"t) instead of reintegrating
Repeat check a few (e.g. 3) times if you want
While x(t+"t) penetrates object
Process inelastic contact (e=0) using average v
Replay x(t+"t)=x(t)+"t vd Id nWhy does this work?If object resting on plane y=0, v(t)=0 though gravity will pull it down by t+"t
In the new algorithm, elastic bounce works with pregravity velocity v(t)=0
So no bounce
Then contact, which is inelastic, simply adds just enough "v to get back to v(t+"t)=0
Then x(t+"t)=0 too
NOTE: if e=0 anyways, no point in doing special first step  this algorithm is equivalent to the previous one
Vn
V doMoving objectspSame algorithms, and almost same formulas:
Need to look at relative velocityvparticlevobjectinstead of just particle velocity
As before, decompose into normal and tangential parts, process the collision, and reassemble a relative velocity
Add object velocity to relative velocity to get final particle velocity
Be careful when particles collide:
Same relative "v but account for equal and opposite forces/impulses with different masses&
+ZZ#Z\Z+#
#[,L
ZpMoving Objects& Also, be careful with interference/collision detection
Want to check for interference at end of time step, so use object positions there
Objects moving during time step mean more complicated trajectory intersection for collisions*77$ qCollision DetectionWe have basic time integration for particles in place now
Assumed we could just do interference detection, but&
Detecting collisions over particle trajectories can be dropped in for more robustness  algorithms don t change
But use the normal at the collision time*Z)Z)rGeometryThe plane is easy
Interference: y<0
Collision: y became negative
Normal: constant (0,1,0)
Can work out other analytic cases (e.g. sphere)
More generally: triangle meshes and level sets
Heightfields sometimes useful  permit a few simplifications in speeding up tests  but special case
Splines and subdivision surfaces generally too complicated, and not worth the effort
Blobbies, metaballs, and other implicits are usually not as well behaved as level sets
Pointset surfaces: becoming a hot topic\PHP_P:PH_:b
XN WsImplicit Surfaces2Define surface as where some scalar function of x,y,z is zero:
{x,y,z  F(x,y,z)=0}
Interior (can only do closed surfaces!) is where function is negative
{x,y,z  F(x,y,z)<0}
Outside is where it s positive
{x,y,z  F(x,y,z)>0}
Ground is F=y
Example: F=x2+y2+z21 is the unit sphere?ZZFZZZZ7Z?F
tTesting Implicit SurfacesInterference is simple:
Is F(x,y,z)<0?
Collision is a little trickier:
Assume constant velocityx(t+h)=x(t)+hv
Then solve for h: F(x(t+h))=0
This is the same as raytracing implicit surfaces&
But if moving, then need to solveF(x(t+h), t+h)=0
Try to bound when collision can occur (find a sign change in F) then use secant search \ZZ ZZ luImplicit Surface Normals Outward normal at surface is just
Most obvious thing to use for normal at a point inside the object (or anywhere in space) is the same formula
Gradient is steepestdescent direction, so hopefully points to closest spot on surface: direction to closest surface point is parallel to normal there
We really want the implicit function to be monotone as we move towards/away from the surface.ZZvBuilding Implicit Surfaces4Planes and spheres are useful, but want to be able to represent (approximate) any object
Obviously can write down any sort of functions, but want better control
Exercise: write down functions for some common shapes (e.g. cylinder?)
Constructive Solid Geometry (CSG)
Look at set operations on two objects
[Complement, Union, Intersection, & ]
Using primitive F() s, build up one massive F()
But only sharp edges& ZGZ"Z&Z%ZFZG"&%Fh1wGetting back to particles8 Metaballs , blobbies , &
Take your particle system, and write an implicit function:
Kernel function f is something smooth like a Gaussian
Strength a and radius r of each particle (and its position x) are up to you
Threshold t is also up to you (controls how thick the object is)HXZZXAP @8xProblems with theseThey work beautifully for some things!
Some machine parts, water droplets, goo, &
But, the more complex the surface, the more expensive F() is to evaluate
Need to get into more complicated data structures to speed up to acceptable
Hard to directly approximate any given geometry
Monotonicity  how reliable is the normal?
t'Z+ZIZLZ\Z'+IL\,K
ySigned DistanceNote infinitely many different F represent the same surface
What s the nicest F we can pick?
Obviously want smooth enough for gradient (almost everywhere)
It would be nice if gradient really did point to closest point on surface
Really nice (for repulsions etc.) if value indicated how far from surface
The answer: signed distanceKZKzDefining Signed DistanceGenerally use the letter f instead of F
Magnitude is the distance from the surface
Note that function is zero only at surface
Sign of f(x) indicates inside (<0) or outside(>0)
[examples: plane, sphere, 1d]D]+PD+P{Closest Point PropertyGradient is steepestascent direction
Therefore, in direction of closest point on surface (shortest distance between two points is a straight line)
The closest point is by definition distance f away
So closest point on surface from x isH&n[&nUnit Gradient PropertyLook along line from closest point on surface to x
Value is distance along line
Therefore directional derivative is 1:
But plug in the formula for n [work out]
So gradient is unit length:Z}Aside: Eikonal equation There s a PDE!
Called the Eikonal equation
Important for all sorts of things
Later in the course: figure out signed distance function by solving the PDE&
See Ian Mitchell s course on level sets for a lot more detail6>>~Aside: Spherical particleszWe have been assuming our particles were just points
With signed distance, can simulate nonzero radius spheres
Sphere of radius r intersects object if and only if f(x)<r
i.e. if and only if f(x)r<0
So looks just like points and an expanded version of the original implicit surface  normals are exactly the same, & boZZo4 w
Level SetsUse a discretized approximation of f
Instead of carrying around an exact formula store samples of f on a grid (or other structure)
Interpolate between grid points to get full definition (fast to evaluate!)
Almost always use trilinear [work out]
If the grid is fine enough, can approximate any wellbehaved closed surface
But if the features of the geometry are the same size as the grid spacing or smaller, expect BAD behaviour
Note that properties of signed distance only hold approximately!Z'ZLZkZAZ#'LkA,
Building Level SetsWe ll get into level sets more later on
Lots of tools for constructing them from other representations, for sculpting them directly, or simulating them&
For now: can assume given
Or CSG: union and intersection with min and max[show 1d]
Just do it grid point by grid point
Note that weird stuff could happen at subgrid resolution (with trilinear interpolation)
Or evaluate from analytical formulat(ZqZTZ}Z$Z(qT}$P3Normals
TWe do have a function F defined everywhere (with interpolation)
Could take its gradient and normalize
But (with trilinear) it s not smooth enough
Instead use numerical approximation for gradient:
Then, use trilinear interpolation to get (continuous) approximate gradient anywhere
Or instead apply finite difference formula to 6 trilinearly interpolated points (mathematically equivalent)
Normalize to get unitlength normal\@ZRZ5ZZ@R5>o
WpUEvaluating outside the gridCheck if evaluation point x is outside the grid
If outside  that s enough for interference test
But repulsion forces etc. may need an actual value
Most reasonable extrapolation:
A = distance to closest point on grid
B = f at that point
Lower bound on distance, correct asymptotically and continuous (if level set doesn t come to boundary of grid):
Or upper bound on distance:
XZZZ*Explicit SurfacesAn explicit formula to generate points on surface from 2D parameter space
E.g. x(a,b)=(a,0,b) is the plane
x is a convex combination of 3 fixed points chosen from a list of triples: triangle mesh
Interference  does a ray cast to infinity cross surface an odd number of times
Or check outward normal at closest point on surface, after finding it!
Note: can do open surfaces with no interior
tJZzZPZGZZJzPG$Explicit Surfaces& Collision  solve xsurface(a,b)=xparticle(t) for t in collision time step
Want first solution if one exists
Note: 3 unknowns in general: a,b,t
Normal: finally something easy
Explicit formula from crossproduct of partial derivativespJE;!E;, Normals not on the surfaceCan take our cue from implicit surfaces
Take the direction to the closest point (or a reasonable approximation of it)
Note that this kind of looks like figuring out signed distance (or some other implicit surface function)&(( Triangle MeshesSimplest general purpose explicit surface
Let s start with one triangle
Corners x1, x2, x3 means
Can then define implicit function for plane the triangle lies in:
Actually signed distance if we think of n as pointing outwards& H^@H
L@j
` 33` Sf3f` 33g` f` www3PP` ZXdbmo` \ғq>9y`Ӣ` 3f3ff` 3f3FKf` hk]wwwfܹ` ff>>\`Y{ff` R>& {p_/̴` 2FF]>?" dd@,?uKZ@ " n@uF`" d n?" dd@ @@``PP
@
` `p@@
(
6@ "``0
T Click to edit Master title style!
!$
0 "P `
RClick to edit Master text styles
Second level
Third level
Fourth level
Fifth level!
S
6 "0
T*
0`"`
6` "0
T*
lB
6DjJ"` T
<h@ ? 2FFf $Blank Presentationzr
(
0i P
P*
0pi
R*
d
c$ ?
0i
@
RClick to edit Master text styles
Second level
Third level
Fourth level
Fifth level!
S
6i `P
P*
6i `
R*
H
0h ? 33 @( l
0 P
P*
0
R*
6 `P
P*
60 `
R*
H
0h ? 33
0(
l
C@3``0
l
C3P `
H
0h ? 2FFf
0(
x
c$/``0
x
c$2P `
H
0h ? 2FF]
P0( ?
x
c$``0
x
c$P `
H
0h ? 2FF]
`( ?
l
Cp``0
l
CP `
H
0h ? 2FF]
p0( 2t2*2#2
x
c$P``0
x
c$0P `
H
0h ? 2FF]
0( ?
x
c$à``0
x
c$P `
H
0h ? 2FF]
0( 1412t2
x
c$p``0
x
c$pP `
H
0h ? 2FF]
0(
x
c$@~``0
x
c$~P `
H
0h ? 2FF]
0(
x
c$i``0
x
c$0iP `
H
0h ? 2FF]
0( (H
x
c$pg``0
x
c$0gP `
H
0h ? 2FF]
0( d((
x
c$g``0
x
c$PuP `
H
0h ? 2FF]
0( ++
x
c$p``0
x
c$zP `
H
0h ? 2FF]
0( ,21
x
c$py``0
x
c$}P `
H
0h ? 2FF]
0( `88
x
c$Px``0
x
c$vP `
H
0h ? 2FF]
0(
x
c$~``0
x
c$P `
H
0h ? 2FF]p
0( ,
x
c$P{``0
x
c$iP `
x
<A??P PH
0h ? 2FF]
@0( h
x
c$i``0
x
c$0iP `
H
0h ? 2FF]
P0( LXW
x
c$``0
x
c$pP `
x
<A?? ` x
<A??P
0 0KH
0h ? 2FF]
`0(
x
c$0``0
x
c$0P `
H
0h ? 2FF]
p0(
x
c$P``0
x
c$pOP `
H
0h ? 2FF]p
( ڦڦ
x
c$PT``0
x
c$0SP `
x
<A??p ` H
0h ? 2FF]p
(
x
c$R``0
x
c$OP `
x
<A??
4H
0h ? 2FF]
0(
x
c$PN``0
x
c$MP `
xDocumentSummaryInformation8@Current User.
<A?? Ix
<A??
kH
0h ? 2FF]p
$(
$x
$ c$0J``0
x
$ c$0MP `
x
$
<A?? ` 0`H
$0h ? 2FF]
(0(
(x
( c$R``0
x
( c$P `
H
(0h ? 2FF]
,0(
,x
, c$p``0
x
, c$P `
H
,0h ? 2FF]
00( VV
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resentationMicrosoft EquationNotesNumerical Implementation 1Robustness?Making it more robustNumerical Implementation 2MicroCollisionsImproving MicroCollisionsNumerical Implementation 3Why does this work?Moving objectsMoving Objects…Collision Detection GeometryImplicit SurfacesTesting Implicit SurfacesImplicit Surface NormalsBuilding Implicit SurfacesGetting back to particlesProblems with theseSigned DistanceDefining Signed DistanceClosest Point PropertyUnit Gradient PropertyAside: Eikonal equationAside: Spherical particlesLevel SetsBuilding Level SetsNormalsEvaluating outside the gridFonts UsedDesign TemplateEmbedded OLE Servers
Slide Titles 8@_PID_HLINKSAdhttp://www.fftw.org/http:/Equation Equation.30$Microsoft EquationEquation Equation.30$Microsoft EquationEquation Equation.30$Microsoft EquationEquation Equation.30$Microsoft EquationEquation Equation.30$Microsoft EquationEquation Equation.30$Microsoft EquationEquation Equation.30$Microsoft EquationEquation Equation.30$Microsoft EquationEquation Equation.30$Microsoft EquationEquation Equation.30$Microsoft EquationEquation Equation.30$Microsoft Equation/0DTimesgsortsPs&DOptimagsortsPs& DHelveticaortsPs&0DMonotype SortsPs&@DWingdingsortsPs&PDSymbolgsortsPs&
`.
@n?" dd@ @@``TL`# ,
%&'()*+./0123456789:;<=>?ABCD/B$(Jd0F`B$%*t'/.;F`B$9B{ 1 S?s+`B$IID:_`B$Nr{K[ 1`B$J#(2`B$2 tN`B$v0Ƀ)Z
I+
G`B$uʎK 2k37`B$jo&ear(:!`B$(*z@%`$`$`$`$`$`$`B$P8ZW)P72t0?1`c$ h@huʚ;2Nʚ;g4=d=ds{(m
ppp@<4!d!d@`gʚ;<4dddd@`gʚ;<4BdBd@`ʚ;ph___PPT2001D<4X?8, $cs533dwinter2005O8, $cs533dwinter2005_VNoteszProblems with assignment 1?
Issues with Windows + Visual C++& &""gNumerical Implementation 1Get candidate x(t+"t)
Check to see if x(t+"t) is inside object (interference)
If so
Get normal n at t+"t
Get new velocity v from collision response formulas and average v
Replay x(t+"t)=x(t)+"tv&ToTohRobustness?If a particle penetrates an object at end of candidate time step, we fix that
But new position (after collision processing) could penetrate another object!
Maybe this is finelet it go until next time step
But then collision formulas are on shaky ground&
Switch to repulsion impulse if x(t) and x(t+"t) both penetrate
Find "vN proportional to final penetration depth, apply friction as usualD>J>
BDAiMaking it more robustOther alternative:
After collision, check if new x(t+"t) also penetrates
If so, assume a 2nd collision happened during the time step: process that one
Check again, repeat until no penetration
To avoid infinite loop make sure you lose kinetic energy (don t take perfectly elastic bounces, at least not after first time through)
Let s write that down: &LLjNumerical Implementation 2Get candidate x(t+"t)
While x(t+"t) is inside object (interference)
Get normal n at t+"t
Get new velocity v from collision response formulas and average v
Replay x(t+"t)=x(t) + "t v
Now can guarantee that if we start outside objects, we end up outside objects<DsNDsNkMicroCollisionsvThese are microcollision algorithms
Contact is modeled as a sequence of small collisions
We re replacing a continuous contact force with a sequence of collision impulses
Is this a good idea?
[block on incline example]
More philosophical question: how can contact possibly begin without fully inelastic collision?j\Q_\Q_lImproving MicroCollisionsReally need to treat contact and collision differently, even if we use the same friction formulas
Idea:
Collision occurs at start of time step
Contact occurs during whole duration of time step&hYhYmNumerical Implementation 3PStart at x(t) with velocity v(t), get candidate position x(t+"t)
Check if x(t+"t) penetrates object
If so, process elastic collision using v(t) from start of step, not average velocity
Replay from x(t) with modified v(t)
Could add "t"v to x(t+"t) instead of reintegrating
Repeat check a few (e.g. 3) times if you want
While x(t+"t) penetrates object
Process inelastic contact (e=0) using average v
Replay x(t+"t)=x(t)+"t vd Id nWhy does this work?If object resting on plane y=0, v(t)=0 though gravity will pull it down by t+"t
In the new algorithm, elastic bounce works with pregravity velocity v(t)=0
So no bounce
Then contact, which is inelastic, simply adds just enough "v to get back to v(t+"t)=0
Then x(t+"t)=0 too
NOTE: if e=0 anyways, no point in doing special first step  this algorithm is equivalent to the previous one
Vn
V doMoving objectspSame algorithms, and almost same formulas:
Need to look at relative velocityvparticlevobjectinstead of just particle velocity
As before, decompose into normal and tangential parts, process the collision, and reassemble a relative velocity
Add object velocity to relative velocity to get final particle velocity
Be careful when particles collide:
Same relative "v but account for equal and opposite forces/impulses with different masses&
+ZZ#Z\Z+#
#[,L
ZpMoving Objects& Also, be careful with interference/collision detection
Want to check for interference at end of time step, so use object positions there
Objects moving during time step mean more complicated trajectory intersection for collisions*77$ qCollision DetectionWe have basic time integration for particles in place now
Assumed we could just do interference detection, but&
Detecting collisions over particle trajectories can be dropped in for more robustness  algorithms don t change
But use the normal at the collision time*Z)Z)rGeometryThe plane is easy
Interference: y<0
Collision: y became negative
Normal: constant (0,1,0)
Can work out other analytic cases (e.g. sphere)
More generally: triangle meshes and level sets
Heightfields sometimes useful  permit a few simplifications in speeding up tests  but special case
Splines and subdivision surfaces generally too complicated, and not worth the effort
Blobbies, metaballs, and other implicits are usually not as well behaved as level sets
Pointset surfaces: becoming a hot topic\PHP_P:PH_:b
XN WsImplicit Surfaces2Define surface as where some scalar function of x,y,z is zero:
{x,y,z  F(x,y,z)=0}
Interior (can only do closed surfaces!) is where function is negative
{x,y,z  F(x,y,z)<0}
Outside is where it s positive
{x,y,z  F(x,y,z)>0}
Ground is F=y
Example: F=x2+y2+z21 is the unit sphere?ZZFZZZZ7Z?F
tTesting Implicit SurfacesInterference is simple:
Is F(x,y,z)<0?
Collision is a little trickier:
Assume constant velocityx(t+h)=x(t)+hv
Then solve for h: F(x(t+h))=0
This is the same as raytracing implicit surfaces&
But if moving, then need to solveF(x(t+h), t+h)=0
Try to bound when collision can occur (find a sign change in F) then use secant search \ZZ ZZ luImplicit Surface Normals Outward normal at surface is just
Most obvious thing to use for normal at a point inside the object (or anywhere in space) is the same formula
Gradient is steepestdescent direction, so hopefully points to closest spot on surface: direction to closest surface point is parallel to normal there
We really want the implicit function to be monotone as we move towards/away from the surface.ZZvBuilding Implicit Surfaces4Planes and spheres are useful, but want to be able to represent (approximate) any object
Obviously can write down any sort of functions, but want better control
Exercise: write down functions for some common shapes (e.g. cylinder?)
Constructive Solid Geometry (CSG)
Look at set operations on two objects
[Complement, Union, Intersection, & ]
Using primitive F() s, build up one massive F()
But only sharp edges& ZGZ"Z&Z%ZFZG"&%Fh1wGetting back to particles8 Metaballs , blobbies , &
Take your particle system, and write an implicit function:
Kernel function f is something smooth like a Gaussian
Strength a and radius r of each particle (and its position x) are up to you
Threshold t is also up to you (controls how thick the object is)HXZZXAP @8xProblems with theseThey work beautifully for some things!
Some machine parts, water droplets, goo, &
But, the more complex the surface, the more expensive F() is to evaluate
Need to get into more complicated data structures to speed up to acceptable
Hard to directly approximate any given geometry
Monotonicity  how reliable is the normal?
t'Z+ZIZLZ\Z'+IL\,K
ySigned DistanceNote infinitely many different F represent the same surface
What s the nicest F we can pick?
Obviously want smooth enough for gradient (almost everywhere)
It would be nice if gradient really did point to closest point on surface
Really nice (for repulsions etc.) if value indicated how far from surface
The answer: signed distanceKZKzDefining Signed DistanceGenerally use the letter f instead of F
Magnitude is the distance from the surface
Note that function is zero only at surface
Sign of f(x) indicates inside (<0) or outside(>0)
[examples: plane, sphere, 1d]D]+PD+P{Closest Point PropertyGradient is steepestascent direction
Therefore, in direction of closest point on surface (shortest distance between two points is a straight line)
The closest point is by definition distance f away
So closest point on surface from x isH&n[&nUnit Gradient PropertyLook along line from closest point on surface to x
Value is distance along line
Therefore directional derivative is 1:
But plug in the formula for n [work out]
So gradient is unit length:Z}Aside: Eikonal equation There s a PDE!
Called the Eikonal equation
Important for all sorts of things
Later in the course: figure out signed distance function by solving the PDE&
See Ian Mitchell s course on level sets for a lot more detail6>>~Aside: Spherical particleszWe have been assuming our particles were just points
With signed distance, can simulate nonzero radius spheres
Sphere of radius r intersects object if and only if f(x)<r
i.e. if and only if f(x)r<0
So looks just like points and an expanded version of the original implicit surface  normals are exactly the same, & boZZo4 w
Level SetsUse a discretized approximation of f
Instead of carrying around an exact formula store samples of f on a grid (or other structure)
Interpolate between grid points to get full definition (fast to evaluate!)
Almost always use trilinear [work out]
If the grid is fine enough, can approximate any wellbehaved closed surface
But if the features of the geometry are the same size as the grid spacing or smaller, expect BAD behaviour
Note that properties of signed distance only hold approximately!Z'ZLZkZAZ#'LkA,
Building Level SetsWe ll get into level sets more later on
Lots of tools for constructing them from other representations, for sculpting them directly, or simulating them&
For now: can assume given
Or CSG: union and intersection with min and max[show 1d]
Just do it grid point by grid point
Note that weird stuff could happen at subgrid resolution (with trilinear interpolation)
Or evaluate from analytical formulat(ZqZTZ}Z$Z(qT}$P3Normals
TWe do have a function F defined everywhere (with interpolation)
Could take its gradient and normalize
But (with trilinear) it s not smooth enough
Instead use numerical approximation for gradient:
Then, use trilinear interpolation to get (continuous) approximate gradient anywhere
Or instead apply finite difference formula to 6 trilinearly interpolated points (mathematically equivalent)
Normalize to get unitlength normal\@ZRZ5ZZ@R5>o
WpUEvaluating outside the gridCheck if evaluation point x is outside the grid
If outside  that s enough for interference test
But repulsion forces etc. may need an actual value
Most reasonable extrapolation:
A = distance to closest point on grid
B = f at that point
Lower bound on distance, correct asymptotically and continuous (if level set doesn t come to boundary of grid):
Or upper bound on distance:
XZZZ*Explicit SurfacesAn explicit formula to generate points on surface from 2D parameter space
E.g. x(a,b)=(a,0,b) is the plane
x is a convex combination of 3 fixed points chosen from a list of triples: triangle mesh
Interference  does a ray cast to infinity cross surface an odd number of times
Or check outward normal at closest point on surface, after finding it!
Note: can do open surfaces with no interior
tJZzZPZGZZJzPG$Explicit Surfaces& Collision  solve xsurface(a,b)=xparticle(t) for t in collision time step
Want first solution if one exists
Note: 3 unknowns in general: a,b,t
Normal: finally something easy
Explicit formula from crossproduct of partial derivativespJE;!E;, Normals not on the surfaceCan take our cue from implicit surfaces
Take the direction to the closest point (or a reasonable approximation of it)
Note that this kind of looks like figuring out signed distance (or some other implicit surface function)&((xMoEh&CCOhk!"%j!HޝMgݵ(TTBJzN%\nP @=QW~6ofguQ'/www.fftw.org/g/&_=RTRobert Bridson R<;͛ve{ߜy{unLhDTz;# NfpG17&*cvmHQa姇?*cxs2)AU hBh'?9˯gU ~2XOޕugCxEe5~hP*s[{{߉
w"mFDV]W*!^(?7VtjqHx 1Ux
fIu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ation.30$Microsoft EquationEquation Equation.30$Microsoft EquationEquation Equation.30$Microsoft EquationEquation Equation.30$Microsoft EquationEquation Equation.30$Microsoft EquationEquation Equation.30$Microsoft EquationEquation Equation.30$Microsoft Equation/0DTimesgsortsPs&DOptimagsortsPs& DHelveticaortsPs&0DMonotype SortsPs&@DWingdingsortsPs&PDSymbolgsortsPs&
`.
@n?" dd@ @@``TLdu #
/B$(Jd0FB$%*t'/.;FB$9B{ 1 S?s+B$IID:_B$Nr{K[ 1B$J#(2B$2 tNB$v0Ƀ)Z
I+
GB$uʎK 2k37B$jo&ear(:!$$$$$$$B$P8ZW)P72t0?1c$ h@huʚ;2Nʚ;g4=d=ds{Fm
ppp@<4!d!d@`gʚ;<4dddd@`gʚ;<4BdBd@`ʚ;hph___PPT2001D<4X?8, $cs533dwinter2005O8, $cs533dwinter2005XVNotes
gNumerical Implementation 1Get candidate x(t+"t)
Check to see if x(t+"t) is inside object (interference)
If so
Get normal n at t+"t
Get new velocity v from collision response formulas and average v
Replay x(t+"t)=x(t)+"tv&ToTohRobustness?If a particle penetrates an object at end of candidate time step, we fix that
But new position (after collision processing) could penetrate another object!
Maybe this is finelet it go until next time step
But then collision formulas are on shaky ground&
Switch to repulsion impulse if x(t) and x(t+"t) both penetrate
Find "vN proportional to final penetration depth, apply friction as usualD>J>
BDAiMaking it more robustOther alternative:
After collision, check if new x(t+"t) also penetrates
If so, assume a 2nd collision happened during the time step: process that one
Check again, repeat until no penetration
To avoid infinite loop make sure you lose kinetic energy (don t take perfectly elastic bounces, at least not after first time through)
Let s write that down: &LLjNumerical Implementation 2Get candidate x(t+"t)
While x(t+"t) is inside object (interference)
Get normal n at t+"t
Get new velocity v from collision response formulas and average v
Replay x(t+"t)=x(t) + "t v
Now can guarantee that if we start outside objects, we end up outside objects<DsNDsNkMicroCollisionsvThese are microcollision algorithms
Contact is modeled as a sequence of small collisions
We re replacing a continuous contact force with a sequence of collision impulses
Is this a good idea?
[block on incline example]
More philosophical question: how can contact possibly begin without fully inelastic collision?j\Q_\Q_lImproving MicroCollisionsReally need to treat contact and collision differently, even if we use the same friction formulas
Idea:
Collision occurs at start of time step
Contact occurs during whole duration of time step&hYhYmNumerical Implementation 3PStart at x(t) with velocity v(t), get candidate position x(t+"t)
Check if x(t+"t) penetrates object
If so, process elastic collision using v(t) from start of step, not average velocity
Replay from x(t) with modified v(t)
Could add "t"v to x(t+"t) instead of reintegrating
Repeat check a few (e.g. 3) times if you want
While x(t+"t) penetrates object
Process inelastic contact (e=0) using average v
Replay x(t+"t)=x(t)+"t vd Id nWhy does this work?If object resting on plane y=0, v(t)=0 though gravity will pull it down by t+"t
In the new algorithm, elastic bounce works with pregravity velocity v(t)=0
So no bounce
Then contact, which is inelastic, simply adds just enough "v to get back to v(t+"t)=0
Then x(t+"t)=0 too
NOTE: if e=0 anyways, no point in doing special first step  this algorithm is equivalent to the previous one
Vn
V doMoving objectspSame algorithms, and almost same formulas:
Need to look at relative velocityvparticlevobjectinstead of just particle velocity
As before, decompose into normal and tangential parts, process the collision, and reassemble a relative velocity
Add object velocity to relative velocity to get final particle velocity
Be careful when particles collide:
Same relative "v but account for equal and opposite forces/impulses with different masses&
+#\+#
#[,L
ZpMoving Objects& Also, be careful with interference/collision detection
Want to check for interference at end of time step, so use object positions there
Objects moving during time step mean more complicated trajectory intersection for collisions*77$ qCollision DetectionWe have basic time integration for particles in place now
Assumed we could just do interference detection, but&
Detecting collisions over particle trajectories can be dropped in for more robustness  algorithms don t change
But use the normal at the collision time&))rGeometryThe plane is easy
Interference: y<0
Collision: y became negative
Normal: constant (0,1,0)
Can work out other analytic cases (e.g. sphere)
More generally: triangle meshes and level sets
Heightfields sometimes useful  permit a few simplifications in speeding up tests  but special case
Splines and subdivision surfaces generally too complicated, and not worth the effort
Blobbies, metaballs, and other implicits are usually not as well behaved as level sets
Pointset surfaces: becoming a hot topic\PHP_P:PH_:b
XM WsImplicit Surfaces2Define surface as where some scalar function of x,y,z is zero:
{x,y,z  F(x,y,z)=0}
Interior (can only do closed surfaces!) is where function is negative
{x,y,z  F(x,y,z)<0}
Outside is where it s positive
{x,y,z  F(x,y,z)>0}
Ground is F=y
Example: F=x2+y2+z21 is the unit sphere?F7?F
tTesting Implicit SurfacesInterference is simple:
Is F(x,y,z)<0?
Collision is a little trickier:
Assume constant velocityx(t+h)=x(t)+hv
Then solve for h: F(x(t+h))=0
This is the same as raytracing implicit surfaces&
But if moving, then need to solveF(x(t+h), t+h)=0
Try to bound when collision can occur (find a sign change in F) then use secant search T luImplicit Surface Normals Outward normal at surface is just
Most obvious thing to use for normal at a point inside the object (or anywhere in space) is the same formula
Gradient is steepestdescent direction, so hopefully points to closest spot on surface: direction to closest surface point is parallel to normal there
We really want the implicit function to be monotone as we move towards/away from the surface*vBuilding Implicit Surfaces4Planes and spheres are useful, but want to be able to represent (approximate) any object
Obviously can write down any sort of functions, but want better control
Exercise: write down functions for some common shapes (e.g. cylinder?)
Constructive Solid Geometry (CSG)
Look at set operations on two objects
[Complement, Union, Intersection, & ]
Using primitive F() s, build up one massive F()
But only sharp edges& G"&%FG"&%Fh1wGetting back to particles8 Metaballs , blobbies , &
Take your particle system, and write an implicit function:
Kernel function f is something smooth like a Gaussian
Strength a and radius r of each particle (and its position x) are up to you
Threshold t is also up to you (controls how thick the object is)DXXAP @8xProblems with theseThey work beautifully for some things!
Some machine parts, water droplets, goo, &
But, the more complex the surface, the more expensive F() is to evaluate
Need to get into more complicated data structures to speed up to acceptable
Hard to directly approximate any given geometry
Monotonicity  how reliable is the normal?
j'+IL\'+IL\,K
ySigned DistanceNote infinitely many different F represent the same surface
What s the nicest F we can pick?
Obviously want smooth enough for gradient (almost everywhere)
It would be nice if gradient really did point to closest point on surface
Really nice (for repulsions etc.) if value indicated how far from surface
The answer: signed distanceKKzDefining Signed DistanceGenerally use the letter f instead of F
Magnitude is the distance from the surface
Note that function is zero only at surface
Sign of f(x) indicates inside (<0) or outside(>0)
[examples: plane, sphere, 1d]D]+PD+P{Closest Point PropertyGradient is steepestascent direction
Therefore, in direction of closest point on surface (shortest distance between two points is a straight line)
The closest point is by definition distance f away
So closest point on surface from x isH&n[&nUnit Gradient PropertyLook along line from closest point on surface to x
Value is distance along line
Therefore directional derivative is 1:
But plug in the formula for n [work out]
So gradient is unit length:}Aside: Eikonal equation There s a PDE!
Called the Eikonal equation
Important for all sorts of things
Later in the course: figure out signed distance function by solving the PDE&
See Ian Mitchell s course on level sets for a lot more detail6>>~Aside: Spherical particleszWe have been assuming our particles were just points
With signed distance, can simulate nonzero radius spheres
Sphere of radius r intersects object if and only if f(x)<r
i.e. if and only if f(x)r<0
So looks just like points and an expanded version of the original implicit surface  normals are exactly the same, & ^oo4 w
Level SetsUse a discretized approximation of f
Instead of carrying around an exact formula store samples of f on a grid (or other structure)
Interpolate between grid points to get full definition (fast to evaluate!)
Almost always use trilinear [work out]
If the grid is fine enough, can approximate any wellbehaved closed surface
But if the features of the geometry are the same size as the grid spacing or smaller, expect BAD behaviour
Note that properties of signed distance only hold approximately!~'LkA#'LkA,
Building Level SetsWe ll get into level sets more later on
Lots of tools for constructing them from other representations, for sculpting them directly, or simulating them&
For now: can assume given
Or CSG: union and intersection with min and max[show 1d]
Just do it grid point by grid point
Note that weird stuff could happen at subgrid resolution (with trilinear interpolation)
Or evaluate from analytical formulaj(qT}$(qT}$P3Normals
TWe do have a function F defined everywhere (with interpolation)
Could take its gradient and normalize
But (with trilinear) it s not smooth enough
Instead use numerical approximation for gradient:
Then, use trilinear interpolation to get (continuous) approximate gradient anywhere
Or instead apply finite difference formula to 6 trilinearly interpolated points (mathematically equivalent)
Normalize to get unitlength normalT@R5@R5>o
WpTEvaluating outside the gridCheck if evaluation point x is outside the grid
If outside  that s enough for interference test
But repulsion forces etc. may need an actual value
Most reasonable extrapolation:
A = distance to closest point on grid
B = f at that point
Lower bound on distance, correct asymptotically and continuous (if level set doesn t come to boundary of grid):
Or upper bound on distance:
R*
0(
l
Cpo``0
l
CЎoP `
H
0h ? 2FFfr;=