Giter Site home page Giter Site logo

munteanuic-zz / flocking-simulation Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 9 KB

Boids animation in Processing. Boids simulate the flocking behavior of birds, based on alignment, separation, and cohesion.

Processing 100.00%
simulation boids-simulation processing cohesion alignment separation user-interaction

flocking-simulation's Introduction

Flocking Simulation

Author

Ioana Munteanu

Demo

Click here!

Installation

  1. Download Processing.
  2. Clone the repository.
  3. Open it in Processing and press 'Run'.

Description

  • I designed a boids simulation that represents a school of fish in the ocean. Each fish was designed as a green triangle over a yellow triangle with an ellipse for the eye. The simulation will start with 25 fish and will generate 3 more fish per frame until it reaches 50.
  • The user can turn on an off:
    • alignment (steer towards the average heading of local flockmates)
    • cohesion (steer to move towards the average position (center of mass) of local flockmates)
    • separation (steer to avoid crowding local flockmates)

User interaction

  • mouse left click: add more fish (up to 100)
  • S: separation feature on
  • s: separation feature off
  • C: cohesion feature on
  • c: cohesion feature off
  • A: alignment feature on
  • a: alignment feature off
  • F: 10 of the fish will follow the mouse and will disappear when then reach it (follow feature)
  • f: follow feature off
  • d: double the speed of the fish up to a maximum speed
  • h: reduce the speed of the fish by 2

Programming language

  • Processing

Libraries

  • peasy: PeasyCam provides a dead-simple mouse-driven camera for Processing.

flocking-simulation's People

Contributors

munteanuic-zz avatar

Watchers

 avatar

Forkers

munteanuic

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.