WasinUddy / WaveFunction-Collapse-Algorithm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WaveFunction-Collapse-Algorithm

WFC is an algorithm developed by Maxim Gumin as a texture synthesis method based on simple configuration or sample images. It is a constraint-based procedural algorithm that is inspired and named after the concept wave function collapse from quantum physics. In quantum physics, wave function collapse is the idea that the unobserved state of a particle can be anything. As soon as the particle is observed, the possibilities disappear and the wave function collapses. The same idea is the backbone of the procedural algorithm. WFC can be implemented with two different models, the tiled model and the overlapping model.

The following code will create image of a Cave as well as wavefunction collapsing animation

tileset credit : OpenGameArt.org

Usage

installing library

pip install opencv-python
pip install numpy
pip install imageio

Running

python generator.py

About

License:MIT License


Languages

Language:Python 100.0%