LingDong- / ndwfc

🌊💥 N-dimensional Wave Function Collapse with infinite canvas
https://ndwfc.glitch.me/
MIT License
316 stars 10 forks source link

Starting from a seed? #8

Open arronhunt opened 2 years ago

arronhunt commented 2 years ago

I noticed the class function accepts a wave parameter that isn't documented. I assumed I could use this to seed the wave and it kinda works.

// Works fine, first cell is 0
let wfc = new WFC({ nd, rules, weight, wave: { "0,0": 0 } });

// Doesn't work :( fills the wave with `undefined`
let wfc = new WFC({ nd, rules, weights, wave: { "1,0": 0 } });

Is it possible to provide one (or multiple) starting values and allow the wave to collapse around them?

JackTezos commented 11 months ago

+1, I would also like to have this feature.