Beruflich Dokumente
Kultur Dokumente
Ruth Aylett
Overview
Particle systems
Solid objects
What it is
Autonomy
objects should act and react in a virtual
world as they would in the real world
if you drop a rubber ball it should fall and
bounce
if you drop a glass it should fall and smash
if you drop a jelly it should fall and wobble
Interaction
for haptic devices physical forces are
required for input and output
Virtual assembly would be odd without it
a good PBM can make interaction feel
more real
may lead to more realistic interaction between
the user and the environment
e.g. vehicle physics in simulators and games
Presence
better interaction and autonomy are more
likely to achieve a suspension of disbelief
increased visual realism
erosion and weathering
physically based rendering of paints & pigments
Collisions
Approximate collision
detection
Bounding volumes - 1
Bounding volumes - 2
Axis-aligning bounding boxes (AABB)
Aligned to axes of world: quite easy to set up
As objects rotate may become pretty inaccurate
Detecting collision
Scene coherence
Objects do not move much between frames
all fixed size bounding boxes projected onto world
coodinate system at start
Sort interval list and create overlap pairs
Traverse sorted lists at each frame
Collision detection is O(n) for n objects
Vectors
Scalar quantities
mass
length
area
time
Vector notation
area
velocity
a
v
(scalar)
(vector)
Direction vectors
v = p2 - p1
vx = p2x - p1x
vy = p2y - p1y
vz = p2z - p1z
Y
p2
Z
v
p1
X
Direction vectors
Example:
p1 = {1, 5, 4}
p2 = {7, 6, 3}
v = {7-1, 6-5, 3-4}
= {6, 1, -1}
Direction vectors
x = p1x + vx
y = p1y + vy
z = p1z + vz
Adding vectors
v2
p3
p2
v3
v1
p1
Scaling vectors
v1
v2 = sv1
B
H2 = A2 + B2
Direction Cosines
Y
Z
v
c
b
( ay bz - az by ,
az bx - ax bz ,
ax by - ay bx )
Solid Objects
Rigid bodies
particles
extended masses
Collision response
Deformable objects
f = ma
Mechanics
Mechanics
Acceleration
a= v-u
t
or
v = u + at
where:
u is the initial velocity
v is the final velocity
Mechanics
Displacement, s
s = t * u+v
2
giving:
s = ut + 1/2 at2
and:
v2 = u2 + 2as
Mechanics
Moving
Implemented graphically as
interpolation between frames
However linear interpolation (e.g. X3D)
clearly not physically correct in most cases
Acceleration produces non-linear motion
Use Newtonian mechanics to calculate
displacement under acceleration
Modelling a particle
Modelling a particle
Extended bodies
force
Extended bodies
Extended bodies
Extended bodies
(y2 +z 2) dm
Iy = (x2 +z2) dm
Iz = (x2 +y2) dm
Ix =
Extended bodies
Symmetrical bodies
A sphere, with radius r and mass m
Ix = Iy = Iz = 2/5 mr2
A cylinder ,with radius r and height h,
where the z axis is the along the long axis
of the cylinder
Ix = Iy = 1/4 m (r2 + 1/3 h2 )
Iz = 1/2 mr2
Extended bodies
A box, with sides a, b and c along the x, y and z
axes respectively
Ix = 1/12 m (a2 + b2)
Iy = 1/12 m (a2 + c2)
Iz = 1/12 m (b2 + c2)
Extended bodies
Extended bodies