GithubHelp home page GithubHelp logo

jyanar / boids Goto Github PK

View Code? Open in Web Editor NEW
33.0 5.0 13.0 5.13 MB

An implementation of the Boids program using C++ and the SFML library.

License: MIT License

C++ 97.20% Makefile 2.80%
boids cpp sfml simulation hacktoberfest

boids's Introduction

Boids

This project attempts to simulate flocking behavior, through the creation of simple entities called boids (birdoids). Boids, which exist on a two-dimensional plane, function through three simple rules -- alignment, cohesion, and separation.

  • Alignment causes boids to match velocity of nearby boids.
  • Cohesion causes boids to seek the center of mass of the nearest clump of boids.
  • Separation prevents boids from getting too close to each other.

These three simple rules cause complex behavior to emerge, which is what makes the boid simulation interesting. The algorithm was originally formulated by Craig Reynolds in the 1980s.

Running the simulation

Install SFML (Simple and Fast Multi-Media Library) in order the run the program.

  • Windows: See here for a version that runs through Visual Studio.
  • OS X: brew install sfml
  • Ubuntu / Debian-based distros: sudo apt-get install libsfml-dev

Then cd into the src folder and run make to produce an executable file called boids-sim.

./boids-sim

to run the simulation. Exit with the esc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.