Article Index

Boids Algorithm

Published on

Overview

Let us watch a demo first.

Go to https://boids.rbtr.ee/ to see further.

As you can see, the Boids algorithm is a method to simulate the movements of social creatures.

Algorithm

The Boids algorithm is quite simple.
Each individual only needs to follow three rules.

  1. Separation.
    To avoid collision, a force is applied between individuals that are too close. The closer they are, the stronger the force.
  2. Alignment
    To prevent individuals from drifting away, they tend to align with the average direction of their neighbors.
  3. Cohesion
    Individuals who are not at the center of the group tend to move toward the center.

Code

https://github.com/rbtre/Boids/


  • Category: 杂事
  • Last update: 2025-08-18 17:21:53UTC+8
  • Tags: No tags

No comments

Post a comment