Giter VIP home page Giter VIP logo

physarum-webgl's Introduction

1500x500

DEMO

This is a simulation of the Physarum polycephalum, a slime mold that, even though it’s missing a nervous system, exhibits quite interesting, seemingly intelligent behaviour. There have been a number of attempts to define a rule set for these organisms that would explain this behaviour. This simulation is based on the implementation presented in this paper.

The single slime cells are simulated as particles. Every frame, each particle samples three positions in front of it (front, font-left & front-right) and depending on the colour value in each sample it will move (straight, straight-left, or straight-right respectively). There’s also a chance a particle will move in a random direction. Each particle will also leave a trail which diffuses and decays over time. This trail is what is being sampled by each particle. The implementation supports up to 3 different species, that can infect each other.

Controls

Use the controls on the right to adjust the settings. You can control the distance and angle for both movement and sampling for each color individually. You can also adjust the attraction of the colors to each other.

Click to spawn more particles. Move mouse to push particles around.

The simulation is implemented in Javascript & WebGL using Three.js.

Many thanks to

https://github.com/nicoptere/physarum - Helped me a lot to figure out how to implement this. The logic in the PingpongShader and Shader classes and some of the shader logic were almost directly adapted from that project.`

Particle sprites are from Kenney.nl

Build with

npx webpack

physarum-webgl's People

Contributors

bewelge avatar maxbittker avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.