Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Flocking Simulation with Phoenix Channels
Search
Christian Bäuerlein
April 19, 2018
Programming
1
380
Flocking Simulation with Phoenix Channels
Code can be found here:
https://github.com/fabrik42/flocking_elixir
Christian Bäuerlein
April 19, 2018
Tweet
Share
More Decks by Christian Bäuerlein
See All by Christian Bäuerlein
Single File Ruby Programs @ RubyUnconf 2023
fabrik42
0
160
Single File Ruby Programs 2.0
fabrik42
1
200
Single File Ruby Programs
fabrik42
0
270
Agile Software Development for Software Developers
fabrik42
0
48
Phoenix Live View
fabrik42
0
590
Rails API-only considerations
fabrik42
0
360
Org-Mode
fabrik42
0
520
Cleaner, scalable views with object oriented components
fabrik42
0
360
Headless Browser Experiments
fabrik42
0
390
Other Decks in Programming
See All in Programming
Ruby×iOSアプリ開発 ~共に歩んだエコシステムの物語~
temoki
0
320
AI Coding Agentのセキュリティリスク:PRの自己承認とメルカリの対策
s3h
0
230
個人軟體時代
ethanhuang13
0
320
RDoc meets YARD
okuramasafumi
4
170
OSS開発者という働き方
andpad
5
1.7k
今だからこそ入門する Server-Sent Events (SSE)
nearme_tech
PRO
3
230
「手軽で便利」に潜む罠。 Popover API を WCAG 2.2の視点で安全に使うには
taitotnk
0
860
アルテニア コンサル/ITエンジニア向け 採用ピッチ資料
altenir
0
110
Android 16 × Jetpack Composeで縦書きテキストエディタを作ろう / Vertical Text Editor with Compose on Android 16
cc4966
2
240
Cache Me If You Can
ryunen344
2
1.5k
機能追加とリーダー業務の類似性
rinchoku
2
1.3k
テストカバレッジ100%を10年続けて得られた学びと品質
mottyzzz
2
600
Featured
See All Featured
Speed Design
sergeychernyshev
32
1.1k
How to Think Like a Performance Engineer
csswizardry
26
1.9k
Making Projects Easy
brettharned
117
6.4k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
840
Measuring & Analyzing Core Web Vitals
bluesmoon
9
580
Building Adaptive Systems
keathley
43
2.7k
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
Bash Introduction
62gerente
615
210k
A designer walks into a library…
pauljervisheath
207
24k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
RailsConf 2023
tenderlove
30
1.2k
Transcript
Flocking Simulation with Phoenix Channels
Flocking Theory
None
Use case: Cinematic effects
Boid: One member of a flock
* Location
* Location * Perception Radius
* Location * Perception Radius * Velocity * Heading
You Need Three Behaviours
1. Cohesion
1. Cohesion
1. Cohesion
2. Alignment
2. Alignment
2. Alignment
3. Separation
3. Separation
3. Separation ! !
3. Separation ! !
* Cohesion * Alignment * Separation = Next move
Architecture
Phoenix BoidsChannel Receives Updates Changes Settings GenServer WorldStateUpdater Calling itself
30 times per second Simulation Calculates new positions per boid based on world state <canvas> Renderer Renders updated world state Socket Connection Receives Updates Changes Settings
Demo Time!
Read on! http://harry.me/blog/2011/02/17/neat-algorithms-flocking/ http://www.red3d.com/cwr/boids/