Crowd Simulation System

Download Report

Transcript Crowd Simulation System

Crowd Simulation System:
Simple Approach
Sai-Keung Wong
Crowd Simulation System and
Rendering
Purposes
1. Simulate the movement of crowd
2. Render the crowd
3. Render the environment including buildings
and obstacles.
4. Render the computed values for visualization,
usually in an abstraction mode.
Crowd Simulation System
• Input: A set of characters
– Each character has the following attributes:
• current position, velocity, desired velocity, acceleration, desired
acceleration, destination, etc.
• Implicitly maintain a path from the current position to the
destination position
• Output:
– the new acceleration anew, and new velocity vnew of each
character
• Update based on explicit Euler integration method:
vnew = vcur+ anew Δt
pnew = pcur + vnew Δt,
where Δt is the time step size
Crowd Simulation System
Compute anew
• Compute net force Fnet exerting on the character
• According to Fnet = m anew, we have
anew = Fnet / m,
where m is the mass of the character.
Crowd Simulation System
• Crowd simulation system
– Crowd simulation
• Compute position, velocity, velocity field
– Map
• Obstacles, path finding
– Crowd renderer
• Render characters, velocity field, velocity, etc.
Social force model
• Crowd simulation loop
– For each agent
•
•
•
•
•
•
Check environment
Compute a path
Compute forces
Compute acceleration
Compute velocity
Compute temporary position
– For each agent
• Advance to temporary position if no collision
• Alternative: advance to temporary position and then resolve
collision for all agents
Example: Post-processing for collision free
p2
r2
p1
r1
d = distance(p1, p2)
u = (p1 – p2) / ∥ p1 – p2 ∥
if ( d < r1 + r2) {
Δ = r1 + r2 – d
p1 = p1 + u*Δ / 2
p2 = p2 – u*Δ / 2
}
Alert Radius
• When an agent moves, it avoids getting close
to another agent and vice versa.
• So the alert radius ra > r
p2
p1
d = distance(p1, p2) >= ra1 + ra2