Blog about (Web-) Programming, Graphics and Games.


Canvas experiment: Penrose Tiling

I experimented with an algorithm which generates a penrose tiling. This pattern consists of 2 tiles: and is non-periodic (never repeats itself).

►Start demo

The current algorithm is still suboptimal, there remain gaps in the pattern. The algorithm works as follows: Before a tile is added, the local neighborhood is checked for upcoming conflicts. Since only a local environment is checked, there can still emerge conflicts (gaps) for the global pattern. To improve the algorithm, one could introduce heuristics or make it interactive: a user could remove pattern areas which contain gaps. Then the generating could be restarted in this areas. (The demo is inspired by an article in the journal Spektrum d.W.)

2 Kommentare:

Sidasa hat gesagt…

interessant. wurde das schon mal in einem Spiel benutzt?

pl4n3 hat gesagt…

Thanks! Nicht das ich wüsste. Den Gedanken, solche Kacheln in einem Spiel zu verwenden, hatte ich auch schonmal. Vielleicht wie in Go: 2 Spieler bauen Muster und muessen moeglichst viel Gebiet gegeneinander eingrenzen..