Clayton Anderson

Shape Grammar Building

I discuss procedural generation of terrain quite in the articles section. However, for non-organic shapes, like houses, buildings, we need a different approach. This project is a first step in Shape Grammars, which generate a shape from a set of iterated rules. For instance, suppose my rules are A -> AB, B -> C, C -> A, and that I start with A. Then the sequence I generate from applying my rules 5 times is

A -> AB -> ABCA -> ABCAAB -> ABCAABABC -> ABCAABABCABCA

These types of rules can often generate very interesting patterns. The structure below was made with rules like Wall -> Entrance + Room, and Room -> Room + Room Above, with some probabilistic components where I wouldn't apply the rules to every possible variable (like I did with the ABC example), but would only change some of the walls into entrances, etc.

This project was implemented in C++ / OpenGL (not Mathematica!).